PHPDaemon\FS\FileSystem::init PHP Méthode

init() public static méthode

Initialize FS driver
public static init ( ) : void
Résultat void
    public static function init()
    {
        if (!Daemon::$config->eioenabled->value) {
            self::$supported = false;
            return;
        }
        if (!(self::$supported = Daemon::loadModuleIfAbsent('eio', self::$eioVer))) {
            Daemon::log('FS: missing pecl-eio >= ' . self::$eioVer . '. Filesystem I/O performance compromised. Consider installing pecl-eio. `pecl install http://pecl.php.net/get/eio`');
            return;
        }
        self::$fdCache = new CappedStorageHits(self::$fdCacheSize);
        eio_init();
    }

Usage Example

Exemple #1
0
 /**
  * Runtime of Worker process.
  * @return void
  */
 protected function run()
 {
     if (Daemon::$process instanceof Master) {
         Daemon::$process->unregisterSignals();
     }
     EventLoop::init();
     Daemon::$process = $this;
     if (Daemon::$logpointerAsync) {
         Daemon::$logpointerAsync->fd = null;
         Daemon::$logpointerAsync = null;
     }
     class_exists('Timer');
     if (Daemon::$config->autogc->value > 0) {
         gc_enable();
     } else {
         gc_disable();
     }
     $this->prepareSystemEnv();
     $this->registerEventSignals();
     FileSystem::init();
     // re-init
     FileSystem::initEvent();
     Daemon::openLogs();
     $this->fileWatcher = new FileWatcher();
     $this->IPCManager = Daemon::$appResolver->getInstanceByAppName('\\PHPDaemon\\IPCManager\\IPCManager');
     if (!$this->IPCManager) {
         $this->log('cannot instantiate IPCManager');
     }
     EventLoop::$instance->run();
 }
All Usage Examples Of PHPDaemon\FS\FileSystem::init