PHP Class Core, generatedata

Version history (please keep backward compatible): 1.0, 2008-10-09: Cornelius Hansjakob
Author: Cornelius Hansjakob ([email protected])
Afficher le fichier Open project: benkeen/generatedata Class Usage Examples

Méthodes publiques

Свойство Type Description
$countryPlugins CountryPlugin
$dataTypePlugins
$db Database
$exportTypePlugins
$geoData GeoData
$language Language
$smarty Smarty
$translations Translations
$user Account

Méthodes publiques

Méthode Description
checkAllowMultiUserAnonymousUse ( )
checkDemoMode ( ) TODO Yuck! Why does this return a boolean as a frickin' string?! Was I drunk?
checkIsInstalled ( ) Full installation of the program is determined by (a) the settings.php file existing and (b) the "installationComplete" setting value existing in the database. Note: this function assumes the database connection in Core::$db has already been created.
checkIsLoggedIn ( )
checkSettingsFileExists ( )
getContinents ( )
getDataTypeGroups ( )
getDbName ( )
getDbPassword ( )
getDbTablePrefix ( )
getDbUsername ( )
getDefaultCountryPlugins ( )
getDefaultExportType ( ) Returns the out-the-box default Export Type.
getDefaultLanguageFile ( )
getDefaultNumRows ( )
getDefaultTheme ( ) Used during the installation process only: it returns the default theme for new installations.
getEncryptionSalt ( )
getHostname ( )
getMaxDataSetHistorySize ( )
getMaxDemoModeRows ( )
getMaxGeneratedRows ( )
getMinimumMySQLVersion ( ) Returns the minimum MySQL version required to run this script. Used during installation to ensure the server environment is adequate.
getMinimumPHPVersion ( ) Returns the minimum PHP version required to run this script. Used during installation to ensure the server environment is adequate.
getPluginSettings ( $pluginType, $pluginFolder ) : mixed Added in 3.1.4. This allows any plugins to have custom settings defined in $pluginSettings. This function returns null if no settings exist for the plugin, or whatever settings have been provided.
getVersion ( )
init ( string $runtimeContext = "ui" ) Core::init()
initSessions ( )
initUser ( boolean $bypass = false ) Initializes the current logged in user and stores their Account object in Core::$user.
isApiEnabled ( ) : boolean Determines whether the REST API functionality is available or not.
isInstalling ( )
isSmartySecurityEnabled ( )
isUsingMinifiedResources ( ) : boolean Returns a boolean signifying whether we should use the minified + bundled resources generated via Grunt.

Private Methods

Méthode Description
initCountries ( ) Called by Core::init(), this initializes Core::$countryPlugins.
initDataTypes ( $runtimeContext ) Called by Core::init(), this initializes Core::$dataTypePlugins. Note that this will contain ALL installed plugins, not those that are selected by a particular user. In 3.2.2 that feature was added, so use Account::getDataTypePlugins() instead.
initDatabase ( ) Initializes the Database object and stores it in Core::$db.
initExportTypes ( $runtimeContext ) Called by Core::init(), this initializes Core::$exportTypePlugins.
initGeoData ( ) This function returns the actual data populated in the database by the Country plugins. It returns an array of country data, contains regions and cities.
initSmarty ( ) Initializes the Smarty object used for things like rendering the Smarty templates found in resources/templates/ - and for other misc uses.
loadSettingsFile ( ) Core::loadSettingsFile()

Method Details

checkAllowMultiUserAnonymousUse() public static méthode

checkDemoMode() public static méthode

TODO Yuck! Why does this return a boolean as a frickin' string?! Was I drunk?
public static checkDemoMode ( )

checkIsInstalled() public static méthode

Full installation of the program is determined by (a) the settings.php file existing and (b) the "installationComplete" setting value existing in the database. Note: this function assumes the database connection in Core::$db has already been created.
public static checkIsInstalled ( )

checkIsLoggedIn() public static méthode

public static checkIsLoggedIn ( )

checkSettingsFileExists() public static méthode

public static checkSettingsFileExists ( )

getContinents() public static méthode

public static getContinents ( )

getDataTypeGroups() public static méthode

public static getDataTypeGroups ( )

getDbName() public static méthode

public static getDbName ( )

getDbPassword() public static méthode

public static getDbPassword ( )

getDbTablePrefix() public static méthode

public static getDbTablePrefix ( )

getDbUsername() public static méthode

public static getDbUsername ( )

getDefaultCountryPlugins() public static méthode

public static getDefaultCountryPlugins ( )

getDefaultExportType() public static méthode

Returns the out-the-box default Export Type.
public static getDefaultExportType ( )

getDefaultLanguageFile() public static méthode

public static getDefaultLanguageFile ( )

getDefaultNumRows() public static méthode

public static getDefaultNumRows ( )

getDefaultTheme() public static méthode

Used during the installation process only: it returns the default theme for new installations.
public static getDefaultTheme ( )

getEncryptionSalt() public static méthode

public static getEncryptionSalt ( )

getHostname() public static méthode

public static getHostname ( )

getMaxDataSetHistorySize() public static méthode

public static getMaxDataSetHistorySize ( )

getMaxDemoModeRows() public static méthode

public static getMaxDemoModeRows ( )

getMaxGeneratedRows() public static méthode

public static getMaxGeneratedRows ( )

getMinimumMySQLVersion() public static méthode

Returns the minimum MySQL version required to run this script. Used during installation to ensure the server environment is adequate.
public static getMinimumMySQLVersion ( )

getMinimumPHPVersion() public static méthode

Returns the minimum PHP version required to run this script. Used during installation to ensure the server environment is adequate.
public static getMinimumPHPVersion ( )

getPluginSettings() public static méthode

Added in 3.1.4. This allows any plugins to have custom settings defined in $pluginSettings. This function returns null if no settings exist for the plugin, or whatever settings have been provided.
public static getPluginSettings ( $pluginType, $pluginFolder ) : mixed
$pluginType
$pluginFolder
Résultat mixed

getVersion() public static méthode

public static getVersion ( )

init() public static méthode

Our initialization function. This is called on all page requests to initialize the Core object. Since it's also used during installation (when the database and/or plugins haven't been installed), the optional parameter controls whether or not the database object, plugins, sessions and user should be initialized. Different call contexts require different initialization.
public static init ( string $runtimeContext = "ui" )
$runtimeContext string This determines the context in which the Core is being initialized. This info is used to let plugins instantiate themselves differently, as well as prevent the loading of incomplete parts of the script.
installation: a fresh installation, DB not installed yet
installationDatabaseReady: during installation after the DB has been installed
ui: (default) for the main generator page
generation: when we're in the process of creating actual data resetPlugins: initialized everything except the plugins, which may be safely reset

initSessions() public static méthode

public static initSessions ( )

initUser() public static méthode

Initializes the current logged in user and stores their Account object in Core::$user.
public static initUser ( boolean $bypass = false )
$bypass boolean

isApiEnabled() public static méthode

Determines whether the REST API functionality is available or not.
public static isApiEnabled ( ) : boolean
Résultat boolean

isInstalling() public static méthode

public static isInstalling ( )

isSmartySecurityEnabled() public static méthode

public static isSmartySecurityEnabled ( )

isUsingMinifiedResources() public static méthode

Returns a boolean signifying whether we should use the minified + bundled resources generated via Grunt.
public static isUsingMinifiedResources ( ) : boolean
Résultat boolean

Property Details

$countryPlugins public_oe static_oe property

public static CountryPlugin $countryPlugins
Résultat CountryPlugin

$dataTypePlugins public_oe static_oe property

public static $dataTypePlugins

$db public_oe static_oe property

public static Database $db
Résultat Database

$exportTypePlugins public_oe static_oe property

public static $exportTypePlugins

$geoData public_oe static_oe property

public static GeoData $geoData
Résultat GeoData

$language public_oe static_oe property

public static Language $language
Résultat Language

$smarty public_oe static_oe property

public static Smarty $smarty
Résultat Smarty

$translations public_oe static_oe property

public static Translations $translations
Résultat Translations

$user public_oe static_oe property

public static Account $user
Résultat Account