Class jProfiles

Description

class to read profiles from the profiles.ini.php

Located in /utils/jProfiles.class.php (line 17)


	
			
Variable Summary
static array $_objectPool
static array $_profiles
Method Summary
static void clear ()
static void createVirtualProfile (string $category, string $name, array|string $params)
static array get (string $category, [string $name = ''], [boolean $noDefault = false])
static object|null getFromPool (string $category, string $name)
static object|null getOrStoreInPool (string $category, string $name, string|array $function, [ $nodefault = false], boolean $noDefault)
static void loadProfiles ()
static void storeInPool (string $category, string $name,  $object, object $obj)
Variables
static array $_objectPool = array() (line 29)

pool of objects loaded for profiles

  • var: array of object
  • access: protected
static array $_profiles = null (line 23)

loaded profiles

  • access: protected
Methods
static clear (line 188)

clear the loaded profiles to force to reload the profiles file.

WARNING: it destroy all objects stored in the pool!

  • access: public
static void clear ()
static createVirtualProfile (line 164)

create a temporary new profile

  • access: public
static void createVirtualProfile (string $category, string $name, array|string $params)
  • string $category: the profile category
  • string $name: the name of the profile
  • array|string $params: parameters of the profile. key=parameter name, value=parameter value. we can also indicate a name of an other profile, to create an alias
static get (line 52)

load properties of a profile.

A profile is a section in the profiles.ini.php file. Profiles are belong to a category. Each section names is composed by "category:profilename".

The given name can be a profile name or an alias of a profile. An alias is a parameter name in the category section of the ini file, and the value of this parameter should be a profile name.

  • return: properties
  • access: public
static array get (string $category, [string $name = ''], [boolean $noDefault = false])
  • string $category: the profile category
  • string $name: profile name or alias of a profile name. if empty, use the default profile
  • boolean $noDefault: if true and if the profile doesn't exist, throw an error instead of getting the default profile
static getFromPool (line 130)

store an object in the objects pool, corresponding to a profile

  • return: the stored object
  • access: public
static object|null getFromPool (string $category, string $name)
  • string $category: the profile category
  • string $name: the name of the profile (value of _name in the retrieved profile)
static getOrStoreInPool (line 146)

add an object in the objects pool, corresponding to a profile

or store the object retrieved from the function, which accepts a profile as parameter (array)

  • return: the stored object
  • access: public
static object|null getOrStoreInPool (string $category, string $name, string|array $function, [ $nodefault = false], boolean $noDefault)
  • string $category: the profile category
  • string $name: the name of the profile (will be given to jProfiles::get)
  • string|array $function: the function name called to retrieved the object. It uses call_user_func.
  • boolean $noDefault: if true and if the profile doesn't exist, throw an error instead of getting the default profile
  • $nodefault
static loadProfiles (line 32)
  • access: protected
static void loadProfiles ()
static storeInPool (line 120)

add an object in the objects pool, corresponding to a profile

  • access: public
static void storeInPool (string $category, string $name,  $object, object $obj)
  • string $category: the profile category
  • string $name: the name of the profile (value of _name in the retrieved profile)
  • object $obj: the object to store
  • $object

Documentation generated on Wed, 04 Jan 2017 22:55:58 +0100 by phpDocumentor 1.4.3