Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
Elgg\UpgradeService Class Reference

Upgrade service for Elgg. More...

Public Member Functions

 __construct (\Elgg\i18n\Translator $translator,\Elgg\EventsService $events,\Elgg\PluginHooksService $hooks,\Elgg\Database\Datalist $datalist,\Elgg\Logger $logger,\Elgg\Database\Mutex $mutex)
 Constructor. More...
 
 run ()
 Run the upgrade process. More...
 

Protected Member Functions

 upgradeCode ($version, $quiet=false)
 Run any php upgrade scripts which are required. More...
 
 setProcessedUpgrade ($upgrade)
 Saves a processed upgrade to a dataset. More...
 
 getProcessedUpgrades ()
 Gets a list of processes upgrades. More...
 
 getUpgradeFileVersion ($filename)
 Returns the version of the upgrade filename. More...
 
 getUpgradeFiles ($upgrade_path=null)
 Returns a list of upgrade files relative to the $upgrade_path dir. More...
 
 getUnprocessedUpgrades ($upgrade_files=null, $processed_upgrades=null)
 Checks if any upgrades need to be run. More...
 
 processUpgrades ()
 Upgrades Elgg Database and code. More...
 

Static Protected Member Functions

static includeCode ($file)
 PHP include a file with a very limited scope. More...
 

Detailed Description

Upgrade service for Elgg.

private

Definition at line 9 of file UpgradeService.php.

Constructor & Destructor Documentation

Elgg\UpgradeService::__construct ( \Elgg\i18n\Translator  $translator,
\Elgg\EventsService  $events,
\Elgg\PluginHooksService  $hooks,
\Elgg\Database\Datalist  $datalist,
\Elgg\Logger  $logger,
\Elgg\Database\Mutex  $mutex 
)

Constructor.

Parameters
\Elgg\i18n\Translator$translatorTranslation service
\Elgg\EventsService$eventsEvents service
\Elgg\PluginHooksService$hooksPlugin hook service
\Elgg\Database\Datalist$datalistDatalist table
\Elgg\Logger$loggerLogger
\Elgg\Database\Mutex$mutexDatabase mutex service

Definition at line 51 of file UpgradeService.php.

Member Function Documentation

Elgg\UpgradeService::getProcessedUpgrades ( )
protected

Gets a list of processes upgrades.

Returns
mixed Array of processed upgrade filenames or false

Definition at line 202 of file UpgradeService.php.

Elgg\UpgradeService::getUnprocessedUpgrades (   $upgrade_files = null,
  $processed_upgrades = null 
)
protected

Checks if any upgrades need to be run.

Parameters
null | array$upgrade_filesOptional upgrade files
null | array$processed_upgradesOptional processed upgrades
Returns
array

Definition at line 269 of file UpgradeService.php.

Elgg\UpgradeService::getUpgradeFiles (   $upgrade_path = null)
protected

Returns a list of upgrade files relative to the $upgrade_path dir.

Parameters
string$upgrade_pathThe up
Returns
array|false

Definition at line 231 of file UpgradeService.php.

Elgg\UpgradeService::getUpgradeFileVersion (   $filename)
protected

Returns the version of the upgrade filename.

Parameters
string$filenameThe upgrade filename. No full path.
Returns
int|false
Since
1.8.0

Definition at line 215 of file UpgradeService.php.

static Elgg\UpgradeService::includeCode (   $file)
staticprotected

PHP include a file with a very limited scope.

Parameters
string$fileFile path to include
Returns
mixed

Definition at line 179 of file UpgradeService.php.

Elgg\UpgradeService::processUpgrades ( )
protected

Upgrades Elgg Database and code.

Returns
bool

Definition at line 290 of file UpgradeService.php.

Elgg\UpgradeService::run ( )

Run the upgrade process.

Returns
array $result Associative array containing possible errors

Definition at line 70 of file UpgradeService.php.

Elgg\UpgradeService::setProcessedUpgrade (   $upgrade)
protected

Saves a processed upgrade to a dataset.

Parameters
string$upgradeFilename of the processed upgrade (not the path, just the file)
Returns
bool

Definition at line 190 of file UpgradeService.php.

Elgg\UpgradeService::upgradeCode (   $version,
  $quiet = false 
)
protected

Run any php upgrade scripts which are required.

Parameters
int$versionVersion upgrading from.
bool$quietSuppress errors. Don't use this.
Returns
bool

Definition at line 110 of file UpgradeService.php.


The documentation for this class was generated from the following file: