Setup an environment for PSX according to the provided configuration

@codeCoverageIgnore
@param \PSX\Framework\Config\Config $config
498725
public static function setupEnvironment(Config $config)
    {
        if (!defined('PSX')) {
            // define paths
            define('PSX_PATH_CACHE', $config->get('psx_path_cache'));
            define('PSX_PATH_PUBLIC', $config->get('psx_path_public'));
            define('PSX_PATH_SRC', $config->get('psx_path_src') ?: $config->get('psx_path_library'));

            /** @deprecated */
            define('PSX_PATH_LIBRARY', $config->get('psx_path_library'));

            // error handling
            if ($config['psx_debug'] === true) {
                $errorReporting = E_ALL | E_STRICT;
            } else {
                $errorReporting = 0;
            }

            error_reporting($errorReporting);
            set_error_handler('\PSX\Framework\Bootstrap::errorHandler');

            // annotation autoload
            $namespaces = $config->get('psx_annotation_autoload');
            if (!empty($namespaces) && is_array($namespaces)) {
                self::registerAnnotationLoader($namespaces);
            }

            // ini settings
            ini_set('date.timezone', $config['psx_timezone']);
            ini_set('session.use_only_cookies', '1');
            ini_set('docref_root', '');
            ini_set('html_errors', '0');

            // define in psx
            define('PSX', true);
        }
    }
556728
private function setConfig($config)
    {
        $this->securityLevel = $config->config['project']['security_level'];
        if ($config->config['config']) {
            foreach ($config->config['config'] as $k => $v) {
                $this->log->debug("[ CONFIG Params ]" . $k . ": " . $v, []);
                $this->config->$k = $this->setSecurityLevel($v);
                $this->parameters["config"][$k] = $this->setSecurityLevel($v);
            }
        }

    }
905735
public function setConfig(array $config)
    {
        foreach ($config as $name => $value) {
            $setter = 'set' . ucfirst($name);

            call_user_func_array(array($this, $setter), array($value));
        }
    }
2447
public function setConfig($config)
    {
        $configObject = $this->getConfig();

        if (is_object($config)) {
            $config = get_object_vars($config);
        }

        foreach ((array)$config as $key => $value) {
            $configObject->$key = $value;
        }

        return $this;
    }
916763
public function setConfig($config)
    {
        $this->config = $config instanceof Structure ? $config : new Structure($config);

        $this->name    = $this->config['name'];
        $this->package = $this->getPackage();

        return $this;
    }
229211
public function setConfig($config)
    {
        $this->config = $config;

        $this->routes = $config['routes'];
        $this->options = $config['options'];

        return $this;
    }
563414
public static function configure($config)
    {
        if (is_null(static::$instance)) {
            static::$instance = new self();

            static::$name = $config['default'];

            static::$config = $config;
        }

        return static::$instance;
    }
23763
public function setConfig(Config $config)
    {
        $this->config = $this->server->setConfig($config);

        return $this;
    }
68889
public function load(Config $config)
    {
        $sys    = new Service\SystemService();
        $travis = new Service\TravisService($sys);

        $cfg = $travis->getConfig();

        if (null === $cfg) {
            return;
        }

        $config->set('travis_language', $cfg->get('language'));
        $config->set('travis_script', $cfg->get('script'));
        $config->set('travis_cron', 'cron' === strtolower(getenv('TRAVIS_EVENT_TYPE')));
        $config->set('travis', 'true' === getenv('TRAVIS'));

        if ('true' === getenv('TRAVIS')) {
            // running on Travis-CI platform
            if (0 === strlen($config->get('git_branch', null))) {
                $config->set('git_branch', getenv('TRAVIS_BRANCH'));
            }
        }
    }
1310756
private static function configure($config)
    {
        Driver\Connection\Metadata::$useCacheForMetadata = $config['useCache'];
        Driver\Connection::$monitorQueries               = $config['debug'];

        Db::setConfig(Config::get('database'));
        Cache::setConfig(Config::getOrEmpty('cache'));
        Log::setConfig(Config::getOrEmpty('log'));
    }
957133
public function setup($config)
    {
        // create fixes, initialize fixesForLevel
        $fixes = $this->makeFixes();
        $this->makeFixesForLevel($fixes);

        // figure out which fixes to use
        $level = $config->get('HTML.TidyLevel');
        $fixes_lookup = $this->getFixesForLevel($level);

        // get custom fix declarations: these need namespace processing
        $add_fixes = $config->get('HTML.TidyAdd');
        $remove_fixes = $config->get('HTML.TidyRemove');

        foreach ($fixes as $name => $fix) {
            // needs to be refactored a little to implement globbing
            if (isset($remove_fixes[$name]) ||
                (!isset($add_fixes[$name]) && !isset($fixes_lookup[$name]))) {
                unset($fixes[$name]);
            }
        }

        // populate this module with necessary fixes
        $this->populate($fixes);
    }
878392
protected function initializeConfig(array $config = null)
    {
        $default = $this->defaultConfigurations();

        $this->config = $config ? array_replace_recursive($default, $config) : $default;
    }
1280855
protected function setUpSpecificConfigurations(Configuration $config)
    {
        $config->setHydratorDir($this->getHydratorsPath());
        $config->setHydratorNamespace($this->getHydratorsNamespace());
        $config->setAutoGenerateHydratorClasses($this->getHydratorsAutoGeneration());

        $config->setPersistentCollectionDir($this->getPersistentCollectionPath());
        $config->setPersistentCollectionNamespace($this->getPersistentCollectionNamespace());
        $config->setAutoGeneratePersistentCollectionClasses($this->getAutoGeneratePersistentCollection());

        if ($this->getDefaultDatabase() !== null) {
            $config->setDefaultDB($this->getDefaultDatabase());
        }

        if ($this->getLoggerCallable() !== null) {
            $config->setLoggerCallable($this->getLoggerCallable());
        }

        foreach ($this->getCustomTypes() as $type => $class) {
            if (Type::hasType($type)) {
                Type::overrideType($type, $class);
            } else {
                Type::addType($type, $class);
            }
        }

        foreach ($this->getCustomFilters() as $name => $filterClass) {
            $config->addFilter($name, $filterClass);
        }
    }
1369855
public static function setAll($config)
	{
		foreach ($config as $key => $value) {
			self::set($key, $value);
		}

	}
351330
public function load(Config $config)
    {
        $sys = new Service\SystemService();

        $config->set('CWD', $sys->getCurrentWorkingDirectory());
    }
68207
protected function configure(array $config = [])
    {
        foreach ($config as $key => $value) {
            $method = 'set' . $key;
            if (method_exists($this, $method)) {
                $this->$method($value);
            }
        }
    }
1236083
public function setConfig(array $config): EnvironmentConfigEvent
    {
        $this->config = array_replace_recursive($this->config, $config);

        return $this;
    }