jAppInstance
in package
Tags
Table of Contents
- $applicationInitFile : mixed
- $appPath : mixed
- $config : object
- $configAutoloader : mixed
- $configPath : mixed
- $coord : mixed
- $env : mixed
- $logPath : mixed
- $scriptPath : string
- $tempBasePath : mixed
- $varPath : mixed
- $wwwPath : mixed
- $_allModulesPath : mixed
- $_allPluginsPath : mixed
- $_modulesContext : mixed
- $_modulesDirPath : mixed
- $_modulesPath : mixed
- $_pluginsDirPath : mixed
- $_version : mixed
- __clone() : mixed
- __construct() : mixed
- initialize the application paths.
- __destruct() : mixed
- clearModulesPluginsPath() : mixed
- declareModule() : mixed
- declare a module.
- declareModulesDir() : mixed
- Declare a list of modules.
- declareModulesFromConfig() : mixed
- Read all modules path declared into the configuration.
- declarePluginsDir() : mixed
- Declare a directory containing some plugins.
- getAllModulesPath() : array<string|int, string>
- returns all modules path, even those are not used by the application.
- getAllPluginsPath() : array<string|int, 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() : mixed
- getEnabledModulesPaths() : array<string|int, mixed>
- returns the list of enabled module.
- getModulePath() : string
- return the real path of an enabled module.
- includePlugin() : bool
- include the file of a plugin from a plugin directory (any type of plugins).
- isModuleEnabled() : bool
- Says if the given module $name is enabled.
- loadPlugin() : null|object
- load a plugin from a plugin directory (any type of plugins).
- onRestoringAsContext() : mixed
- popCurrentModule() : string
- cancel the current context and set the context to the previous module.
- pushCurrentModule() : mixed
- set the context to the given module.
- setApplicationInitFile() : void
- Sometimes, the application.init.php may not be into the appPath, this method allows to indicate the path to the application.init.php.
- setConfig() : mixed
- setPaths() : mixed
- version() : string
- return the version of the application containing into a VERSION file stored at the root of the application.
- registerAutoload() : mixed
- unregisterAutoload() : mixed
Properties
$applicationInitFile
public
mixed
$applicationInitFile
= ''
$appPath
public
mixed
$appPath
= ''
$config
public
object
$config
object containing all configuration options of the application
$configAutoloader
public
mixed
$configAutoloader
$configPath
public
mixed
$configPath
= ''
$coord
public
mixed
$coord
$env
public
mixed
$env
= 'www/'
$logPath
public
mixed
$logPath
= ''
$scriptPath
public
string
$scriptPath
= ''
Tags
$tempBasePath
public
mixed
$tempBasePath
= ''
$varPath
public
mixed
$varPath
= ''
$wwwPath
public
mixed
$wwwPath
= ''
$_allModulesPath
protected
mixed
$_allModulesPath
$_allPluginsPath
protected
mixed
$_allPluginsPath
$_modulesContext
protected
mixed
$_modulesContext
= array()
$_modulesDirPath
protected
mixed
$_modulesDirPath
= array()
$_modulesPath
protected
mixed
$_modulesPath
= array()
$_pluginsDirPath
protected
mixed
$_pluginsDirPath
= array()
$_version
protected
mixed
$_version
Methods
__clone()
public
__clone() : mixed
Return values
mixed —__construct()
initialize the application paths.
public
__construct(string $appPath[, string $wwwPath = null ][, string $varPath = null ][, string $logPath = null ][, string $configPath = null ][, string $scriptPath = null ]) : mixed
Warning: given paths should be ended by a directory separator.
Parameters
- $appPath : string
-
application directory
- $wwwPath : string = null
-
www directory
- $varPath : string = null
-
var directory
- $logPath : string = null
-
log directory
- $configPath : string = null
-
config directory
- $scriptPath : string = null
-
scripts directory (deprecated)
Return values
mixed —__destruct()
public
__destruct() : mixed
Return values
mixed —clearModulesPluginsPath()
public
clearModulesPluginsPath() : mixed
Return values
mixed —declareModule()
declare a module.
public
declareModule(mixed $modulePath) : mixed
This method must be called before loading the configuration with jApp::loadConfig()
Parameters
- $modulePath : mixed
Return values
mixed —declareModulesDir()
Declare a list of modules.
public
declareModulesDir(array<string|int, mixed>|string $basePath[, null|array<string|int, string> $modules = null ]) : mixed
This method must be called before loading the configuration with jApp::loadConfig()
Parameters
- $basePath : array<string|int, mixed>|string
-
the directory path containing modules that can be used
- $modules : null|array<string|int, string> = null
-
list of module name to declare, from the directory. By default: all sub-directories (null). parameter used only if $basePath is a string
Return values
mixed —declareModulesFromConfig()
Read all modules path declared into the configuration.
public
declareModulesFromConfig(object $config) : mixed
Method reserved to the configuration compiler.
Parameters
- $config : object
Return values
mixed —declarePluginsDir()
Declare a directory containing some plugins.
public
declarePluginsDir(string|array<string|int, string> $basePath) : mixed
Note that it does not need to declare 'plugins/' inside modules, as they are declared automatically when you declare modules.
This method must be called before loading the configuration with jApp::loadConfig()
Parameters
- $basePath : string|array<string|int, string>
-
the directory path containing plugins that can be used
Return values
mixed —getAllModulesPath()
returns all modules path, even those are not used by the application.
public
getAllModulesPath() : array<string|int, string>
Return values
array<string|int, string> —keys are module name, values are paths
getAllPluginsPath()
return all paths of directories containing plugins, even those which are in disabled modules.
public
getAllPluginsPath() : array<string|int, string>
Return values
array<string|int, string> —getCurrentModule()
get the module name of the current context.
public
getCurrentModule() : string
Return values
string —name of the current module
getDeclaredModulesDir()
public
getDeclaredModulesDir() : mixed
Return values
mixed —getEnabledModulesPaths()
returns the list of enabled module.
public
getEnabledModulesPaths() : array<string|int, mixed>
Must be called after the call of jApp::loadConfig()
.
Return values
array<string|int, mixed> —getModulePath()
return the real path of an enabled module.
public
getModulePath(string $module[, bool $includingExternal = false ]) : string
Parameters
- $module : string
-
a module name
- $includingExternal : bool = false
-
deprecated
Return values
string —the corresponding path
includePlugin()
include the file of a plugin from a plugin directory (any type of plugins).
public
includePlugin(string $name, string $type, string $suffix, string $classname) : bool
Parameters
- $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 values
bool —true if the plugin exists
isModuleEnabled()
Says if the given module $name is enabled.
public
isModuleEnabled(string $moduleName[, bool $includingExternal = false ]) : bool
Parameters
- $moduleName : string
- $includingExternal : bool = false
-
deprecated
Return values
bool —true : module is ok
loadPlugin()
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
Parameters
- $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 = null
-
the single argument for the constructor of the class. null = no argument.
Return values
null|object —null if the plugin doesn't exists
onRestoringAsContext()
public
onRestoringAsContext() : mixed
Return values
mixed —popCurrentModule()
cancel the current context and set the context to the previous module.
public
popCurrentModule() : string
Return values
string —the obsolet module name
pushCurrentModule()
set the context to the given module.
public
pushCurrentModule(string $module) : mixed
Parameters
- $module : string
-
the module name
Return values
mixed —setApplicationInitFile()
Sometimes, the application.init.php may not be into the appPath, this method allows to indicate the path to the application.init.php.
public
setApplicationInitFile(string $path) : void
Parameters
- $path : string
-
the full path to the application.init.php
Return values
void —setConfig()
public
setConfig(mixed $config) : mixed
Parameters
- $config : mixed
Return values
mixed —setPaths()
public
setPaths(mixed $appPath[, mixed $wwwPath = null ][, mixed $varPath = null ][, mixed $logPath = null ][, mixed $configPath = null ][, mixed $scriptPath = null ]) : mixed
Parameters
- $appPath : mixed
- $wwwPath : mixed = null
- $varPath : mixed = null
- $logPath : mixed = null
- $configPath : mixed = null
- $scriptPath : mixed = null
Return values
mixed —version()
return the version of the application containing into a VERSION file stored at the root of the application.
public
version() : string
It doesn't read the version from project.xml or composer.json.
Return values
string —registerAutoload()
protected
registerAutoload() : mixed
Return values
mixed —unregisterAutoload()
protected
unregisterAutoload() : mixed