PHP Class Jelix\Core\AppInstance

Show file Open project: jelix/jelix

Public Properties

Property 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

Property Type Description
$_allModulesPath
$_allPluginsPath
$_modulesContext
$_modulesDirPath
$_modulesPath
$_pluginsDirPath
$_version

Public Methods

Method 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.

Protected Methods

Method Description
registerAutoload ( )
unregisterAutoload ( )

Method Details

__clone() public method

public __clone ( )

__construct() public method

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 method

public __destruct ( )

clearModulesPluginsPath() public method

declareModule() public method

declare a module.
public declareModule ( $modulePath )

declareModulesDir() public method

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 method

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 method

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

getAllPluginsPath() public method

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

getCurrentModule() public method

get the module name of the current context.
public getCurrentModule ( ) : string
return string name of the current module

getDeclaredModulesDir() public method

getModulePath() public method

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.
return string the corresponding path

includePlugin() public method

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
return boolean true if the plugin exists

isModuleEnabled() public method

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
return boolean true : module is ok

loadPlugin() public method

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.
return null | object null if the plugin doesn't exists

onRestoringAsContext() public method

popCurrentModule() public method

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

pushCurrentModule() public method

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

registerAutoload() protected method

protected registerAutoload ( )

setConfig() public method

public setConfig ( $config )

setPaths() public method

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

unregisterAutoload() protected method

protected unregisterAutoload ( )

version() public method

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
return string

Property Details

$_allModulesPath protected property

protected $_allModulesPath

$_allPluginsPath protected property

protected $_allPluginsPath

$_modulesContext protected property

protected $_modulesContext

$_modulesDirPath protected property

protected $_modulesDirPath

$_modulesPath protected property

protected $_modulesPath

$_pluginsDirPath protected property

protected $_pluginsDirPath

$_version protected property

protected $_version

$appPath public property

public $appPath

$config public property

object containing all configuration options of the application
public $config

$configAutoloader public property

public $configAutoloader

$configPath public property

public $configPath

$env public property

public $env

$logPath public property

public $logPath

$router public property

The current router
public Router,Jelix\Routing $router
return Jelix\Routing\Router

$scriptPath public property

public $scriptPath

$tempBasePath public property

public $tempBasePath

$varPath public property

public $varPath

$wwwPath public property

public $wwwPath