Determine if the environment engine is running.

@return bool
505375
public function isEngineRunning()
    {
        foreach (array_keys($this->getServices()) as $name) {
            $container = $this->getServiceContainerId($name);
            if (!$this->isContainerRunning($container)) {
                return false;
            }
        }

        return true;
    }
215170
public function is_system_configured() {
        global $CFG;

        return (!empty($CFG->airnotifierurl) && !empty($CFG->airnotifierport) &&
                !empty($CFG->airnotifieraccesskey)  && !empty($CFG->airnotifierappname) &&
                !empty($CFG->airnotifiermobileappname));
    }
681930
public function isActiveSession()
    {
        // Check if session timeout is defined in application settings
        $sessionConfig = $GLOBALS['app']->getConfiguration()->getRawConfiguration('session');
        if (!empty($sessionConfig) && isset($sessionConfig['timeout']) && !empty($sessionConfig['timeout'])) {
            $sessionTimeout = $sessionConfig['timeout'];
        } else {
            $sessionTimeout = SESSION_TIMEOUT;
        }

        file_put_contents(getcwd().'/logs/session.log', print_r($_SESSION, 1));

        if(isset($_SESSION[self::GLOBAL_PREFIX.'last_accessed']) &&
            (time() - $_SESSION[self::GLOBAL_PREFIX.'last_accessed'] > $sessionTimeout)) {
            return FALSE;
        }

        return TRUE;
    }
302856
public static function environment()
	{
		$env = static::fw()->config->get( 'app.env', 'production' );

		if ( func_num_args() > 0 )
		{
			$patterns = is_array( func_get_arg( 0 ) ) ? func_get_arg( 0 ) : func_get_args();

			foreach ( $patterns as $pattern )
				if ( Str::is( $pattern, $env ) )
					return true;

			return false;
		}

		return $env;
	}
74427
protected function verifyEnvironment(): bool
    {
        if ($this->option('force') || $this->config->isSafe()) {
            //Safe to run
            return true;
        }

        $this->writeln("<fg=red>Confirmation is required to run migrations!</fg=red>");

        if (!$this->askConfirmation()) {
            $this->writeln("<comment>Cancelling operation...</comment>");

            return false;
        }

        return true;
    }
332667
public function isValid() {
		if (is_resource($this->process)) {
			$status = proc_get_status($this->process);
			return $status['running'];
		} else {
			return false;
		}
	}
955776
public function isConnected(): bool
    {
        if ($this->engine) {
            $connected = $this->engine->isConnected();
            if (!$connected) {
                $this->engine = null;
            }

            return $connected;
        }

        return false;
    }
137492
public function isEnabled()
    {
        if ($this->enabled === null) {
            $environments  = config('songshenzong-log.env', ['dev', 'local', 'production']);
            $this->enabled = in_array(env('APP_ENV'), $environments, true);
        }

        return $this->enabled;
    }
459434
def is_running(self):
        
        return self._state in [self.STATE_ACTIVE,
                               self.STATE_IDLE,
                               self.STATE_INITIALIZING]
961198
public function gc()
	{
		$this->engine->setOption('automaticCleaningFactor', 1);
		$this->engine->setOption('hashedDirectoryLevel', 1);

		$success1 = $this->engine->clean($this->directory . DS, false, 'old');

		if (!($dh = opendir($this->directory . DS)))
		{
			return false;
		}

		$result = true;

		while ($file = readdir($dh))
		{
			if ($file != '.' && $file != '..' && $file != '.svn')
			{
				$file2 = $this->directory . DS . $file;

				if (is_dir($file2))
				{
					$result = ($result and $this->engine->clean($file2 . DS, false, 'old'));
				}
			}
		}

		$success = ($success1 && $result);

		return $success;
	}
654803
protected function is_process_running() {
	    $lockData = get_option($this->identifier . '_process_lock', null);

	    if (!empty($lockData) || isset($lockData['expires'])) {
            if (time() <= $lockData['expires']) {
                Logger::info('Lock still active.  Expires in: '.($lockData['expires'] - time()));

                return true;
            } else {
                Logger::info("Lock expired");
            }
        }

        if (!empty($lockData)) {
            delete_option($this->identifier . '_process_lock');
        } else {
            Logger::info('No lock data.');
        }

        return false;
	}
909723
public function checkEnvironments()
    {
        /*
         * If we did not fill in any environment, log every environment.
         */
        if(!count($this->config['environments'])){
            return true;
        }

        /*
         * If we did fill in environments, check the array.
         */
        if (in_array(env('APP_ENV'), $this->config['environments'])) {
            return true;
        }

        return false;
    }
724422
public static function is_system_configured() {
        global $DB;

        // First, check if the plugin is disabled.
        $processor = $DB->get_record('message_processors', array('name' => 'airnotifier'), '*', MUST_EXIST);
        if (!$processor->enabled) {
            return 0;
        }

        // Then, check if the plugin is completly configured.
        $manager = new message_airnotifier_manager();
        return (int) $manager->is_system_configured();
    }
252678
public function isRunning()
    {
        if ($this->resourceOpen instanceof ProcOpen) {
            $status = proc_get_status($this->process);
            $running = $status['running'];
            $this->running = ($running === false) ? $running : $this->running;
        }

        return $this->running;
    }
407105
private function checkHosts():bool
    {
        if (null === $this->config) {
            return (true);
        }
        $current_env = FEnv::get("framework.env");
        $ip = ToolsExceptions::getClientIp();
        $result = true;
        if ("dev" === $current_env) {
            if (property_exists($this->config, "hosts_denied_dev")) {
                $dd = $this->config->hosts_denied_dev;
                if (null !== $dd) {
                    if (false != in_array("*", $dd)) {
                        $result = false;
                    } elseif (false != in_array($ip, $dd)) {
                        $result = false;
                    }
                }
            }
            if (property_exists($this->config, "hosts_allowed_dev")) {
                $dd = $this->config->hosts_allowed_dev;
                if (null !== $dd) {
                    if (true == in_array("*", $dd) && $result) {
                        $result = true;
                    } elseif (true === in_array($ip, $dd) && false === $result) {
                        $result = true;
                    }
                }
            }
        } elseif ("prod" === $current_env) {
            if (property_exists($this->config, "hosts_denied_prod")) {
                $dd = $this->config->hosts_denied_prod;
                if (null !== $dd) {
                    if (false != in_array("*", $dd)) {
                        $result = false;
                    } elseif (false != in_array($ip, $dd)) {
                        $result = false;
                    }
                }
            }
            if (property_exists($this->config, "hosts_allowed_prod")) {
                $dd = $this->config->hosts_allowed_prod;
                if (null !== $dd) {
                    if (true == in_array("*", $dd) && $result) {
                        $result = true;
                    } elseif (true === in_array($ip, $dd) && false === $result) {
                        $result = true;
                    }
                }
            }
        }

        if (false === $result) {
            throw new Server403(new \ArrayObject(array("solution" =>
                "Add the current host to the allowed hosts list")));
        }

        return (true);
    }
1035751
public function check()
    {
        if (class_exists($this->className)) {
            return [EnvironmentCheck::OK, 'Class ' . $this->className.' exists'];
        }
        return [EnvironmentCheck::ERROR, 'Class ' . $this->className.' doesn\'t exist'];
    }
117943
public
    static function getEnvironment()
    {
        if (empty(self::$environment)) {
            self::$environment = getenv(self::ENV)
                ?: @$_SERVER[self::ENV]
                    ?: @$_ENV[self::ENV];

            // If the environment cannot be inferred, assume production.
            if (empty(self::$environment)) {
                self::$environment = self::ENV_PRODUCTION;
            }
        }

        return self::$environment;
    }