jAppInstance

author

Laurent Jouanneau

copyright

2015 Laurent Jouanneau

see
licence

http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file

package

Default

Methods

__clone

__clone() 

initialize the application paths.

__construct(string $appPath, string $wwwPath = null, string $varPath = null, string $logPath = null, string $configPath = null, string $scriptPath = null) 

Warning: given paths should be ended by a directory separator.

Arguments

$appPath

string

application directory

$wwwPath

string

www directory

$varPath

string

var directory

$logPath

string

log directory

$configPath

string

config directory

$scriptPath

string

scripts directory (deprecated)

__destruct

__destruct() 

clearModulesPluginsPath

clearModulesPluginsPath() 

declare a module.

declareModule(mixed $modulePath) 

Arguments

$modulePath

mixed

Declare a list of modules.

declareModulesDir(array|string $basePath, null|mixed $modules = null) 

Arguments

$basePath

array|string

the directory path containing modules that can be used

$modules

null|mixed

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.

declarePluginsDir(string|array<mixed,string> $basePath) 

Arguments

$basePath

string|array<mixed,string>

the directory path containing plugins that can be used

returns all modules path, even those are not used by the application.

getAllModulesPath() : array<mixed,string>

Response

array<mixed,string>

keys are module name, values are paths

return all paths of directories containing plugins, even those which are in disabled modules.

getAllPluginsPath() : array<mixed,string>

Response

array<mixed,string>

get the module name of the current context.

getCurrentModule() : string

Response

string

name of the current module

getDeclaredModulesDir

getDeclaredModulesDir() 

getEnabledModulesPaths

getEnabledModulesPaths() 

return the real path of an enabled module.

getModulePath(string $module, boolean $includingExternal = false) : string

Arguments

$module

string

a module name

$includingExternal

boolean

deprecated

Response

string

the corresponding path

include the file of a plugin from a plugin directory (any type of plugins).

includePlugin(string $name, string $type, string $suffix, string $classname) : boolean

Arguments

$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

Response

boolean

true if the plugin exists

Says if the given module $name is enabled.

isModuleEnabled(string $moduleName, boolean $includingExternal = false) : boolean

Arguments

$moduleName

string

$includingExternal

boolean

deprecated

Response

boolean

true : module is ok

load a plugin from a plugin directory (any type of plugins).

loadPlugin(string $name, string $type, string $suffix, string $classname, mixed $constructArg = null) : null|object

Arguments

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

Response

null|object

null if the plugin doesn't exists

onRestoringAsContext

onRestoringAsContext() 

cancel the current context and set the context to the previous module.

popCurrentModule() : string

Response

string

the obsolet module name

set the context to the given module.

pushCurrentModule(string $module) 

Arguments

$module

string

the module name

registerAutoload

registerAutoload() 

setConfig

setConfig( $config) 

Arguments

$config

setPaths

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

Arguments

$appPath

$wwwPath

$varPath

$logPath

$configPath

$scriptPath

unregisterAutoload

unregisterAutoload() 

return the version of the application containing into a VERSION file It doesn't read the version from project.xml or composer.json.

version() : string

Response

string

Properties

tempBasePath

tempBasePath : 

Type(s)

appPath

appPath : 

Type(s)

varPath

varPath : 

Type(s)

logPath

logPath : 

Type(s)

configPath

configPath : 

Type(s)

wwwPath

wwwPath : 

Type(s)

scriptPath

scriptPath : string
var
deprecated

Type(s)

string

env

env : 

Type(s)

configAutoloader

configAutoloader : 

Type(s)

_version

_version : 

Type(s)

object containing all configuration options of the application

config : object
var

object containing all configuration options of the application

Type(s)

object

coord

coord : 

Type(s)

_modulesDirPath

_modulesDirPath : 

Type(s)

_modulesPath

_modulesPath : 

Type(s)

_pluginsDirPath

_pluginsDirPath : 

Type(s)

_allModulesPath

_allModulesPath : 

Type(s)

_allPluginsPath

_allPluginsPath : 

Type(s)

_modulesContext

_modulesContext : 

Type(s)