public static function createFileMonitorAtBoot($identifier, Bootstrap $bootstrap)
    {
        $fileMonitorCache = $bootstrap->getEarlyInstance(CacheManager::class)->getCache('Flow_Monitor');

        // The change detector needs to be instantiated and registered manually because
        // it has a complex dependency (cache) but still needs to be a singleton.
        $fileChangeDetector = new ChangeDetectionStrategy\ModificationTimeStrategy();
        $fileChangeDetector->injectCache($fileMonitorCache);
        $bootstrap->getObjectManager()->registerShutdownObject($fileChangeDetector, 'shutdownObject');

        $fileMonitor = new FileMonitor($identifier);
        $fileMonitor->injectCache($fileMonitorCache);
        $fileMonitor->injectChangeDetectionStrategy($fileChangeDetector);
        $fileMonitor->injectSignalDispatcher($bootstrap->getEarlyInstance(Dispatcher::class));
        $fileMonitor->injectLogger($bootstrap->getEarlyInstance(PsrLoggerFactoryInterface::class)->get('systemLogger'));

        return $fileMonitor;
    }
public static function createFileMonitorAtBoot($identifier, Bootstrap $bootstrap)
    {
        $fileMonitorCache = $bootstrap->getEarlyInstance(CacheManager::class)->getCache('Flow_Monitor');

        // The change detector needs to be instantiated and registered manually because
        // it has a complex dependency (cache) but still needs to be a singleton.
        $fileChangeDetector = new ChangeDetectionStrategy\ModificationTimeStrategy();
        $fileChangeDetector->injectCache($fileMonitorCache);
        $bootstrap->getObjectManager()->registerShutdownObject($fileChangeDetector, 'shutdownObject');

        $fileMonitor = new FileMonitor($identifier);
        $fileMonitor->injectCache($fileMonitorCache);
        $fileMonitor->injectChangeDetectionStrategy($fileChangeDetector);
        $fileMonitor->injectSignalDispatcher($bootstrap->getEarlyInstance(Dispatcher::class));
        $fileMonitor->injectLogger($bootstrap->getEarlyInstance(PsrLoggerFactoryInterface::class)->get('systemLogger'));

        return $fileMonitor;
    }
public static function createFileMonitorAtBoot ( $ identifier , Bootstrap $ bootstrap ) { $ fileMonitorCache = $ bootstrap -> getEarlyInstance ( CacheManager :: class ) -> getCache ( 'Flow_Monitor' ) ; // The change detector needs to be instantiated and registered manually because // it has a complex dependency (cache) but still needs to be a singleton. $ fileChangeDetector = new ChangeDetectionStrategy \ ModificationTimeStrategy ( ) ; $ fileChangeDetector -> injectCache ( $ fileMonitorCache ) ; $ bootstrap -> getObjectManager ( ) -> registerShutdownObject ( $ fileChangeDetector , 'shutdownObject' ) ; $ fileMonitor = new FileMonitor ( $ identifier ) ; $ fileMonitor -> injectCache ( $ fileMonitorCache ) ; $ fileMonitor -> injectChangeDetectionStrategy ( $ fileChangeDetector ) ; $ fileMonitor -> injectSignalDispatcher ( $ bootstrap -> getEarlyInstance ( Dispatcher :: class ) ) ; $ fileMonitor -> injectLogger ( $ bootstrap -> getEarlyInstance ( PsrLoggerFactoryInterface :: class ) -> get ( 'systemLogger' ) ) ; return $ fileMonitor ; }
Helper method to create a FileMonitor instance during boot sequence as injections have to be done manually.

@param string $identifier
@param Bootstrap $bootstrap
@return FileMonitor
Helper method to create a FileMonitor instance during boot sequence as injections have to be done manually .