Update the applications bootstrap.php file.

@param string $app Path to the application to update.
@param string $plugin Name of plugin.
@return bool If modify passed.
968270
protected function modifyApplication($app, $plugin)
    {
        $finder = "@\\\$this\-\>addPlugin\(\s*'$plugin'(.|.\n|)+\);+@";

        $content = file_get_contents($app);
        $newContent = preg_replace($finder, '', $content);

        if ($newContent === $content) {
            return false;
        }

        file_put_contents($app, $newContent);

        $this->out('');
        $this->out(sprintf('%s modified', $app));

        return true;
    }
201909
public function doUpdate( App $app ) {
		if ( ! $app->constants ) {
			return FALSE;
		} elseif ( ! is_array( $app->constants ) ) {
			throw new ConfigException(
			    __("Value of 'constants' property in '*.config.json' must be an object.", 'wpf') );
		}
		foreach ( $app->constants as $name => $value ) {
			define( $name, $value );
		}
	}
1297604
public function doUpdate( App $app ) {
		// Require ACF
		if ( ! is_plugin_active('advanced-custom-fields-pro/acf.php') and current_user_can('activate_plugins') ) {
			// Stop activation redirect and show error
			throw new ConfigException(
			    __('Sorry, but this plugin requires the "ACF Pro" to be installed and active.', 'wpf') );
		}
		// PHP_VERSION_ID is available as of PHP 5.2.7, if our
		// version is lower than that, then emulate it
		if ( ! defined('PHP_VERSION_ID') ) {
			$version = explode('.', PHP_VERSION );
			define('PHP_VERSION_ID', ( $version[0] * 10000 + $version[1] * 100 + $version[2] ) );
		}
		if ( PHP_VERSION_ID < 70000) {
			throw new ConfigException(
                __('Sorry, WPF framework supports PHP after 7.0 version.', 'wpf') );
		}
	}
342547
public function bootstrap(Container $app)
    {
        foreach ($app->make('config')->get('app.providers') as $provider) {
            $app->register(new $provider($app));
        }
        
        foreach ($app->make('config')->get('app.theme.providers', []) as $provider) {
            $app->register(new $provider($app));
        }
    }
1035331
public static function run(Application $app)
    {
        $config = Config::getOrEmpty('application');
        $debug  = (bool)Arr::get($config, 'debug', false);
        define('DEBUG', $debug);

        self::setUpErrorHandling($debug);
        self::configure($config);
        self::bootstrap($config);
        self::initAPI($config, $app);

        Session::start();

        foreach (Arr::get($config, 'response.defaultHeaders', []) as $header) {
            header($header);
        }
    }
975802
public function boot(Container $app)
    {
        $toBoot = (array) $app['config']->get('bootstrap', []);

        foreach ($toBoot as $bootstrapClass) {
            $app->make($bootstrapClass)->boot($app);
        }
    }
268670
public static function unload($plugin = null)
    {
        if (self::loaded($plugin)) {
            $locales = Configure::read('App.paths.locales');
            foreach ($locales as $key => $path) {
                if ($path == self::getLocalePath($plugin)) {
                    unset($locales[$key]);
                }
            }

            Configure::write('App.paths.locales', $locales);
        }

        parent::unload($plugin);
    }
230235
public function bootstrap(Application $app)
	{
		$url = $app['config']->get('app.url', 'http://localhost');

		$app->instance('request', Request::create($url, 'GET', [], [], [], $_SERVER));
	}
95834
public function bootstrap(Application $app)
    {
        $this->app = $app;

        error_reporting(-1);

        set_error_handler([$this, 'handleError']);

        set_exception_handler([$this, 'handleException']);

        register_shutdown_function([$this, 'handleShutdown']);

        if (! $app->environment('testing')) {
            ini_set('display_errors', 'Off');
        }
    }
768339
function update( FS_Plugin $plugin, $store = true ) {
			if ( ! ($this->_module instanceof FS_Plugin ) ||
			     $this->_module->slug != $plugin->slug ||
			     $this->_module->public_key != $plugin->public_key ||
			     $this->_module->secret_key != $plugin->secret_key ||
			     $this->_module->parent_plugin_id != $plugin->parent_plugin_id ||
			     $this->_module->title != $plugin->title
			) {
				$this->store( $plugin, $store );

				return true;
			}

			return false;
		}
319606
public function bootstrap(Container $app)
    {
        $this->app = $app;
        
        $this->app->singleton('env', function ($app) {
            return new Dotenv(base_path(), $this->getEnvFileName());
        });
        
        $env = $this->app->make('env');
        
        $env->overload();
        $env->required([
            'DB_NAME',
            'DB_USER',
            'DB_PASS',
            'DB_HOST',
        ]);
    }
590970
protected function startRoutingPlugin($app)
    {
        $this->requiresPlugins(Paths::class, Resources::class);
        $this->onRegister('routing', function (Application $app) {
            if (PHP_SAPI !== 'cli' || $this->app->runningUnitTests()) {
                $router = $app->make('router');
                $kernel = $app->make('Illuminate\Contracts\Http\Kernel');

                foreach ($this->prependMiddleware as $class) {
                    $kernel->prependMiddleware($class);
                }

                foreach ($this->middleware as $class) {
                    $kernel->pushMiddleware($class);
                }

                foreach ($this->routeMiddleware as $name => $class) {
                    if (method_exists($router, 'middleware')) {
                        $router->middleware($name, $class);
                    } else {
                        $router->aliasMiddleware($name, $class);
                    }
                }

                foreach ($this->middlewareGroups as $groupName => $classes) {
                    $router->middlewareGroup($groupName, $classes);
                }

                foreach ($this->prependGroupMiddleware as $group => $class) {
                    $router->prependMiddlewareToGroup($group, $class);
                }

                foreach ($this->groupMiddleware as $group => $class) {
                    $router->pushMiddlewareToGroup($group, $class);
                }
            }
        });

        $this->onBoot('routing', function (Application $app) {
            foreach ($this->routeFiles as $routeFile) {
                $this->loadRoutesFrom(path_join($this->resolvePath('routesPath'), str_ensure_right($routeFile, '.php')));
            }
        });

        static::refreshRoutes($app);
    }
612025
public function bootstrap(Application $app)
    {
        $items = [];

        // 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;

            $loadedFromCache = true;
        }

        // Next we will spin through all of the configuration files in the configuration
        // directory and load each one into the repository. This will make all of the
        // options available to the developer for use in various parts of this app.
        $app->instance('config', $config = new Repository($items));

        if (! isset($loadedFromCache)) {
            $this->loadConfigurationFiles($app, $config);
        }

        // Finally, we will set the application's environment based on the configuration
        // values that were loaded. We will pass a callback which will be used to get
        // the environment in a web context where an "--env" switch is not present.
        $app->detectEnvironment(function () use ($config) {
            return $config->get('app.env', 'production');
        });

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

        mb_internal_encoding('UTF-8');
    }
463937
public function bootstrap($app)
    {

        $app->urlManager->addRules([
            $this->id . '/login' => '/user/security/login',
            // $this->id . '/logout' => '/user/security/logout',
            $this->id . '/users/<action:\w+>' => '/user/admin/<action>',
            $this->id . '/rbac/<controller:\w+>/<action:\w+>' => '/rbac/<controller>/<action>',
        ]);

        $app->getModule('user')->controllerMap['admin'] = [
            'class'  => 'dektrium\user\controllers\AdminController',
            'layout' => '@vendor/colibri-platform/admin/views/layouts/main.php'
        ];

        $app->getModule('rbac')->layout = '@vendor/colibri-platform/admin/views/layouts/main.php';

        if (ltrim($app->getRequest()->url, '/') == $this->id . '/login') {
            // Set the admin layout and override view to the login form
            $app->getModule('user')->controllerMap['security'] = [
                'class'  => 'dektrium\user\controllers\SecurityController',
                'layout' => '@vendor/colibri-platform/admin/views/layouts/login.php'
            ];

            $view = $app->getView();

            if (empty($view->theme)) {
                $view->theme = Yii::createObject('yii\base\Theme');
            }

            $view->theme->pathMap['@dektrium/user/views'] = __DIR__ . '/views/user';

            // Set the return url to the admin home
            $app->getUser()->setReturnUrl('/' . $this->id);
        }

        if ($app->getModule('treemanager', false) === null) {
            $app->setModule('treemanager', [
                'class' => '\kartik\tree\Module',

                // The list of asset bundles that would be unset when rendering the node detail form via ajax
                'unsetAjaxBundles' => [
                    'yii\web\YiiAsset',
                    'yii\web\JqueryAsset',
                    'yii\widgets\ActiveFormAsset',
                    'kartik\form\ActiveFormAsset',
                    'yii\validators\ValidationAsset',
                    'yii\bootstrap\BootstrapAsset',
                ]
            ]);
        }
    }
137771
public function bootPlugin($plugin)
    {
        if (!$plugin || $plugin->disabled) {
            return;
        }

        if (!self::$noInit || $plugin->elevated) {
            $plugin->boot();
        }
    }
720723
public function bootstrap(Application $app)
    {
        $uri = $app->make('config')->get('app.url', 'http://localhost');

        $components = parse_url($uri);

        $server = $_SERVER;

        if (isset($components['path'])) {
            $server = array_merge($server, [
                'SCRIPT_FILENAME' => $components['path'],
                'SCRIPT_NAME' => $components['path']
            ]);
        }

        $app->instance('request', Request::create(
            $uri,
            'GET',
            [],
            [],
            [],
            $server
        ));
    }
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);
//        }
    }