System\Classes\UpdateManager

Overview

UpdateManager handles the CMS install and update process.


Protected Properties

protected string $baseDirectory

baseDirectory for application.

protected string $tempDirectory

tempDirectory for working.

protected PluginManager $pluginManager

protected ThemeManager $themeManager

protected VersionManager $versionManager

protected int $migrateCount

migrateCount number of migrations that occurred.

protected Illuminate\Console\OutputStyle $notesOutput

protected Illuminate\Console\Command $notesCommand

protected string $key

Secure API Key

protected string $secret

Secure API Secret


Public Methods

public __construct()

public __construct(): void

__construct this class

public canUpdateProject()

public canUpdateProject(): bool 

canUpdateProject checks if composer is ready to access the gateway using authentication

public check()

public check($force = false): int 

check for new updates and returns the amount of unapplied updates

public checkVersions()

public checkVersions($force = false): array 

checkVersions checks for available versions

public getComposerProjectKey()

public getComposerProjectKey(): string|null 

getComposerProjectKey returns the project key used by composer

public getComposerUrl()

public getComposerUrl($withProtocol = true): string 

getComposerUrl returns the endpoint for composer

public getCurrentBuildNumber()

public getCurrentBuildNumber(): string|null 

getCurrentBuildNumber return the current build number

public getCurrentVersion()

public getCurrentVersion(): string 

getCurrentVersion returns the current version, with or without build

public getMigrationTableName()

public getMigrationTableName(): string 

getMigrationTableName returns the migration table name

public getNotesCommand()

public getNotesCommand(): Illuminate\Console\Command|null 

getNotesOutput returns the note command object, if available.

public getNotesOutput()

public getNotesOutput(): Illuminate\Console\OutputStyle|null 

getNotesOutput returns the note output, used by command line.

public getProjectDetails()

public getProjectDetails(): object|null 

getProjectDetails returns the active project details

public getProjectKey()

public getProjectKey(): void

getProjectKey locates the project key from the file system and seeds the parameter

public installPlugin()

public installPlugin($name): void

installPlugin using composer

public installTheme()

public installTheme($name): void

installTheme using composer

public static instance()

public static instance(): static 

instance creates a new instance of this singleton

public migrateApp()

public migrateApp(): void

migrateApp runs migrations on the app directory

public migrateModule()

public migrateModule($module): void

migrateModule runs migrations on a single module

public migrateModules()

public migrateModules(): void

migrateModules migrates all modules

public migratePlugin()

public migratePlugin($name): void

migratePlugin runs update on a single plugin

public migratePlugins()

public migratePlugins(): void

migratePlugins migrates all plugins

public requestBrowseProducts()

public requestBrowseProducts($type = null, $page = null): void

requestBrowseProducts will list available products

public requestBrowseProject()

public requestBrowseProject(): void

requestBrowseProject will list project details and cache it

public requestChangelog()

public requestChangelog(): void

requestChangelog returns the latest changelog information.

public requestPluginContent()

public requestPluginContent($name): array 

requestPluginContent looks up content for a plugin from the update server

public requestPluginDetails()

public requestPluginDetails($name): array 

requestPluginDetails looks up a plugin from the update server

public requestProjectDetails()

public requestProjectDetails($projectKey = null): array 

requestProjectDetails requests details about a project based on its identifier

public requestServerData()

public requestServerData(string $uri, array $postData = []): array 

requestServerData contacts the update server for a response.

public requestThemeContent()

public requestThemeContent($name): array 

requestThemeContent looks up content for a theme from the update server

public requestThemeDetails()

public requestThemeDetails($name): array 

requestThemeDetails looks up a theme from the update server

public requestUpdateList()

public requestUpdateList(): array 

requestUpdateList used for checking for new updates.

public rollbackApp()

public rollbackApp(): void

rollbackPlugin rolls back application migrations

public rollbackPlugin()

public rollbackPlugin($name): void

rollbackPlugin removes an existing plugin database and version record

public rollbackPluginToVersion()

public rollbackPluginToVersion($name, $toVersion): void

rollbackPlugin removes an existing plugin database and version record

public seedApp()

public seedApp(): void

seedModule runs seeds on the app directory

public seedModule()

public seedModule($module): void

seedModule runs seeds on a module

public seedModules()

public seedModules(): void

seedModules seeds all modules

public setBuild()

public setBuild($build): void 

setBuild sets the build number and hash

public setBuildNumberManually()

public setBuildNumberManually(): void

setBuildNumberManually asks the gateway for the latest build number and stores it.

public setNotesCommand()

public setNotesCommand(Illuminate\Console\Command $command): void

setNotesCommand sets the fully qualified command for writing notes.

public setNotesOutput()

public setNotesOutput(Illuminate\Console\OutputStyle $output): self 

setNotesOutput sets an output stream for writing notes.

public setSecurity()

public setSecurity(string $key, string $secret): void

Set the API security for all transmissions.

public storeProjectDetails()

public storeProjectDetails($details): void

public syncProjectPackages()

public syncProjectPackages(): array 

syncProjectPackages compares installed packages to project packages

public uninstall()

public uninstall(): void

uninstall rolls back all modules and plugins.

public uninstallPlugin()

public uninstallPlugin($name): void

uninstallPlugin attempts to remove the plugin using composer before deleting from the filesystem

public uninstallTheme()

public uninstallTheme($name): void

uninstallTheme attempts to remove the theme using composer before deleting from the filesystem

public update()

public update(): void

update creates the migration table and updates.

public updatePlugin()

public updatePlugin($name): void

Protected Methods

protected createNonce()

protected createNonce(): int 

Create a nonce based on millisecond time

protected createServerUrl()

protected createServerUrl(string $uri): string 

createServerUrl creates a complete gateway server URL from supplied URI

protected createSignature()

protected createSignature($data, $secret): string 

Create a unique signature for transmission.

protected findPluginComposerCode()

protected findPluginComposerCode($code): array 

findPluginComposerCode locates a composer code for a plugin

protected findThemeComposerCode()

protected findThemeComposerCode($code): array 

findThemeComposerCode locates a composer code for a plugin

protected getBuildFromVersion()

protected getBuildFromVersion($version): int 

getBuildFromVersion will return the patch version of a semver string eg: 1.2.3 -> 3, 1.2.3-dev -> 3

protected getComposerVersionConstraint()

protected getComposerVersionConstraint($versionStr): void

protected getMigrator()

protected getMigrator(): Illuminate\Database\Migrations\Migrator 

getMigrator returns the migrator service

protected getRepository()

protected getRepository(

): Illuminate\Database\Migrations\DatabaseMigrationRepository 

getRepository returns the migrator repository

protected makeHttpRequest()

protected makeHttpRequest(
    string $url,
    array $postData
): Illuminate\Http\Client\Response 

makeHttpRequest makes a specialized server request to a URL.

protected note()

protected note(string $message): self 

note writes a note event for the migrator.