PHP 클래스 Acl\AclExtras

Can be used in either a CLI or Web context.
파일 보기 프로젝트 열기: cakephp/acl 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$Acl Acl\Controller\Component\AclComponent Contains instance of AclComponent
$args array Contains arguments parsed from the command line.
$dataSource string Contains database source to use
$rootNode string Root node name.

보호된 프로퍼티들

프로퍼티 타입 설명
$_clean boolean Internal Clean Actions switch
$foundACOs array List of ACOs found during synchronization
$pluginPrefixes array Contains plugins route prefixes
$prefixes array Contains app route prefixes

공개 메소드들

메소드 설명
acoSync ( array $params = [] ) : void Sync the ACO table
acoUpdate ( array $params = [] ) : boolean Updates the Aco Tree with new controller actions.
err ( string $msg ) : void Output an error message.
getControllerList ( string $plugin = null, string $prefix = null ) : array Get a list of controllers in the app and plugins.
out ( string $msg ) : void Output a message.
recover ( ) : void Recover an Acl Tree
startup ( Controller $controller = null ) : void Start up And load Acl Component / Aco model

보호된 메소드들

메소드 설명
_buildPrefixes ( ) : void Build prefixes for App and Plugins based on configured routes
_checkMethods ( string $className, string $controllerName, array $node, string $pluginPath = null, string $prefixPath = null ) : boolean Check and Add/delete controller Methods
_checkNode ( string $path, string $alias, integer $parentId = null ) : array Check a node for existance, create it if it doesn't exist.
_cleaner ( integer $parentId, array $preservedItems = [] ) : void Delete unused ACOs.
_getCallbacks ( string $className, string $pluginPath = null, string $prefixPath = null ) : array Get a list of registered callback methods
_getNamespace ( string $className, string $pluginPath = null, string $prefixPath = null ) : string Get the namespace for a given class.
_pluginAlias ( string $plugin ) : string Returns the aliased name for the plugin (Needed in order to correctly handle nested plugins)
_processControllers ( Acl\Model\Entity\Aco $root ) : void Updates the Aco Tree with all App controllers.
_processPlugins ( Acl\Model\Entity\Aco $root, array $plugins = [] ) : void Updates the Aco Tree with all Plugins.
_processPrefixes ( Acl\Model\Entity\Aco $root ) : void Updates the Aco Tree with all App route prefixes.
_updateControllers ( array $root, array $controllers, string $plugin = null, string $prefix = null ) : array Updates a collection of controllers.

메소드 상세

_buildPrefixes() 보호된 메소드

Build prefixes for App and Plugins based on configured routes
protected _buildPrefixes ( ) : void
리턴 void

_checkMethods() 보호된 메소드

Check and Add/delete controller Methods
protected _checkMethods ( string $className, string $controllerName, array $node, string $pluginPath = null, string $prefixPath = null ) : boolean
$className string The classname to check
$controllerName string The controller name
$node array The node to check.
$pluginPath string The plugin path to use.
$prefixPath string The prefix path to use.
리턴 boolean

_checkNode() 보호된 메소드

Check a node for existance, create it if it doesn't exist.
protected _checkNode ( string $path, string $alias, integer $parentId = null ) : array
$path string The path to check
$alias string The alias to create
$parentId integer The parent id to use when creating.
리턴 array Aco Node array

_cleaner() 보호된 메소드

Delete unused ACOs.
protected _cleaner ( integer $parentId, array $preservedItems = [] ) : void
$parentId integer Id of the parent node.
$preservedItems array list of items that will not be erased.
리턴 void

_getCallbacks() 보호된 메소드

Get a list of registered callback methods
protected _getCallbacks ( string $className, string $pluginPath = null, string $prefixPath = null ) : array
$className string The class to reflect on.
$pluginPath string The plugin path.
$prefixPath string The prefix path.
리턴 array

_getNamespace() 보호된 메소드

Get the namespace for a given class.
protected _getNamespace ( string $className, string $pluginPath = null, string $prefixPath = null ) : string
$className string The class you want a namespace for.
$pluginPath string The plugin path.
$prefixPath string The prefix path.
리턴 string

_pluginAlias() 보호된 메소드

Returns the aliased name for the plugin (Needed in order to correctly handle nested plugins)
protected _pluginAlias ( string $plugin ) : string
$plugin string The name of the plugin to alias
리턴 string

_processControllers() 보호된 메소드

Updates the Aco Tree with all App controllers.
protected _processControllers ( Acl\Model\Entity\Aco $root ) : void
$root Acl\Model\Entity\Aco The root note of Aco Tree
리턴 void

_processPlugins() 보호된 메소드

Updates the Aco Tree with all Plugins.
protected _processPlugins ( Acl\Model\Entity\Aco $root, array $plugins = [] ) : void
$root Acl\Model\Entity\Aco The root note of Aco Tree
$plugins array list of App plugins
리턴 void

_processPrefixes() 보호된 메소드

Updates the Aco Tree with all App route prefixes.
protected _processPrefixes ( Acl\Model\Entity\Aco $root ) : void
$root Acl\Model\Entity\Aco The root note of Aco Tree
리턴 void

_updateControllers() 보호된 메소드

Updates a collection of controllers.
protected _updateControllers ( array $root, array $controllers, string $plugin = null, string $prefix = null ) : array
$root array Array or ACO information for root node.
$controllers array Array of Controllers
$plugin string Name of the plugin you are making controllers for.
$prefix string Name of the prefix you are making controllers for.
리턴 array

acoSync() 공개 메소드

Sync the ACO table
public acoSync ( array $params = [] ) : void
$params array An array of parameters
리턴 void

acoUpdate() 공개 메소드

Updates the Aco Tree with new controller actions.
public acoUpdate ( array $params = [] ) : boolean
$params array An array of parameters
리턴 boolean

err() 공개 메소드

Will either use shell->err, or controller->Flash->error()
public err ( string $msg ) : void
$msg string The message to output.
리턴 void

getControllerList() 공개 메소드

Returns an array of path => import notation.
public getControllerList ( string $plugin = null, string $prefix = null ) : array
$plugin string Name of plugin to get controllers for
$prefix string Name of prefix to get controllers for
리턴 array

out() 공개 메소드

Will either use shell->out, or controller->Flash->success()
public out ( string $msg ) : void
$msg string The message to output.
리턴 void

recover() 공개 메소드

Recover an Acl Tree
public recover ( ) : void
리턴 void

startup() 공개 메소드

Start up And load Acl Component / Aco model
public startup ( Controller $controller = null ) : void
$controller Cake\Controller\Controller Controller instance
리턴 void

프로퍼티 상세

$Acl 공개적으로 프로퍼티

Contains instance of AclComponent
public AclComponent,Acl\Controller\Component $Acl
리턴 Acl\Controller\Component\AclComponent

$_clean 보호되어 있는 프로퍼티

Internal Clean Actions switch
protected bool $_clean
리턴 boolean

$args 공개적으로 프로퍼티

Contains arguments parsed from the command line.
public array $args
리턴 array

$dataSource 공개적으로 프로퍼티

Contains database source to use
public string $dataSource
리턴 string

$foundACOs 보호되어 있는 프로퍼티

List of ACOs found during synchronization
protected array $foundACOs
리턴 array

$pluginPrefixes 보호되어 있는 프로퍼티

Contains plugins route prefixes
protected array $pluginPrefixes
리턴 array

$prefixes 보호되어 있는 프로퍼티

Contains app route prefixes
protected array $prefixes
리턴 array

$rootNode 공개적으로 프로퍼티

Root node name.
public string $rootNode
리턴 string