PHP Class Jelix\Core\AppInstance

Afficher le fichier Open project: jelix/jelix

Méthodes publiques

Свойство Type Description
$appPath
$config object containing all configuration options of the application
$configAutoloader
$configPath
$env
$logPath
$router Jelix\Routing\Router The current router
$scriptPath
$tempBasePath
$varPath
$wwwPath

Protected Properties

Свойство Type Description
$_allModulesPath
$_allPluginsPath
$_modulesContext
$_modulesDirPath
$_modulesPath
$_pluginsDirPath
$_version

Méthodes publiques

Méthode Description
__clone ( )
__construct ( string $appPath, string $wwwPath = null, string $varPath = null, string $logPath = null, string $configPath = null, string $scriptPath = null ) initialize the application paths.
__destruct ( )
clearModulesPluginsPath ( )
declareModule ( $modulePath ) declare a module.
declareModulesDir ( string | array $basePath, $modules = null ) Declare a list of modules.
declarePluginsDir ( string | string[] $basePath ) Declare a directory containing some plugins. Note that it does not need to declare 'plugins/' inside modules, as there are declared automatically when you declare modules.
getAllModulesPath ( ) : string[] returns all modules path, even those are not used by the application.
getAllPluginsPath ( ) : string[] return all paths of directories containing plugins, even those which are in disabled modules.
getCurrentModule ( ) : string get the module name of the current context.
getDeclaredModulesDir ( )
getModulePath ( string $module, boolean $includingExternal = false ) : string return the real path of an enabled module.
includePlugin ( string $name, string $type, string $suffix, string $classname ) : boolean include the file of a plugin from a plugin directory (any type of plugins).
isModuleEnabled ( string $moduleName, boolean $includingExternal = false ) : boolean Says if the given module $name is enabled.
loadPlugin ( string $name, string $type, string $suffix, string $classname, mixed $constructArg = null ) : null | object load a plugin from a plugin directory (any type of plugins).
onRestoringAsContext ( )
popCurrentModule ( ) : string cancel the current context and set the context to the previous module.
pushCurrentModule ( string $module ) set the context to the given module.
setConfig ( $config )
setPaths ( $appPath, $wwwPath = null, $varPath = null, $logPath = null, $configPath = null, $scriptPath = null )
version ( ) : string return the version of the application containing into a VERSION file It doesn't read the version from project.xml or composer.json.

Méthodes protégées

Méthode Description
registerAutoload ( )
unregisterAutoload ( )

Method Details

__clone() public méthode

public __clone ( )

__construct() public méthode

Warning: given paths should be ended by a directory separator.
public __construct ( string $appPath, string $wwwPath = null, string $varPath = null, string $logPath = null, string $configPath = null, string $scriptPath = null )
$appPath string application directory
$wwwPath string www directory
$varPath string var directory
$logPath string log directory
$configPath string config directory
$scriptPath string scripts directory

__destruct() public méthode

public __destruct ( )

clearModulesPluginsPath() public méthode

declareModule() public méthode

declare a module.
public declareModule ( $modulePath )

declareModulesDir() public méthode

Declare a list of modules.
public declareModulesDir ( string | array $basePath, $modules = null )
$basePath string | array the directory path containing modules that can be used

declarePluginsDir() public méthode

Declare a directory containing some plugins. Note that it does not need to declare 'plugins/' inside modules, as there are declared automatically when you declare modules.
public declarePluginsDir ( string | string[] $basePath )
$basePath string | string[] the directory path containing plugins that can be used

getAllModulesPath() public méthode

returns all modules path, even those are not used by the application.
public getAllModulesPath ( ) : string[]
Résultat string[] keys are module name, values are paths

getAllPluginsPath() public méthode

return all paths of directories containing plugins, even those which are in disabled modules.
public getAllPluginsPath ( ) : string[]
Résultat string[]

getCurrentModule() public méthode

get the module name of the current context.
public getCurrentModule ( ) : string
Résultat string name of the current module

getDeclaredModulesDir() public méthode

getModulePath() public méthode

return the real path of an enabled module.
public getModulePath ( string $module, boolean $includingExternal = false ) : string
$module string a module name
$includingExternal boolean true if we want the path of a module enabled in an other entry point.
Résultat string the corresponding path

includePlugin() public méthode

include the file of a plugin from a plugin directory (any type of plugins).
public includePlugin ( string $name, string $type, string $suffix, string $classname ) : boolean
$name string the name of the plugin
$type string the type of the plugin
$suffix string the suffix of the filename
$classname string the name of the class to instancy
Résultat boolean true if the plugin exists

isModuleEnabled() public méthode

Says if the given module $name is enabled.
public isModuleEnabled ( string $moduleName, boolean $includingExternal = false ) : boolean
$moduleName string
$includingExternal boolean true if we want to know if the module is also an external module, e.g. in an other entry point
Résultat boolean true : module is ok

loadPlugin() public méthode

load a plugin from a plugin directory (any type of plugins).
public loadPlugin ( string $name, string $type, string $suffix, string $classname, mixed $constructArg = null ) : null | object
$name string the name of the plugin
$type string the type of the plugin
$suffix string the suffix of the filename
$classname string the name of the class to instancy
$constructArg mixed the single argument for the constructor of the class. null = no argument.
Résultat null | object null if the plugin doesn't exists

onRestoringAsContext() public méthode

popCurrentModule() public méthode

cancel the current context and set the context to the previous module.
public popCurrentModule ( ) : string
Résultat string the obsolet module name

pushCurrentModule() public méthode

set the context to the given module.
public pushCurrentModule ( string $module )
$module string the module name

registerAutoload() protected méthode

protected registerAutoload ( )

setConfig() public méthode

public setConfig ( $config )

setPaths() public méthode

public setPaths ( $appPath, $wwwPath = null, $varPath = null, $logPath = null, $configPath = null, $scriptPath = null )

unregisterAutoload() protected méthode

protected unregisterAutoload ( )

version() public méthode

return the version of the application containing into a VERSION file It doesn't read the version from project.xml or composer.json.
public version ( ) : string
Résultat string

Property Details

$_allModulesPath protected_oe property

protected $_allModulesPath

$_allPluginsPath protected_oe property

protected $_allPluginsPath

$_modulesContext protected_oe property

protected $_modulesContext

$_modulesDirPath protected_oe property

protected $_modulesDirPath

$_modulesPath protected_oe property

protected $_modulesPath

$_pluginsDirPath protected_oe property

protected $_pluginsDirPath

$_version protected_oe property

protected $_version

$appPath public_oe property

public $appPath

$config public_oe property

object containing all configuration options of the application
public $config

$configAutoloader public_oe property

public $configAutoloader

$configPath public_oe property

public $configPath

$env public_oe property

public $env

$logPath public_oe property

public $logPath

$router public_oe property

The current router
public Router,Jelix\Routing $router
Résultat Jelix\Routing\Router

$scriptPath public_oe property

public $scriptPath

$tempBasePath public_oe property

public $tempBasePath

$varPath public_oe property

public $varPath

$wwwPath public_oe property

public $wwwPath