JelixContext
in package
implements
AppContextInterface
Table of Contents
Interfaces
- AppContextInterface
- Interface that will be implemented to get Jelix infos so we can either send Jelix's real infos either custom infos to make our own tests.
Methods
- aclCheck() : bool
- says if the current user has the given right. Call jAcl2::check().
- aclGroupsIdByUser() : array<string|int, mixed>
- Retrieve the list of group the given user is member of in the acl system.
- aclUserGroupsId() : array<string|int, mixed>
- Retrieve the list of groups id, the current user is member of, in the acl system.
- aclUserGroupsInfo() : Iterator
- Retrieve the list of groups properties, the current user is member of, in the acl system.
- aclUserPrivateGroup() : string
- Get the private group for the current user or for the given login in the acl system.
- aclUserPublicGroupsId() : array<string|int, mixed>
- Retrieve the list of public group the given user is member of in the acl system.
- appConfig() : object
- call and return jApp::config.
- appConfigPath() : mixed
- Returns the configuration file path.
- appVarPath() : mixed
- Returns the app var path.
- clearCache() : mixed
- Deletes data from cache.
- createDaoRecord() : mixed
- Creates a new Record in the Dao.
- createJelixForm() : jFormsBase
- Gets the form object corresponding to the given selector.
- createVirtualProfile() : mixed
- Return the result of jProfile::createVirtualProfile.
- eventNotify() : jEvent
- Call jEvent::notify().
- flushCache() : mixed
- Flushes data from the cache.
- getCache() : mixed
- get the cached value of the given key.
- getCacheDriver() : mixed
- Returns the cache driver corresponding to the profile.
- getClassService() : mixed
- Returns a class instance.
- getCoord() : mixed
- Returns a jCoordinator object.
- getDbConnection() : jDbConnection
- Return the connection to a Db by calling jDb::getConnection().
- getFormPath() : string
- Returns the path to the json form folder.
- getFullUrl() : mixed
- Returns the absolute Url.
- getIniModifier() : mixed
- Returns a the IniFileModifier corresponding to the ini file.
- getJelixDao() : jDaoFactoryBase
- Return the result of a jDao method.
- getLocale() : string
- Get a string in a specific language.
- getProfile() : array<string|int, mixed>
- Return the properties of a profile by calling jProfile::get().
- getTileCaps() : mixed
- Calls the lizmapTiler::getTileCapabilities method.
- getTpl() : mixed
- Returns a new jTpl Object.
- getUrl() : mixed
- Returns the URL corresponding to the Jelix Selector.
- getUserSession() : object
- Informations of the current authenticated user.
- logException() : mixed
- Log an Exception.
- logMessage() : mixed
- Log a message.
- normalizeCacheKey() : string
- return the normalized value of a cache key, to be used with getCache.
- setCache() : bool
- Set a data in the cache.
- UserIsConnected() : bool
- Indicate if the current user is authenticated.
Methods
aclCheck()
says if the current user has the given right. Call jAcl2::check().
public
aclCheck(string $right[, string $resource = null ]) : bool
Parameters
- $right : string
-
the key of the right to check
- $resource : string = null
-
the id of a resource if any
Return values
bool —The result of jAcl2::check()
aclGroupsIdByUser()
Retrieve the list of group the given user is member of in the acl system.
public
aclGroupsIdByUser(string $login) : array<string|int, mixed>
Parameters
- $login : string
-
The user's login
Return values
array<string|int, mixed> —list of group id
aclUserGroupsId()
Retrieve the list of groups id, the current user is member of, in the acl system.
public
aclUserGroupsId() : array<string|int, mixed>
Return values
array<string|int, mixed> —list of group id (jAcl2DbUserGroup::getGroups() result)
aclUserGroupsInfo()
Retrieve the list of groups properties, the current user is member of, in the acl system.
public
aclUserGroupsInfo([string $login = '' ]) : Iterator
Parameters
- $login : string = ''
-
login of the user. if not given, the current user is taken account
Return values
Iterator —a list of groups objects (dao records)
aclUserPrivateGroup()
Get the private group for the current user or for the given login in the acl system.
public
aclUserPrivateGroup([string $login = null ]) : string
Parameters
- $login : string = null
-
The user's login
Return values
string —the id of the private group
aclUserPublicGroupsId()
Retrieve the list of public group the given user is member of in the acl system.
public
aclUserPublicGroupsId([string $login = null ]) : array<string|int, mixed>
Parameters
- $login : string = null
-
The user's login
Return values
array<string|int, mixed> —list of public group id
appConfig()
call and return jApp::config.
public
appConfig() : object
Return values
object —configuration parameters into properties of an object
appConfigPath()
Returns the configuration file path.
public
appConfigPath([mixed $file = '' ]) : mixed
Parameters
- $file : mixed = ''
-
The configuration file
appVarPath()
Returns the app var path.
public
appVarPath([mixed $file = '' ]) : mixed
Parameters
- $file : mixed = ''
-
The var file
clearCache()
Deletes data from cache.
public
clearCache(string $key[, string $profile = '' ]) : mixed
Parameters
- $key : string
-
The cache key
- $profile : string = ''
-
The cache profile
createDaoRecord()
Creates a new Record in the Dao.
public
createDaoRecord(mixed $dao[, mixed $profile = '' ]) : mixed
Parameters
- $dao : mixed
-
The Jelix dao selector
- $profile : mixed = ''
-
The profile to use
createJelixForm()
Gets the form object corresponding to the given selector.
public
createJelixForm(mixed $formSel[, mixed $formId = null ]) : jFormsBase
Parameters
- $formSel : mixed
-
the selector of the xml jform file
- $formId : mixed = null
-
the id of the new instance (an id of a record for example)
Return values
jFormsBasecreateVirtualProfile()
Return the result of jProfile::createVirtualProfile.
public
createVirtualProfile(string $category, string $name, array<string|int, mixed> $params) : mixed
Parameters
- $category : string
-
The profile category to create
- $name : string
-
The profile name
- $params : array<string|int, mixed>
-
The parameters of the profile
Tags
eventNotify()
Call jEvent::notify().
public
eventNotify(string $name[, array<string|int, mixed> $params = array() ]) : jEvent
Parameters
- $name : string
-
The name of the event
- $params : array<string|int, mixed> = array()
-
the parameters of the event
Return values
jEventflushCache()
Flushes data from the cache.
public
flushCache([mixed $profile = '' ]) : mixed
Parameters
- $profile : mixed = ''
-
The cache profile
getCache()
get the cached value of the given key.
public
getCache(string $key[, string $profile = '' ]) : mixed
Parameters
- $key : string
-
the cache key
- $profile : string = ''
-
the name of the cache type
Return values
mixed —the result given by jCache
getCacheDriver()
Returns the cache driver corresponding to the profile.
public
getCacheDriver(mixed $profile) : mixed
Parameters
- $profile : mixed
-
The profile name
getClassService()
Returns a class instance.
public
getClassService(mixed $selector) : mixed
Parameters
- $selector : mixed
-
The jelix class selector
getCoord()
Returns a jCoordinator object.
public
getCoord() : mixed
getDbConnection()
Return the connection to a Db by calling jDb::getConnection().
public
getDbConnection([string $profile = '' ]) : jDbConnection
Parameters
- $profile : string = ''
-
The profile to use, if empty, use the default one
Return values
jDbConnectiongetFormPath()
Returns the path to the json form folder.
public
getFormPath() : string
Return values
string —the path
getFullUrl()
Returns the absolute Url.
public
getFullUrl(mixed $selector[, mixed $params = array() ]) : mixed
Parameters
- $selector : mixed
-
The Jelix selector of the Url
- $params : mixed = array()
-
an associative array with the parameters of the Url
getIniModifier()
Returns a the IniFileModifier corresponding to the ini file.
public
getIniModifier(mixed $ini) : mixed
Parameters
- $ini : mixed
-
The ini file
getJelixDao()
Return the result of a jDao method.
public
getJelixDao(string $jSelector[, string $profile = '' ]) : jDaoFactoryBase
Parameters
- $jSelector : string
- $profile : string = ''
-
the profile name for the db connection
Return values
jDaoFactoryBasegetLocale()
Get a string in a specific language.
public
getLocale(string $key[, mixed $variables = array() ]) : string
Parameters
- $key : string
-
The Jelix selector corresponding to the string you want to get
- $variables : mixed = array()
Return values
string —the translated string
getProfile()
Return the properties of a profile by calling jProfile::get().
public
getProfile(string $category[, string $name = '' ][, bool $noDefault = false ]) : array<string|int, mixed>
Parameters
- $category : string
-
The profile category
- $name : string = ''
-
the profile name
- $noDefault : bool = false
-
If true and if the profile doesn't exist, throw an error instead of getting the default profile
Return values
array<string|int, mixed> —properties
getTileCaps()
Calls the lizmapTiler::getTileCapabilities method.
public
getTileCaps(mixed $project) : mixed
Parameters
- $project : mixed
getTpl()
Returns a new jTpl Object.
public
getTpl() : mixed
getUrl()
Returns the URL corresponding to the Jelix Selector.
public
getUrl(mixed $selector) : mixed
Parameters
- $selector : mixed
-
The Jelix selector
getUserSession()
Informations of the current authenticated user.
public
getUserSession() : object
Return values
object —the result of jAuth::getUserSession()
logException()
Log an Exception.
public
logException(Exception $exception[, string $cat = 'default' ]) : mixed
Parameters
- $exception : Exception
-
The exception to log
- $cat : string = 'default'
-
The category of the logged Exception
logMessage()
Log a message.
public
logMessage(mixed $message[, string $cat = 'default' ]) : mixed
Parameters
- $message : mixed
-
The message to log
- $cat : string = 'default'
-
The category of the logged message
normalizeCacheKey()
return the normalized value of a cache key, to be used with getCache.
public
normalizeCacheKey(string $key) : string
Parameters
- $key : string
Return values
stringsetCache()
Set a data in the cache.
public
setCache(string $key, mixed $value[, mixed $ttl = null ][, string $profile = '' ]) : bool
Parameters
- $key : string
-
The cache key
- $value : mixed
-
The data to store in the cache
- $ttl : mixed = null
-
data time expiration
- $profile : string = ''
-
the cache profile to use
Return values
bool —false if failure
UserIsConnected()
Indicate if the current user is authenticated.
public
UserIsConnected() : bool
Return values
bool —return the result of jAuth::isConnected()