PHPDaemon\Core\Daemon::checkSupports PHP Method

checkSupports() protected static method

Method to fill $support array
protected static checkSupports ( ) : void
return void
    protected static function checkSupports()
    {
        if (is_callable('runkit_lint_file')) {
            self::$support[self::SUPPORT_RUNKIT_SANDBOX] = true;
        }
        if (is_callable('runkit_function_add')) {
            self::$support[self::SUPPORT_RUNKIT_MODIFY] = true;
        }
        if (is_callable('runkit_import')) {
            self::$support[self::SUPPORT_RUNKIT_IMPORT] = true;
        }
        if (self::supported(self::SUPPORT_RUNKIT_MODIFY) && ini_get('runkit.internal_override')) {
            self::$support[self::SUPPORT_RUNKIT_INTERNAL_MODIFY] = true;
        }
    }

Usage Example

 /**
  * Performs initial actions.
  * @return void
  */
 public static function init()
 {
     Daemon::$startTime = time();
     set_time_limit(0);
     Daemon::$defaultErrorLevel = error_reporting();
     Daemon::$restrictErrorControl = (bool) Daemon::$config->restricterrorcontrol->value;
     ob_start(['\\PHPDaemon\\Core\\Daemon', 'outputFilter']);
     set_error_handler(['\\PHPDaemon\\Core\\Daemon', 'errorHandler']);
     Daemon::checkSupports();
     Daemon::$initservervar = $_SERVER;
     Daemon::$masters = new Collection();
     Daemon::$shm_wstate = new ShmEntity(Daemon::$config->pidfile->value, Daemon::SHM_WSTATE_SIZE, 'wstate', true);
     Daemon::openLogs();
 }