SetUp the system

@author Edson B S Monteiro <bruno.monteirodg@gmail.com>
@since 1.0
@return $this
511285
private function setUp(): self
    {
        fn::allowCors();
        fn::allowHeader();
        $this->configApp();
        $this->configRoutes();

        return $this;
    }
124864
private function setup()
    {
        $config = $this->config();
        date_default_timezone_set($config['timezone']);

        // Setup routes
        $this->routeManager()->setupRoutes();

        // Setup modules
        $this->setupModules();

        // Setup routable (if not running CLI mode)
        if (PHP_SAPI !== 'cli') {
            $this->setupRoutables();
        }

        // Setup middlewares
        $this->setupMiddlewares();
    }
913483
public function setConfig()
    {
        $this->config = (require static::prependPackagePath('bootstrap/config.php'))['web-drivers'];

        $this->config = @$this->config[$this->getDriver()][$this->getUserOS()];

        if (!$this->config) {
            throw new \ErrorException("Currently {$this->getDriver()} not supported.");
        }

        return $this;
    }
804178
public function setupProject()
    {
        $this->taskWriteToFile(ProjectX::projectRoot() . '/.gitignore')
            ->text($this->loadTemplateContents('.gitignore.txt'))
            ->place('PROJECT_ROOT', $this->getInstallRoot(true))
            ->run();

        return $this;
    }
620044
public function setup()
    {
        //====================================================================//
        // Read Parameters
        $this->id = Splash::configuration()->WsIdentifier;
        $this->key = Splash::configuration()->WsEncryptionKey;

        //====================================================================//
        // If Another Host is Defined => Allow Overide of Server Host Address
        if (!empty(Splash::configuration()->WsHost)) {
            $this->host = Splash::configuration()->WsHost;
        } else {
            $this->host = self::SPLASHHOST;
        }

        //====================================================================//
        // If Http Auth is Required => Setup User & Password
        if (isset(Splash::configuration()->HttpAuth) && !empty(Splash::configuration()->HttpAuth)) {
            $this->httpAuth = true;
        }
        if ($this->httpAuth && isset(Splash::configuration()->HttpUser)) {
            $this->httpUser = Splash::configuration()->HttpUser;
        }
        if ($this->httpAuth && isset(Splash::configuration()->HttpPassword)) {
            $this->httpPassword = Splash::configuration()->HttpPassword;
        }

        //====================================================================//
        // Safety Check
        if (!$this->verify()) {
            return false;
        }

        return Splash::log()->deb('MsgWsSetParams');
    }
939650
public function setup () {
        if ($this->enabled()) {
            BatchManager::instance()->displayAnyErrors($this->batchIdentifier());

            if ($this->mediaListIntegration) {
                add_action('admin_init', function() {
                    add_filter('bulk_actions-upload', function($actions) {
                        return $this->registerBulkActions($actions);
                    });

                    add_filter('handle_bulk_actions-upload', function($redirect_to, $action_name, $post_ids) {
                        return $this->handleBulkActions($redirect_to, $action_name, $post_ids);
                    }, 1000, 3);
                });
            }
        }
    }
1250877
public function setupAcl()
    {
        $this->insertRoles($this->findRoles())
            ->insertResources($this->findResources())
            ->insertPrivileges($this->findPrivileges());

        $this->loaded = true;

        return $this;
    }
697781
public static function setup()
    {
        if (static::$setup === false) {
            try {
                static::create_container();
                static::init_config();
                static::init_routing();
                static::init_services();
                static::add_wordpress_globals();

                // Run the loader.
                $loader = new Loader();
                $loader->boot();

                static::register_providers();
                static::init_templating();

                static::init_view();

                $classmap = null;
                $classmap_cache = \get_stylesheet_directory() . '/cache/config/' . \sha1(NONCE_SALT . 'classmap');

                if (WP_DEBUG === false && \file_exists($classmap_cache)) {
                    $classmap = \file_get_contents($classmap_cache);
                }

                $loader->load_theme($classmap);
            } catch (Exception $e) {
                throw new Startup_Exception($e->getMessage());
            }
        }

        static::$setup = true;
    }
1080259
protected function setupRootNode()
    {
        $builder = new TreeBuilder();
        $this->rootNode = $builder->root($this->getBundleName());

        return $this;
    }
1180143
protected function setUp()
    {
        $this->services['service']->register(array(
            'config' => Config::class,
            'routingFactory' => function(){ return new Factory();},
            'map' => function() { return $this['routingFactory']->createGroup();},
            'request' => function(){ return isset($_SERVER['REQUEST_URI']) ? ServerRequest::createFromGlobals() : null;},
            'url' => function() { return $this->create('url.factory', array($this->map, $this->request ? : null, $this->config->get('app.url', null)));},
        ));

        $this->services['factory']->register(array(
            'runtime.context' => Context::class,
            'runtime.response' => function(){ return Response::createEmptyResponse();},
            'url.factory' => UrlFactory::class
        ));

        $this->map->addExecuteHandler('closure', ClosureHandler::class);
    }
1246095
public function setup() {
		$input_keys = array_keys((array) elgg_get_config('input'));
		$request_keys = array_keys((array) $_REQUEST);
		$keys = array_unique(array_merge($input_keys, $request_keys));
		foreach ($keys as $key) {
			if ($key) {
				$this->params->$key = get_input($key);
			}
		}
	}
121888
private function setup()
    {
        $manager = $this->getConnection()->getSchemaManager();
        if ($this->tablesExist === true || $manager->tablesExist([$this->options['db_table']]) === true) {
            $this->tablesExist = true;

            return;
        }

        $schema = new Schema();
        $table = $schema->createTable($this->options['db_table']);

        $table->addColumn($this->options['db_column_feature'], 'string', ['length' => 255]);
        $table->addColumn($this->options['db_column_state'], 'boolean');

        $table->setPrimaryKey([$this->options['db_column_feature']]);

        $platform = $this->getConnection()->getDatabasePlatform();
        $queries = $schema->toSql($platform);

        foreach ($queries as $query) {
            $this->getConnection()->executeQuery($query);
        }

        $this->tablesExist = true;
    }
302013
public function load()
    {
        $settings = $this->getService('com:settings.setting');

        foreach($this->_attributes as $key => $value) {
          $this->_attributes[$key] = $settings->$key;
        }

        return $this;
    }
253592
protected function setUp()
	{
		if (isset($this->configurator->tags[$this->tagName]))
		{
			return;
		}

		// Create tag
		$tag = $this->configurator->tags->add($this->tagName);

		// Create attribute
		$tag->attributes->add($this->attrName);

		// Create a template that replaces its content with the replacement char
		$tag->template
			= '<xsl:value-of select="@' . htmlspecialchars($this->attrName) . '"/>';
	}
1077175
protected function setUp()
	{
		$this->register(array(
			'finding' => Finding::class,
			'route' => Route::class,
			'group' => Group::class
			));

        $this->addDefaultGroupHandler(new ClosureHandler());
        $this->addDefaultGroupHandler(new ArrayHandler());
//        $this->addDefaultGroupHandler(new PathHandler());

		return $this;
	}
9971
private function init()
    {
        foreach ($this->configs as $webmaster => $content) {
            $this->add($webmaster, $content);
        }
    }
385388
protected function setup()
    {
        if (!$this->dir) {
            // Greate a temporary directory.
            $tempfile = tempnam(sys_get_temp_dir(), '');
            mkdir($tempfile.'.git');
            if (file_exists($tempfile)) {
                unlink($tempfile);
            }
            $this->dir = $tempfile.'.git';
            $this->git = $this->wrapper->init($this->dir);
        }
        if ($this->git) {
            $this->git->config('user.name', 'GitMerge');
            $this->git->config('user.email', 'gitmerge@php-merge.example.com');
            $this->git->config('merge.conflictStyle', 'diff3');
        }
    }