abstract class InstalledApp extends BaseApp

Describes an app that needs database installation and has upgrade scripts for upgrading the database

Properties

protected $API

Reference to the main API, for convenience

from  BaseApp
static private $metadata from  BaseApp
protected $config
protected $database

Methods

__construct(Main $API)

All apps are constructed when Andromeda runs

mixed
Run(Input $input)

Checks if the client is running/needs to run install/upgrade {@inheritDoc}

static array
getUsage()

Returns an array of strings showing the CLI usage of the app

static string
getName()

No description

from  BaseApp
static string|null
getLogClass()

Return this app's BaseAppLog class name, if used (or null)

from  BaseApp
static 
getMetadata(string $app, string $key)

Loads a metadata for the given app with the given key

from  BaseApp
static array
getAppRequires(string $app)

No description

from  BaseApp
static string
getAppApiVersion(string $app)

No description

from  BaseApp
static string
getVersion()

No description

from  BaseApp
commit()

Tells the app to commit any changes made outside the database

from  BaseApp
rollback()

Tells the app to rollback any changes made outside the database

from  BaseApp
static string
getInstallFlags()

No description

static string
getUpgradeFlags()

No description

static array
getInstallUsage()

No description

static string
getConfigClass()

Return the BaseConfig class for this app

bool
allowInstall()

Returns true if the user is allowed to install/upgrade

static string
getTemplateFolder()

Returns the path of the app's code folder

static array
getUpgradeScripts()

No description

Install(Input $input)

Installs the app by importing its SQL file and creating config

Upgrade(Input $input)

Iterates over the list of upgrade scripts, running them sequentially until the DB is up to date with the code

Details

at line 126
__construct(Main $API)

All apps are constructed when Andromeda runs

Parameters

Main $API

at line 170
mixed Run(Input $input)

Checks if the client is running/needs to run install/upgrade {@inheritDoc}

Parameters

Input $input

the user input

Return Value

mixed

the value to be output to the user

Exceptions

InstallRequiredException

if the DB is not installed

UpgradeRequiredException

if the DB version does not match

See also

BaseApp::Run

at line 118
static array getUsage()

Returns an array of strings showing the CLI usage of the app

Return Value

array

possible commands

in BaseApp at line 47
abstract static string getName()

No description

Return Value

string

the lowercase name of the app

in BaseApp at line 50
static protected string|null getLogClass()

Return this app's BaseAppLog class name, if used (or null)

Return Value

string|null

in BaseApp at line 59
static protected getMetadata(string $app, string $key)

Loads a metadata for the given app with the given key

Loads the app's JSON metadata file but not its code

Parameters

string $app
string $key

in BaseApp at line 77
static array getAppRequires(string $app)

No description

Parameters

string $app

Return Value

array

Returns the list of apps this app depends on

in BaseApp at line 83
static string getAppApiVersion(string $app)

No description

Parameters

string $app

Return Value

string

Returns the major.minor API version this app is compatible with

in BaseApp at line 89
static string getVersion()

No description

Return Value

string

the app's version information

in BaseApp at line 95
commit()

Tells the app to commit any changes made outside the database

in BaseApp at line 98
rollback()

Tells the app to rollback any changes made outside the database

at line 107
static protected string getInstallFlags()

No description

Return Value

string

at line 108
static protected string getUpgradeFlags()

No description

Return Value

string

at line 110
static protected array getInstallUsage()

No description

Return Value

array

at line 121
abstract static protected string getConfigClass()

Return the BaseConfig class for this app

Return Value

string

at line 144
protected bool allowInstall()

Returns true if the user is allowed to install/upgrade

Return Value

bool

at line 151
static protected string getTemplateFolder()

Returns the path of the app's code folder

Return Value

string

at line 157
static protected array getUpgradeScripts()

No description

Return Value

array

the array of upgrade scripts indexed by version (in order!)

at line 194
protected Install(Input $input)

Installs the app by importing its SQL file and creating config

Parameters

Input $input

at line 207
protected Upgrade(Input $input)

Iterates over the list of upgrade scripts, running them sequentially until the DB is up to date with the code

Parameters

Input $input