PHP Класс Core, generatedata

Version history (please keep backward compatible): 1.0, 2008-10-09: Cornelius Hansjakob
Автор: Cornelius Hansjakob ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$countryPlugins CountryPlugin
$dataTypePlugins
$db Database
$exportTypePlugins
$geoData GeoData
$language Language
$smarty Smarty
$translations Translations
$user Account

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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()

Описание методов

checkAllowMultiUserAnonymousUse() публичный статический метод

checkDemoMode() публичный статический метод

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

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.
public static checkIsInstalled ( )

checkIsLoggedIn() публичный статический метод

public static checkIsLoggedIn ( )

checkSettingsFileExists() публичный статический метод

public static checkSettingsFileExists ( )

getContinents() публичный статический метод

public static getContinents ( )

getDataTypeGroups() публичный статический метод

public static getDataTypeGroups ( )

getDbName() публичный статический метод

public static getDbName ( )

getDbPassword() публичный статический метод

public static getDbPassword ( )

getDbTablePrefix() публичный статический метод

public static getDbTablePrefix ( )

getDbUsername() публичный статический метод

public static getDbUsername ( )

getDefaultCountryPlugins() публичный статический метод

public static getDefaultCountryPlugins ( )

getDefaultExportType() публичный статический метод

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

getDefaultLanguageFile() публичный статический метод

public static getDefaultLanguageFile ( )

getDefaultNumRows() публичный статический метод

public static getDefaultNumRows ( )

getDefaultTheme() публичный статический метод

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

getEncryptionSalt() публичный статический метод

public static getEncryptionSalt ( )

getHostname() публичный статический метод

public static getHostname ( )

getMaxDataSetHistorySize() публичный статический метод

public static getMaxDataSetHistorySize ( )

getMaxDemoModeRows() публичный статический метод

public static getMaxDemoModeRows ( )

getMaxGeneratedRows() публичный статический метод

public static getMaxGeneratedRows ( )

getMinimumMySQLVersion() публичный статический метод

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

getMinimumPHPVersion() публичный статический метод

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

getPluginSettings() публичный статический метод

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
Результат mixed

getVersion() публичный статический метод

public static getVersion ( )

init() публичный статический метод

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 initSessions ( )

initUser() публичный статический метод

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

isApiEnabled() публичный статический метод

Determines whether the REST API functionality is available or not.
public static isApiEnabled ( ) : boolean
Результат boolean

isInstalling() публичный статический метод

public static isInstalling ( )

isSmartySecurityEnabled() публичный статический метод

public static isSmartySecurityEnabled ( )

isUsingMinifiedResources() публичный статический метод

Returns a boolean signifying whether we should use the minified + bundled resources generated via Grunt.
public static isUsingMinifiedResources ( ) : boolean
Результат boolean

Описание свойств

$countryPlugins публичное статическое свойство

public static CountryPlugin $countryPlugins
Результат CountryPlugin

$dataTypePlugins публичное статическое свойство

public static $dataTypePlugins

$db публичное статическое свойство

public static Database $db
Результат Database

$exportTypePlugins публичное статическое свойство

public static $exportTypePlugins

$geoData публичное статическое свойство

public static GeoData $geoData
Результат GeoData

$language публичное статическое свойство

public static Language $language
Результат Language

$smarty публичное статическое свойство

public static Smarty $smarty
Результат Smarty

$translations публичное статическое свойство

public static Translations $translations
Результат Translations

$user публичное статическое свойство

public static Account $user
Результат Account