PHP 클래스 Neos\Flow\Monitor\FileMonitor

파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$cache Neos\Cache\Frontend\StringFrontend
$changeDetectionStrategy Neos\Flow\Monitor\ChangeDetectionStrategy\ChangeDetectionStrategyInterface
$changedFiles array Changed files for this monitor
$changedPaths array The changed paths for this monitor
$directoriesAndFiles array Array of directories and files that were cached on the last run.
$identifier string
$monitoredDirectories array
$monitoredFiles array
$signalDispatcher Neos\Flow\SignalSlot\Dispatcher
$systemLogger Neos\Flow\Log\SystemLoggerInterface

공개 메소드들

메소드 설명
__construct ( string $identifier ) Constructs this file monitor
createFileMonitorAtBoot ( string $identifier, Bootstrap $bootstrap ) : FileMonitor Helper method to create a FileMonitor instance during boot sequence as injections have to be done manually.
detectChanges ( ) : void Detects changes of the files and directories to be monitored and emits signals accordingly.
getIdentifier ( ) : string Returns the identifier of this monitor
getMonitoredDirectories ( ) : array Returns a list of all monitored directories
getMonitoredFiles ( ) : array Returns a list of all monitored files
injectCache ( StringFrontend $cache ) : void Injects the Flow_Monitor cache
injectChangeDetectionStrategy ( Neos\Flow\Monitor\ChangeDetectionStrategy\ChangeDetectionStrategyInterface $changeDetectionStrategy ) : void Injects the Change Detection Strategy
injectSignalDispatcher ( Dispatcher $signalDispatcher ) : void Injects the Singal Slot Dispatcher because classes of the Monitor subpackage cannot be proxied by the AOP framework because it is not initialized at the time the monitoring is used.
injectSystemLogger ( Neos\Flow\Log\SystemLoggerInterface $systemLogger ) : void Injects the system logger
monitorDirectory ( string $path, string $filenamePattern = null ) : void Adds the specified directory to the list of directories to be monitored.
monitorFile ( string $pathAndFilename ) : void Adds the specified file to the list of files to be monitored.
shutdownObject ( ) : void Caches the directories and their files

보호된 메소드들

메소드 설명
detectChangedFiles ( array $pathAndFilenames ) : array Detects changes in the given list of files and emits signals if necessary.
detectChangesOnPath ( string $path, string $filenamePattern ) : boolean Detect changes for one of the monitored paths.
emitDirectoriesHaveChanged ( string $monitorIdentifier, array $changedDirectories ) : void Signalizes that the specified directory has changed
emitFilesHaveChanged ( string $monitorIdentifier, array $changedFiles ) : void Signalizes that the specified file has changed
loadDetectedDirectoriesAndFiles ( ) : void Loads the last detected files for this monitor.
readMonitoredDirectoryRecursively ( string $path, string $filenamePattern ) : Generator Read a monitored directory recursively, taking into account filename patterns
saveDetectedDirectoriesAndFiles ( ) : void Store the changed directories and files back to the cache.
setDetectedFilesForPath ( string $path, array $files ) : void

메소드 상세

__construct() 공개 메소드

Constructs this file monitor
public __construct ( string $identifier )
$identifier string Name of this specific file monitor - will be used in the signals emitted by this monitor.

createFileMonitorAtBoot() 공개 정적인 메소드

Helper method to create a FileMonitor instance during boot sequence as injections have to be done manually.
public static createFileMonitorAtBoot ( string $identifier, Bootstrap $bootstrap ) : FileMonitor
$identifier string
$bootstrap Neos\Flow\Core\Bootstrap
리턴 FileMonitor

detectChangedFiles() 보호된 메소드

Detects changes in the given list of files and emits signals if necessary.
protected detectChangedFiles ( array $pathAndFilenames ) : array
$pathAndFilenames array A list of full path and filenames of files to check
리턴 array An array of changed files (key = path and filenmae) and their status (value)

detectChanges() 공개 메소드

Detects changes of the files and directories to be monitored and emits signals accordingly.
public detectChanges ( ) : void
리턴 void

detectChangesOnPath() 보호된 메소드

Detect changes for one of the monitored paths.
protected detectChangesOnPath ( string $path, string $filenamePattern ) : boolean
$path string
$filenamePattern string
리턴 boolean TRUE if any changes were detected in this path

emitDirectoriesHaveChanged() 보호된 메소드

Signalizes that the specified directory has changed
protected emitDirectoriesHaveChanged ( string $monitorIdentifier, array $changedDirectories ) : void
$monitorIdentifier string Name of the monitor which detected the change
$changedDirectories array An array of changed directories (key = path) and their status (value)
리턴 void

emitFilesHaveChanged() 보호된 메소드

Signalizes that the specified file has changed
protected emitFilesHaveChanged ( string $monitorIdentifier, array $changedFiles ) : void
$monitorIdentifier string Name of the monitor which detected the change
$changedFiles array An array of changed files (key = path and filename) and their status (value)
리턴 void

getIdentifier() 공개 메소드

Returns the identifier of this monitor
public getIdentifier ( ) : string
리턴 string

getMonitoredDirectories() 공개 메소드

Returns a list of all monitored directories
public getMonitoredDirectories ( ) : array
리턴 array A list of paths of monitored directories

getMonitoredFiles() 공개 메소드

Returns a list of all monitored files
public getMonitoredFiles ( ) : array
리턴 array A list of paths and filenames of monitored files

injectCache() 공개 메소드

Injects the Flow_Monitor cache
public injectCache ( StringFrontend $cache ) : void
$cache Neos\Cache\Frontend\StringFrontend
리턴 void

injectChangeDetectionStrategy() 공개 메소드

Injects the Change Detection Strategy
public injectChangeDetectionStrategy ( Neos\Flow\Monitor\ChangeDetectionStrategy\ChangeDetectionStrategyInterface $changeDetectionStrategy ) : void
$changeDetectionStrategy Neos\Flow\Monitor\ChangeDetectionStrategy\ChangeDetectionStrategyInterface The strategy to use for detecting changes
리턴 void

injectSignalDispatcher() 공개 메소드

Injects the Singal Slot Dispatcher because classes of the Monitor subpackage cannot be proxied by the AOP framework because it is not initialized at the time the monitoring is used.
public injectSignalDispatcher ( Dispatcher $signalDispatcher ) : void
$signalDispatcher Neos\Flow\SignalSlot\Dispatcher The Signal Slot Dispatcher
리턴 void

injectSystemLogger() 공개 메소드

Injects the system logger
public injectSystemLogger ( Neos\Flow\Log\SystemLoggerInterface $systemLogger ) : void
$systemLogger Neos\Flow\Log\SystemLoggerInterface
리턴 void

loadDetectedDirectoriesAndFiles() 보호된 메소드

Loads the last detected files for this monitor.
protected loadDetectedDirectoriesAndFiles ( ) : void
리턴 void

monitorDirectory() 공개 메소드

All files in these directories will be monitored too.
public monitorDirectory ( string $path, string $filenamePattern = null ) : void
$path string Absolute path of the directory to monitor
$filenamePattern string A pattern for filenames to consider for file monitoring (regular expression)
리턴 void

monitorFile() 공개 메소드

The file in question does not necessarily have to exist.
public monitorFile ( string $pathAndFilename ) : void
$pathAndFilename string Absolute path and filename of the file to monitor
리턴 void

readMonitoredDirectoryRecursively() 보호된 메소드

Read a monitored directory recursively, taking into account filename patterns
protected readMonitoredDirectoryRecursively ( string $path, string $filenamePattern ) : Generator
$path string The path of a monitored directory
$filenamePattern string
리턴 Generator

saveDetectedDirectoriesAndFiles() 보호된 메소드

Store the changed directories and files back to the cache.
protected saveDetectedDirectoriesAndFiles ( ) : void
리턴 void

setDetectedFilesForPath() 보호된 메소드

protected setDetectedFilesForPath ( string $path, array $files ) : void
$path string
$files array
리턴 void

shutdownObject() 공개 메소드

Caches the directories and their files
public shutdownObject ( ) : void
리턴 void

프로퍼티 상세

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

protected StringFrontend,Neos\Cache\Frontend $cache
리턴 Neos\Cache\Frontend\StringFrontend

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

protected ChangeDetectionStrategyInterface,Neos\Flow\Monitor\ChangeDetectionStrategy $changeDetectionStrategy
리턴 Neos\Flow\Monitor\ChangeDetectionStrategy\ChangeDetectionStrategyInterface

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

Changed files for this monitor
protected array $changedFiles
리턴 array

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

The changed paths for this monitor
protected array $changedPaths
리턴 array

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

Array of directories and files that were cached on the last run.
protected array $directoriesAndFiles
리턴 array

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

protected string $identifier
리턴 string

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

protected array $monitoredDirectories
리턴 array

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

protected array $monitoredFiles
리턴 array

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

protected Dispatcher,Neos\Flow\SignalSlot $signalDispatcher
리턴 Neos\Flow\SignalSlot\Dispatcher

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

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
리턴 Neos\Flow\Log\SystemLoggerInterface