ACL Extension  0.3
 All Data Structures Namespaces Files Functions Variables
Strategy Class Reference

Static Public Member Functions

static initialize ()
static getClass ($className)
static get ($propName)

Static Public Attributes

static $strategy = 'nestedSet.pathMaterialization'

Static Protected Member Functions

static createShortcutClasses ()

Static Protected Attributes

static $initialized = false
static $location = 'application.modules.acl.'
static $config = NULL

Detailed Description

Definition at line 11 of file Strategy.php.


Member Function Documentation

static createShortcutClasses ( )
staticprotected

Just generates "AGroup" and "RGroup" aka "AcessGroup" and "RequestGroup" dynamically

Definition at line 77 of file Strategy.php.

{
eval('class CGroup extends '.static::getClass('Aco').'{}');
eval('class RGroup extends '.static::getClass('Aro').'{}');
}
static get (   $propName)
static

Returns the given property of the strategy-config

Parameters:
string$propNamethey key of the property
Returns:
mixed the value

Definition at line 69 of file Strategy.php.

{
return @static::$config[$propName];
}
static getClass (   $className)
static

Gets the class-Name according to the chosen strategy

Parameters:
string$className
Returns:
string the resulting class-Name for the strategy

Definition at line 50 of file Strategy.php.

{
//If this is a global class
$globalClasses = array('AclObject', 'Action', 'RequestingActiveRecord',
'RestrictedActiveRecord', 'CGroup', 'RGroup');
if(in_array($className, $globalClasses))
return $className;
if(substr($className, 0, strlen(static::$config['prefix'])) == static::$config['prefix'])
return $className;
return static::$config['prefix'].$className;
}
static initialize ( )
static

Definition at line 29 of file Strategy.php.

{
if(!static::$initialized){
static::$initialized = true;
$strategyPath = static::$location.'.components.strategies.'.static::$strategy;
Yii::import($strategyPath.'.*');
Yii::import($strategyPath.'.models.*');
$config = require_once(Yii::getPathOfAlias($strategyPath.'.config').'.php');
if(!$config)
throw new RuntimeException('Unable to load configuration');
static::$config = $config;
}
}

Field Documentation

$config = NULL
staticprotected

Definition at line 27 of file Strategy.php.

$initialized = false
staticprotected

Definition at line 20 of file Strategy.php.

$location = 'application.modules.acl.'
staticprotected

Definition at line 26 of file Strategy.php.

$strategy = 'nestedSet.pathMaterialization'
static

Definition at line 18 of file Strategy.php.


The documentation for this class was generated from the following file: