PHP Class Go\Instrument\ClassLoading\CachePathManager

Can be extended to get a more sophisticated real-to-cached code mapping
ファイルを表示 Open project: goaop/framework Class Usage Examples

Protected Properties

Property Type Description
$appDir string | null
$cacheDir string | null
$cacheState array Cached metadata for transformation state for the concrete file
$fileMode integer File mode
$kernel Go\Core\AspectKernel
$newCacheState array New metadata items, that was not present in $cacheState
$options array

Public Methods

Method Description
__construct ( AspectKernel $kernel )
__destruct ( ) Automatic destructor saves all new changes into the cache
flushCacheState ( ) Flushes the cache state into the file
getCacheDir ( ) : null | string Returns current cache directory for aspects, can be bull
getCachePathForResource ( string $resource ) : boolean | string
queryCacheState ( string | null $resource = null ) : array | null Tries to return an information for queried resource
setCacheDir ( string $cacheDir ) Configures a new cache directory for aspects
setCacheState ( string $resource, array $metadata ) Put a record about some resource in the cache

Method Details

__construct() public method

public __construct ( AspectKernel $kernel )
$kernel Go\Core\AspectKernel

__destruct() public method

This implementation is not thread-safe, so be care
public __destruct ( )

flushCacheState() public method

Flushes the cache state into the file
public flushCacheState ( )

getCacheDir() public method

Returns current cache directory for aspects, can be bull
public getCacheDir ( ) : null | string
return null | string

getCachePathForResource() public method

public getCachePathForResource ( string $resource ) : boolean | string
$resource string
return boolean | string

queryCacheState() public method

Tries to return an information for queried resource
public queryCacheState ( string | null $resource = null ) : array | null
$resource string | null Name of the file or null to get all information
return array | null Information or null if no record in the cache

setCacheDir() public method

Configures a new cache directory for aspects
public setCacheDir ( string $cacheDir )
$cacheDir string New cache directory

setCacheState() public method

This data will be persisted during object destruction
public setCacheState ( string $resource, array $metadata )
$resource string Name of the file
$metadata array Miscellaneous information about resource

Property Details

$appDir protected_oe property

protected string|null $appDir
return string | null

$cacheDir protected_oe property

protected string|null $cacheDir
return string | null

$cacheState protected_oe property

Cached metadata for transformation state for the concrete file
protected array $cacheState
return array

$fileMode protected_oe property

File mode
protected int $fileMode
return integer

$kernel protected_oe property

protected AspectKernel,Go\Core $kernel
return Go\Core\AspectKernel

$newCacheState protected_oe property

New metadata items, that was not present in $cacheState
protected array $newCacheState
return array

$options protected_oe property

protected array $options
return array