All Data Structures Functions Variables Pages
Static Public Member Functions | Static Protected Member Functions
InstallUtil Class Reference

Static Public Member Functions

static getSupportedDatabaseTypes ()
 
static canAssertionsBeEnabledAtRuntime ()
 
static checkWebServer (array $minimumRequiredVersions, &$actualVersion)
 
static checkApacheModDeflate ()
 
static checkPhp ($minimumRequiredVersion, &$actualVersion)
 
static checkPhpTimezoneSetting ()
 
static isMysqliInstalled ()
 
static isPdoInstalled ()
 
static isPdoMysqlInstalled ()
 
static isLdapInstalled ()
 
static isMbStringInstalled ()
 
static isMcryptInstalled ()
 
static checkPhpMaxMemorySetting ($minimumMemoryRequireBytes, &$actualMemoryLimitBytes)
 
static checkPhpUploadSizeSetting ($minimumUploadRequireBytes, &$actualUploadLimitBytes)
 
static checkPhpPostSizeSetting ($minimumPostRequireBytes, &$actualPostLimitBytes)
 
static isFileUploadsOn ()
 
static checkDatabase ($databaseType, $databaseHostname, $databaseUsername, $databasePassword, $databasePort, $minimumRequiredVersion, &$actualVersion)
 
static checkAPC ($minimumRequiredVersion, &$actualVersion)
 
static checkSoap ()
 
static checkSPL ()
 
static checkPCRE ()
 
static checkCtype ()
 
static checkImap ()
 
static checkZip ()
 
static checkServerVariable (&$error)
 
static checkMemcache ($minimumRequiredVersion, &$actualVersion)
 
static checkMemcached ($minimumRequiredVersion, &$actualVersion)
 
static checkCurl ($minimumRequiredVersion, &$actualVersion)
 
static checkYii ($minimumRequiredVersion, &$actualVersion)
 
static checkRedBean ($minimumRequiredVersion, &$actualVersion)
 
static checkMemcacheConnection ($host, $port)
 
static checkDatabaseMaxAllowedPacketsSize ($databaseType, $databaseHostname, $databaseUsername, $databasePassword, $databasePort, $minimumRequireBytes, &$actualBytes)
 
static checkDatabaseMaxSpRecursionDepth ($databaseType, $databaseHostname, $databaseUsername, $databasePassword, $databasePort, $minimumRequiredMaxSpRecursionDepth, &$maxSpRecursionDepth)
 
static checkDatabaseThreadStackValue ($databaseType, $databaseHostname, $databaseUsername, $databasePassword, $databasePort, $minimumRequiredThreadStackValue, &$threadStackValue)
 
static checkDatabaseOptimizerSearchDepthValue ($databaseType, $databaseHostname, $databaseUsername, $databasePassword, $databasePort, &$optimizerSearchDepth)
 
static checkDatabaseDefaultCollation ($databaseType, $databaseHostname, $databaseName, $databaseUsername, $databasePassword, $databasePort, $notAllowedDatabaseCollations, &$databaseDefaultCollation)
 
static checkDatabaseLoadLocalInFile ($databaseType, $databaseHostname, $databaseUsername, $databasePassword, $databasePort)
 
static checkDatabaseLogBinValue ($databaseType, $databaseHostname, $databaseUsername, $databasePassword, $databasePort, &$logBinValue)
 
static checkDatabaseLogBinTrustFunctionCreatorsValue ($databaseType, $databaseHostname, $databaseUsername, $databasePassword, $databasePort, &$logBinTrustFunctionCreatorsValue)
 
static connectToDatabase ($databaseType, $host, $databaseName, $username, $password, $port)
 
static createSuperUser ($username, $password)
 
static createBaseControlUserConfigUtilUserAccount ()
 
static generateRandomPasswordForSystemUser ()
 
static createSystemUser ($username, $password=null, $hideFromSelecting=true, $hideFromLeaderboard=true, $firstName=null, $lastName=null)
 
static autoBuildDatabase (&$messageLogger, $autoBuildTestModels=false)
 
static writeConfiguration ($instanceRoot, $databaseType, $databaseHost, $databaseName, $username, $password, $port, $memcacheHost=null, $memcachePort=null, $minifyScripts=true, $language, $perInstanceFilename= 'perInstance.php', $debugFilename= 'debug.php', $hostInfo, $scriptUrl, $submitCrashToSentry=false)
 
static setZurmoTokenAndWriteToPerInstanceFile ($instanceRoot, $perInstanceFilename= 'perInstance.php')
 
static isDebugConfigWritable ($instanceRoot)
 
static doesDebugConfigExist ($instanceRoot)
 
static isPerInstanceConfigWritable ($instanceRoot)
 
static isApplicationLogRuntimeWritable ($instanceRoot)
 
static isMinScriptCacheRuntimeDirectoryWritable ($instanceRoot)
 
static writeInstallComplete ($instanceRoot)
 
static isVersion ($version)
 
static runInstallation ($form, &$messageStreamer)
 
static getMaxAllowedFileSize ()
 
static runFromInstallCommand ($args, $validateForm=false)
 
static runAutoBuildFromUpdateSchemaCommand ($messageLogger)
 
static getDefaultHostInfo ()
 
static getDefaultScriptUrl ($route= '')
 

Static Protected Member Functions

static getBytes ($size)
 
static checkVersion ($minimumRequiredVersion, $actualVersion)
 
static getVersionFromPhpInfo ($regEx)
 

Detailed Description

The purpose of this class is to drill through Modules, build the database, and provide the other function required to complete an install.

Definition at line 42 of file InstallUtil.php.

Member Function Documentation

static checkWebServer ( array  $minimumRequiredVersions,
$actualVersion 
)
static
Parameters
$requiredVersionsAn array mapping server names to minimum required versions. eg: array('apache' => '2.2.16')

Definition at line 69 of file InstallUtil.php.

static checkApacheModDeflate ( )
static
Returns
The Apache ModDeflate version, or false if not installed.

Definition at line 103 of file InstallUtil.php.

static checkPhp (   $minimumRequiredVersion,
$actualVersion 
)
static
Parameters
$minimumRequiredVersionMinimum required php version in "5.3.3" format.

Definition at line 110 of file InstallUtil.php.

static checkPhpTimezoneSetting ( )
static
Returns
true/false for if the timezone has been set.

Definition at line 119 of file InstallUtil.php.

static checkPhpMaxMemorySetting (   $minimumMemoryRequireBytes,
$actualMemoryLimitBytes 
)
static
Returns
true, or the max memory setting is less than the minimum required.

Definition at line 158 of file InstallUtil.php.

static checkPhpUploadSizeSetting (   $minimumUploadRequireBytes,
$actualUploadLimitBytes 
)
static
Returns
true if the max file size is sufficient.

Definition at line 168 of file InstallUtil.php.

static checkPhpPostSizeSetting (   $minimumPostRequireBytes,
$actualPostLimitBytes 
)
static
Returns
true if the max post size is sufficient.

Definition at line 178 of file InstallUtil.php.

static isFileUploadsOn ( )
static
Returns
true if file uploads is set to on.

Definition at line 188 of file InstallUtil.php.

static checkDatabase (   $databaseType,
  $databaseHostname,
  $databaseUsername,
  $databasePassword,
  $databasePort,
  $minimumRequiredVersion,
$actualVersion 
)
static
Returns
true, or the MySQL version if less than required, or false if not installed.

Definition at line 226 of file InstallUtil.php.

static checkAPC (   $minimumRequiredVersion,
$actualVersion 
)
static
Returns
true, or the APC version if less than required, or false if not installed.

Definition at line 245 of file InstallUtil.php.

static checkSoap ( )
static
Returns
true if Soap extension is loaded, or false if not loaded.

Definition at line 258 of file InstallUtil.php.

static checkSPL ( )
static
Returns
true if SPL extension is loaded, or false if not loaded. Required by Yii framework.

Definition at line 267 of file InstallUtil.php.

static checkPCRE ( )
static
Returns
true if PCRE extension is loaded, or false if not loaded. Required by Yii framework.

Definition at line 276 of file InstallUtil.php.

static checkCtype ( )
static
Returns
true if Ctype extension is loaded, or false if not loaded.

Definition at line 284 of file InstallUtil.php.

static checkImap ( )
static
Returns
true if IMAP extension is loaded, or false if not loaded.

Definition at line 292 of file InstallUtil.php.

static checkZip ( )
static
Returns
true if zip extension is loaded, or false if not loaded.

Definition at line 300 of file InstallUtil.php.

static checkServerVariable ( $error)
static
Returns
true if all $_SERVER variable are loaded correctly, otherwise return false. Required by Yii framework.

Definition at line 309 of file InstallUtil.php.

static checkMemcache (   $minimumRequiredVersion,
$actualVersion 
)
static
Returns
true, or the memcache version if less than required, or false if not installed.

Definition at line 344 of file InstallUtil.php.

static checkMemcached (   $minimumRequiredVersion,
$actualVersion 
)
static
Returns
true, or the memcached version if less than required, or false if not installed.

Definition at line 357 of file InstallUtil.php.

static checkCurl (   $minimumRequiredVersion,
$actualVersion 
)
static
Returns
true, or the Curl version if less than required, or false if not installed.

Definition at line 370 of file InstallUtil.php.

static checkMemcacheConnection (   $host,
  $port 
)
static
Returns
true, or an array of connection error number and string .

Definition at line 408 of file InstallUtil.php.

static checkDatabaseMaxAllowedPacketsSize (   $databaseType,
  $databaseHostname,
  $databaseUsername,
  $databasePassword,
  $databasePort,
  $minimumRequireBytes,
$actualBytes 
)
static

Check database max_allowed_packet_size value.

Definition at line 427 of file InstallUtil.php.

static checkDatabaseMaxSpRecursionDepth (   $databaseType,
  $databaseHostname,
  $databaseUsername,
  $databasePassword,
  $databasePort,
  $minimumRequiredMaxSpRecursionDepth,
$maxSpRecursionDepth 
)
static

Check database max_sp_recursion_depth value.

Definition at line 447 of file InstallUtil.php.

static checkDatabaseThreadStackValue (   $databaseType,
  $databaseHostname,
  $databaseUsername,
  $databasePassword,
  $databasePort,
  $minimumRequiredThreadStackValue,
$threadStackValue 
)
static

Check database thread_stack value.

Definition at line 467 of file InstallUtil.php.

static checkDatabaseOptimizerSearchDepthValue (   $databaseType,
  $databaseHostname,
  $databaseUsername,
  $databasePassword,
  $databasePort,
$optimizerSearchDepth 
)
static

Check database optimizer_search_depth value.

Definition at line 487 of file InstallUtil.php.

static checkDatabaseDefaultCollation (   $databaseType,
  $databaseHostname,
  $databaseName,
  $databaseUsername,
  $databasePassword,
  $databasePort,
  $notAllowedDatabaseCollations,
$databaseDefaultCollation 
)
static

Check database default collation.

Definition at line 506 of file InstallUtil.php.

static checkDatabaseLoadLocalInFile (   $databaseType,
  $databaseHostname,
  $databaseUsername,
  $databasePassword,
  $databasePort 
)
static

Check if load local in enabled.

Definition at line 529 of file InstallUtil.php.

static checkDatabaseLogBinValue (   $databaseType,
  $databaseHostname,
  $databaseUsername,
  $databasePassword,
  $databasePort,
$logBinValue 
)
static

Check if log_bin is turned off.

Definition at line 554 of file InstallUtil.php.

static checkDatabaseLogBinTrustFunctionCreatorsValue (   $databaseType,
  $databaseHostname,
  $databaseUsername,
  $databasePassword,
  $databasePort,
$logBinTrustFunctionCreatorsValue 
)
static

Check if log_bin_trust_function_creators is turned on. We check this only when log_bin is turned on.

Definition at line 581 of file InstallUtil.php.

static connectToDatabase (   $databaseType,
  $host,
  $databaseName,
  $username,
  $password,
  $port 
)
static

Connects to the database.

Definition at line 608 of file InstallUtil.php.

static createSuperUser (   $username,
  $password 
)
static

Creates the first user.

Definition at line 622 of file InstallUtil.php.

static createBaseControlUserConfigUtilUserAccount ( )
static

creates user account to be used in backend tasks such as actions and jobs

Returns
User

Definition at line 655 of file InstallUtil.php.

static generateRandomPasswordForSystemUser ( )
static

generates a random password for system user accounts.

Returns
string

Definition at line 664 of file InstallUtil.php.

static createSystemUser (   $username,
  $password = null,
  $hideFromSelecting = true,
  $hideFromLeaderboard = true,
  $firstName = null,
  $lastName = null 
)
static

Create a system user that can be used for running jobs and workflow background processes. Block login via mobile, web, and api.

Parameters
$username
null$password
bool$hideFromSelecting
bool$hideFromLeaderboard
Returns
User
Exceptions
FailedToSaveModelException

Definition at line 679 of file InstallUtil.php.

static writeConfiguration (   $instanceRoot,
  $databaseType,
  $databaseHost,
  $databaseName,
  $username,
  $password,
  $port,
  $memcacheHost = null,
  $memcachePort = null,
  $minifyScripts = true,
  $language,
  $perInstanceFilename = 'perInstance.php',
  $debugFilename = 'debug.php',
  $hostInfo,
  $scriptUrl,
  $submitCrashToSentry = false 
)
static

Writes configuration to debug.php and phpInstance.php.

Definition at line 745 of file InstallUtil.php.

static setZurmoTokenAndWriteToPerInstanceFile (   $instanceRoot,
  $perInstanceFilename = 'perInstance.php' 
)
static

Generate zurmo token and write it to perInstance file.

Parameters
$instanceRoot
Returns
string

Definition at line 880 of file InstallUtil.php.

static writeInstallComplete (   $instanceRoot)
static

Writes into perInstance.php that the installation is complete.

Definition at line 984 of file InstallUtil.php.

static runInstallation (   $form,
$messageStreamer 
)
static

Given an installSettingsForm, run the install including the schema creation and default data load. This is used by the interactive install and the command line install.

Parameters
object$form
object$messageStreamer

Definition at line 1041 of file InstallUtil.php.

static getMaxAllowedFileSize ( )
static

Looks at the post_max_size, upload max size, and database max_allowed_packets

Returns
integer of max allowed file size for uploads.

Definition at line 1143 of file InstallUtil.php.

static runFromInstallCommand (   $args,
  $validateForm = false 
)
static

Method to run installation from command line. Use .

Parameters
array$args

Definition at line 1158 of file InstallUtil.php.

static runAutoBuildFromUpdateSchemaCommand (   $messageLogger)
static

From the command line, run the autobuild method which will effectively update the database schema.

Definition at line 1269 of file InstallUtil.php.


The documentation for this class was generated from the following file:
Generated on Tue May 26 2020 07:10:49