Add "title" macros for "html" service location.

@param  \Illuminate\Contracts\Foundation\Application  $app

@return void
166565
protected function addHtmlExtensions(Application $app)
    {
        $html = $app->make('html');

        $html->macro('title', function ($title = null) use ($html) {
            $builder = new Title($html, \memorize('site.name'), [
                'site' => \get_meta('html::title.format.site', '{site.name} (Page {page.number})'),
                'page' => \get_meta('html::title.format.page', '{page.title} &mdash; {site.name}'),
            ]);

            return $builder->title($title ?: \trim(\get_meta('title', '')));
        });
    }
1247932
protected function setEnvironment(Application $app)
    {
        // Define acceptable environments
        $environments = array(
            'production',
            'staging',
            'qa',
            'testing',
            'development',
            'beta',
        );

        if (! isset($_SERVER['APP_ENV'])) {
            throw new \Exception('Missing \'APP_ENV\' environment variable');
        }

        if (! in_array($_SERVER['APP_ENV'], $environments)) {
            throw new \Exception('Invalid \'APP_ENV\' environment variable: \'' + $_SERVER['APP_ENV'] +'\'');
        }

        $app['environment'] = $_SERVER['APP_ENV'];
    }
330935
protected function runCommandInForeground(Application $app)
    {
        (new Process(
            trim($this->buildCommand(), '& '), dirname($app->request->getScriptFile()), null, null, null
        ))->run();
        $this->callAfterCallbacks($app);
    }
1014365
protected function runCommandInBackground(Application $app)
    {
        chdir(dirname($app->request->getScriptFile()));
        exec($this->buildCommand());
    }
802221
public function register(Application $app)
    {
        /** @var Translator $translator  */
        $translator = $app['translator'];
        $translator->addTranslationFolder(__DIR__ . DIRECTORY_SEPARATOR . 'Messages');

        /** @var ApplicationConfiguration $config */
        $config = $app['config'];

        $partialsCollection = new PartialsCollection($app['markdown']);
        $app['partials'] = $partialsCollection;

        /** @var Partial[] $partials */
        $partials = $config->getPartials();
        if ($partials) {
            foreach ($partials as $partial) {
                if (! $partial->getName()) {
                    throw new Exception\MissingNameForPartialException('The name of the partial to load is missing');
                }

                $content = '';
                if ($partial->getContent()) {
                    $content = $partial->getContent();
                } elseif ($partial->getLink()) {
                    if (! is_readable($partial->getLink())) {
                        $app['monolog']->error(
                            sprintf($translator->translate('PPCPP:EXC-NOPARTIAL'), $partial->getLink())
                        );
                        continue;
                    }

                    $content = file_get_contents($partial->getLink());
                }
                $partialsCollection->set($partial->getName(), $content);
            }
        }
    }
306997
public function bootstrap(Application $app)
    {
        AutoLoader::registerHandler($app->getAutoLoader());

        $app->getAutoLoader()->setCachePath(
            $app->storagePath() . DIRECTORY_SEPARATOR
            . 'cache' . DIRECTORY_SEPARATOR . "autoloader" . DIRECTORY_SEPARATOR
        );

        $app->setupAutoLoaderPaths();

//        if ($this->getStaging()->getStage()->inTesting()) {
        $app->getAutoLoader()->getClassMapLoader()->setRetry(true);
//        }
    }
937988
public function bootstrap(Application $app)
    {
        foreach ($app['config']->get('supports', []) as $feature => $value)
        {
            if ($value === 'automatic-feed-links')
            {
                add_theme_support($value);
            }
            else
            {
                add_theme_support($feature, $value);
            }
        }
    }
673866
public function register(Container $app): void
    {
        $app['markdown'] = function () {
            return Parsedown::instance();
        };

        $partialsCollection = new Collection();
        $app['partials'] = $partialsCollection;

        /** @var Partial[] $partials */
        $partials = []; //$config->getPartials();
        if ($partials) {
            foreach ($partials as $partial) {
                if (! $partial->getName()) {
                    throw new MissingNameForPartialException('The name of the partial to load is missing');
                }

                $partial->setParser($app['markdown']);
                if (!$partial->getContent() && $partial->getLink()) {
                    if (! is_readable($partial->getLink())) {
                        $app['monolog']->error(
                            sprintf('Partial "%s" not readable or found.', $partial->getLink())
                        );
                        continue;
                    }
                }

                $partialsCollection->set($partial->getName(), $partial);
            }
        }
    }
1302449
public function bootstrap(Application $app): void
    {
        if ($app->bound('config') && $app->environment('testing')) {
            return;
        }

        $items = [];
        $loader = new FileLoader(new Filesystem(), $app->configPath());

        // First we will see if we have a cache configuration file. If we do, we'll load
        // the configuration items from that file so that it is very quick. Otherwise
        // we will need to spin through every configuration file and load them all.
        if (\file_exists($cached = $app->getCachedConfigPath())) {
            $items = require $cached;
        }

        $this->setEnvironment($app, $items['*::app']['env'] ?? null);

        \tap(new Repository($loader, $app->environment()), function ($config) use ($app, $items) {
            $app->instance('config', $config);
            $config->setFromCache($items);

            \date_default_timezone_set($config->get('app.timezone', 'UTC'));
        });

        \mb_internal_encoding('UTF-8');
    }
466791
public function register(Application $app)
    {
        $prefix = $this->prefix;

        foreach(array('.server', '.options', '.attributes') as $key) {
            if (!(isset($app[$prefix . $key]))) {
                $app[$prefix. $key] = array();
            }
        }

        $app[$prefix] = $this->getPdo($app, $prefix);
    }
745453
public function register(Application $app)
    {
        $this->registerTranslationMessages($app);
        $this->registerWriters($app);
        $this->registerDependenciesOnXsltExtension($app);

        $app->register(new \phpDocumentor\Plugin\Graphs\ServiceProvider());
        $app->register(new \phpDocumentor\Plugin\Twig\ServiceProvider());
    }
64367
public function doUpdate( App $app ) {
		$update = function () use ( $app ) {
			if ( ! $app->remove_actions ) {
				return FALSE;
			}
			foreach ( $app->remove_actions as $args ) {
				if ( ! is_array( $args ) ) {
					throw new ConfigException(
					    __("All elements of 'remove_actions' property in '*.config.json' must be arrays too.", 'wpf') );
				}
				remove_action( ...$args );
			}
		};
		add_action('after_setup_theme', $update );
	}
234981
public function bootstrap(Application $app)
	{
		try
		{
			Dotenv::load($app->basePath(), $app->environmentFile());
		}
		catch (InvalidArgumentException $e)
		{
			//
		}

		$app->detectEnvironment(function()
		{
			return env('APP_ENV', 'production');
		});
	}
315925
protected function attachAccessPolicyEvents(Application $app)
    {
        // Orchestra Platform should be able to watch any changes to Role model
        // and sync the information to "orchestra.acl".
        Role::observe($app->make(RoleObserver::class));

        // Orchestra Platform should be able to determine admin and member roles
        // dynamically.
        Role::setDefaultRoles(\config('orchestra/foundation::roles'));
    }
145991
public function bootstrap(Application $app)
    {
        if (app('antares.installed')) {
            //app('antares.license.response')->validate();
        }
        $this->setCurrentTheme($app);
        $this->setThemeResolver($app);
    }
35360
public function bootstrap(Application $app)
    {
        $app['actions']->listen(
            'init',
            function () use ($app) {

                $this->extractWordpressClasses($app);

                $this->setDefaultPermalinkStructure($app);

                $this->bootstrapRoutes($app['router']);
            }
        );
    }
290492
protected function setEnvironment(Application $app, ?string $env = null): void
    {
        $app->detectEnvironment(function () use ($env) {
            return $env ?: env('APP_ENV', 'production');
        });
    }