PHP Class Go\Core\AspectKernel

显示文件 Open project: goaop/framework Class Usage Examples

Protected Properties

Property Type Description
$container null | Go\Core\AspectContainer Aspect container instance
$containerClass string Default class name for container, can be redefined in children
$instance null | static Single instance of kernel
$options array Kernel options
$wasInitialized boolean Flag to determine if kernel was already initialized or not

Public Methods

Method Description
getContainer ( ) : null | Go\Core\AspectContainer Returns an aspect container
getInstance ( ) : static Returns the single instance of kernel
getOptions ( ) : array Returns list of kernel options
hasFeature ( integer $featureToCheck ) : boolean Checks if kernel configuration has enabled specific feature
init ( array $options = [] ) Init the kernel and make adjustments

Protected Methods

Method Description
__construct ( ) Protected constructor is used to prevent direct creation, but allows customization if needed
addKernelResourcesToContainer ( Go\Core\AspectContainer $container ) Add resources for kernel
configureAop ( Go\Core\AspectContainer $container ) : void Configure an AspectContainer with advisors, aspects and pointcuts
getDefaultOptions ( ) : array Returns default options for kernel. Available options:
normalizeOptions ( array $options ) : array Normalizes options for the kernel
registerTransformers ( ) : array | Go\Instrument\Transformer\SourceTransformer[] Returns list of source transformers, that will be applied to the PHP source

Method Details

__construct() protected method

Protected constructor is used to prevent direct creation, but allows customization if needed
protected __construct ( )

addKernelResourcesToContainer() protected method

Add resources for kernel
protected addKernelResourcesToContainer ( Go\Core\AspectContainer $container )
$container Go\Core\AspectContainer

configureAop() abstract protected method

Configure an AspectContainer with advisors, aspects and pointcuts
abstract protected configureAop ( Go\Core\AspectContainer $container ) : void
$container Go\Core\AspectContainer
return void

getContainer() public method

Returns an aspect container
public getContainer ( ) : null | Go\Core\AspectContainer
return null | Go\Core\AspectContainer

getDefaultOptions() protected method

debug - boolean Determines whether or not kernel is in debug mode appDir - string Path to the application root directory. cacheDir - string Path to the cache directory where compiled classes will be stored cacheFileMode - integer Binary mask of permission bits that is set to cache files features - integer Binary mask of features includePaths - array Whitelist of directories where aspects should be applied. Empty for everywhere. excludePaths - array Blacklist of directories or files where aspects shouldn't be applied.
protected getDefaultOptions ( ) : array
return array

getInstance() public static method

Returns the single instance of kernel
public static getInstance ( ) : static
return static

getOptions() public method

Returns list of kernel options
public getOptions ( ) : array
return array

hasFeature() public method

Checks if kernel configuration has enabled specific feature
public hasFeature ( integer $featureToCheck ) : boolean
$featureToCheck integer See Go\Aop\Features enumeration class for features
return boolean Whether specific feature enabled or not

init() public method

Init the kernel and make adjustments
public init ( array $options = [] )
$options array Associative array of options for kernel

normalizeOptions() protected method

Normalizes options for the kernel
protected normalizeOptions ( array $options ) : array
$options array List of options
return array

registerTransformers() protected method

Returns list of source transformers, that will be applied to the PHP source
protected registerTransformers ( ) : array | Go\Instrument\Transformer\SourceTransformer[]
return array | Go\Instrument\Transformer\SourceTransformer[]

Property Details

$container protected_oe property

Aspect container instance
protected null|AspectContainer,Go\Core $container
return null | Go\Core\AspectContainer

$containerClass protected_oe static_oe property

Default class name for container, can be redefined in children
protected static string $containerClass
return string

$instance protected_oe static_oe property

Single instance of kernel
protected static null|static $instance
return null | static

$options protected_oe property

Kernel options
protected array $options
return array

$wasInitialized protected_oe property

Flag to determine if kernel was already initialized or not
protected bool $wasInitialized
return boolean