PHP Класс Neos\Flow\Monitor\FileMonitor

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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