fixing laravel bootstrapper
@param  string $public alias public directory
@param  string $core   alias core directory
@return void
546433
protected function fixBootstrapper($public, $core){
		$_core 			= Utility::getCorePath($this->getAlias(), $core);
		$_public		= Utility::getPublicPath($this->getAlias(), $public);
		$core 			= Utility::findRelativePath($_public, $_core);
		$indexPath		= Utility::combinePath(Utility::getPublicPath($this->getAlias(),$public), 'index.php');
		# Auto Loader
		$autoLoader 	= \file_get_contents(__DIR__ . '/../Stubs/autoLoader.tpl');
		$autoLoader		= Utility::renderTemplate($autoLoader, ['{{CORE_PATH}}' => $core]);
		$autoLoader 	= Utility::normalizePath($autoLoader);
		# Bootstrap		
		$bootstrapper 	= \file_get_contents(__DIR__ . '/../Stubs/bootstrapper.tpl');
		$bootstrapper	= Utility::renderTemplate($bootstrapper, ['{{CORE_PATH}}' => $core]);
		$bootstrapper 	= Utility::normalizePath($bootstrapper);
		Utility::replaceInFile($indexPath, [
			'require __DIR__.\'/../bootstrap/autoload.php\';'			=> $autoLoader,
			'$app = require_once __DIR__.\'/../bootstrap/app.php\';'	=> $bootstrapper
		]);
	}
784684
public function boot()
    {
        $this->configure();

        // Publishing configs
        $this->publishes([__DIR__.'/../config/publish' => config_path('soda')], 'soda.config');
        $this->publishes([__DIR__.'/../public' => public_path('soda/cms')], 'soda.assets');

        $this->loadMigrationsFrom(__DIR__.'/../migrations');
        $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'soda');
        $this->loadViewsFrom(__DIR__.'/../resources/views', config('soda.cms.hint'));

        $this->extendBlade();

        $this->registerDependencies([
            RouteServiceProvider::class,
        ]);
    }
174400
public function boot()
    {
        $this->loadViewsFrom(__DIR__.'/../resources/views', 'Simplegrid');

        $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'Simplegrid');

        $this->publishes([
            __DIR__.'/../config/rafwell-simplegrid.php' => config_path('rafwell-simplegrid.php'),
        ]);

        $this->publishes([
            __DIR__.'/../public' => public_path('vendor/rafwell/simple-grid'),
        ]);
        
        //solve bug in translation pluralize
        //probably are a bug in laravel - https://stackoverflow.com/questions/31775626/why-does-laravels-trans-choice-always-show-the-singular-case
        if($this->app->getLocale()=='pt-BR')
            $this->app->setLocale('pt_BR');
    }
897162
public function boot(\Neos\Flow\Core\Bootstrap $bootstrap)
    {
        $dispatcher = $bootstrap->getSignalSlotDispatcher();
        $dispatcher->connect(ConfigurationManager::class, 'configurationManagerReady', function (ConfigurationManager $configurationManager) use ($dispatcher) {
            $enabled = $configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'MOC.Varnish.enabled');
            if ((boolean)$enabled === true) {
                $dispatcher->connect('Neos\Neos\Service\PublishingService', 'nodePublished', 'MOC\Varnish\Service\ContentCacheFlusherService', 'flushForNode');
                $dispatcher->connect('Neos\Flow\Mvc\Dispatcher', 'afterControllerInvocation', 'MOC\Varnish\Service\CacheControlService', 'addHeaders');
            }
        });
    }
397893
public function bootstrapMage2()
    {
        if (is_null($this->bootstrap)) {
            $bootstrap = Bootstrap::create(BP, $_SERVER);
            $bootstrap->getObjectManager();
            $this->bootstrap = true;
        }
    }
491395
public function boot()
    {
        if (! defined("DT_STARTED")) {
            /** @deprecated  */
            define('DT_STARTED', true);
            /** @deprecated  */
            define('DT_Unique', 'Unique');
            /** @deprecated  */
            define('DT_UniqueNum', 'UniqueNumber');
            /** @deprecated  */
            define('DT_UniqueStr', 'UniqueString');
            /** @deprecated  */
            define('DT_Random', 'Random');
            /** @deprecated  */
            define('DT_RandomNum', 'RandomNumber');
            /** @deprecated  */
            define('DT_RandomStr', 'RandomString');
        }
    }
1078065
public function bootAfterAll(): void
    {
        /** @var QueueManager $queue */
        $queue = app('queue');

        // Add database Connector
        $queue->addConnector('database', function () {
            return new DatabaseConnector($this->app['db']);
        });

        // Add RabbitMq Connector
        if (!empty($this->app->getProviders('VladimirYuldashev\LaravelQueueRabbitMQ\LaravelQueueRabbitMQServiceProvider'))) {
            $queue->addConnector('rabbitmq', function () {
                return new RabbitMQConnector($this->app['events']);
            });
        }

        if (!empty($this->app->getProviders('Laravel\Horizon\HorizonServiceProvider'))) {
            // Add horizon Connector
            $queue->addConnector('redis', function () {
                return new HorizonConnector($this->app['redis']);
            });
        } else {
            // Add Redis Connector
            $queue->addConnector('redis', function () {
                return new RedisConnector($this->app['redis']);
            });
        }
    }
346578
public function boot(Router $router): void
    {
        // Bind route models and constrains
        $router->pattern('category', '[a-zA-Z0-9-]+');
        $router->model('category', config('rinvex.categories.models.category'));

        // Map relations
        Relation::morphMap([
            'category' => config('rinvex.categories.models.category'),
        ]);

        // Load resources
        require __DIR__.'/../../routes/breadcrumbs/adminarea.php';
        $this->loadRoutesFrom(__DIR__.'/../../routes/web/adminarea.php');
        $this->loadViewsFrom(__DIR__.'/../../resources/views', 'cortex/categories');
        $this->loadTranslationsFrom(__DIR__.'/../../resources/lang', 'cortex/categories');
        ! $this->app->runningInConsole() || $this->loadMigrationsFrom(__DIR__.'/../../database/migrations');
        $this->app->runningInConsole() || $this->app->afterResolving('blade.compiler', function () {
            require __DIR__.'/../../routes/menus/adminarea.php';
        });

        // Publish Resources
        ! $this->app->runningInConsole() || $this->publishResources();
    }
1230097
public static function boot()
    {
        parent::boot();
        static::deleting(function ($permission) {
            if (!method_exists(config('access.permission'), 'bootSoftDeletes')) {
                $permission->roles()->sync([]);
            }

            return true;
        });
    }
822666
protected function _bootstrap()
    {
        if(!defined('_JEXEC'))
        {
            $_SERVER['HTTP_HOST']       = 'localhost';
            $_SERVER['HTTP_USER_AGENT'] = 'Composer';
            $_SERVER['REMOTE_ADDR']     = '127.0.0.1';

            define('_JEXEC', 1);
            define('DS', DIRECTORY_SEPARATOR);

            define('JPATH_BASE', realpath('.'));

            if (!file_exists(JPATH_BASE . '/includes/defines.php')) {
                throw new \RuntimeException('Could not find Joomla files. Make sure to run `composer install` from inside the root folder of your Joomla installation!');
            }

            require_once JPATH_BASE . '/includes/defines.php';

            require_once JPATH_BASE . '/includes/framework.php';
            require_once JPATH_LIBRARIES . '/import.php';

            require_once JPATH_LIBRARIES . '/cms.php';
        }

        if(!($this->_application instanceof Application))
        {
            $options = array(
                'root_user' => $this->_credentials['username'],
                'loglevel'  => $this->_verbosity
            );

            $this->_application = new Application($options);
            $this->_application->authenticate($this->_credentials);
        }
    }
276136
public function boot()
    {
        parent::boot();

        if (Request::is('*/page/page/*')) {
            Route::bind('page', function ($id) {
                $page = $this->app->make(\Litecms\Page\Interfaces\PageRepositoryInterface::class);
                return $page->findOrNew($id);
            });
        }

    }
626505
public function boot()
    {
        $app = $this->app;

        /*
         * ----------------------------------------------------------------------------
         * Bind the IOC container to our facades
         * Completely indebted to Taylor Otwell & Laravel for this.
         * ----------------------------------------------------------------------------
         */
        Facade::setFacadeApplication($app);

        /**
         * ----------------------------------------------------------------------------
         * Load path detection for relative assets, URL and path to home.
         * ----------------------------------------------------------------------------.
         */
        require_once DIR_BASE_CORE . '/bootstrap/paths.php';

        /*
         * ----------------------------------------------------------------------------
         * Add install environment detection
         * ----------------------------------------------------------------------------
         */
        $this->initializeEnvironmentDetection($app);

        /*
         * ----------------------------------------------------------------------------
         * Enable Configuration
         * ----------------------------------------------------------------------------
         */
        $config = $this->initializeConfig($app);

        /*
         * ----------------------------------------------------------------------------
         * Set configured error reporting
         * ----------------------------------------------------------------------------
         */
        $this->setupErrorReporting($config);

        /*
         * ----------------------------------------------------------------------------
         * Enable Localization
         * ----------------------------------------------------------------------------
         */
        $this->initializeLocalization($app);

        /*
         * ----------------------------------------------------------------------------
         * Finalize paths.
         * ----------------------------------------------------------------------------
         */
        require DIR_BASE_CORE . '/bootstrap/paths_configured.php';

        /*
         * ----------------------------------------------------------------------------
         * Setup core classes aliases.
         * ----------------------------------------------------------------------------
         */
        $this->initializeClassAliases($config);

        /*
         * ----------------------------------------------------------------------------
         * Simple legacy constants like APP_CHARSET
         * ----------------------------------------------------------------------------
         */
        $this->initializeLegacyDefinitions($config, $app);

        /*
         * ----------------------------------------------------------------------------
         * Setup the core service groups.
         * ----------------------------------------------------------------------------
         */
        $this->initializeServiceProviders($app, $config);

        /*
         * ----------------------------------------------------------------------------
         * Setup file cache directories. Has to come after we define services
         * because we use the file service.
         * ----------------------------------------------------------------------------
         */
        $app->setupFilesystem();

        /*
         * ----------------------------------------------------------------------------
         * Registries for theme paths, assets, routes and file types.
         * ----------------------------------------------------------------------------
         */
        $this->initializeAssets($config);
        $this->initializeRoutes($config);
        $this->initializeFileTypes($config);

        // If we're not in the CLI SAPI, lets do additional booting for HTTP
        if (!$this->app->isRunThroughCommandLineInterface()) {
            return $this->bootHttpSapi($config, $app);
        }
    }
708625
public static function boot()
    {
        parent::boot();

        static::deleting(function($user) {
            if (!method_exists(Config::get('auth.providers.users.model'), 'bootSoftDeletes')) {
                $user->roles()->sync([]);
            }

            return true;
        });
    }
1126816
public function __constructBootstrapCSS()
    {
        $this->registerEvent(
            'OnResourceInit',
            function () {
                $bootstrapAssetUrl = $this->getResourceManager()
                    ->publishAssetFolder(realpath(dirname(__FILE__)."/bootstrap"));
                $resources = array(
                    "css"=>array(
                        $bootstrapAssetUrl."/css/bootstrap.min.css",
                        $bootstrapAssetUrl."/css/bootstrap-theme.min.css"
                    )
                );
                $this->getResourceManager()
                    ->addScriptOnBegin("KoolReport.load.resources(".json_encode($resources).");");
            }
        );

    }
442890
public function boot()
    {
        $this->loadViewsFrom(__DIR__.'/../resources/views', 'admin');

        if (config('admin.https') || config('admin.secure')) {
            \URL::forceScheme('https');
            $this->app['request']->server->set('HTTPS', true);
        }

        if (file_exists($routes = admin_path('routes.php'))) {
            $this->loadRoutesFrom($routes);
        }

        if ($this->app->runningInConsole()) {
            $this->publishes([__DIR__.'/../config' => config_path()], 'laravel-admin-config');
            $this->publishes([__DIR__.'/../resources/lang' => resource_path('lang')], 'laravel-admin-lang');
//            $this->publishes([__DIR__.'/../resources/views' => resource_path('views/vendor/admin')],           'laravel-admin-views');
            $this->publishes([__DIR__.'/../database/migrations' => database_path('migrations')], 'laravel-admin-migrations');
            $this->publishes([__DIR__.'/../resources/assets' => public_path('vendor/laravel-admin')], 'laravel-admin-assets');
        }

        //remove default feature of double encoding enable in laravel 5.6 or later.
        $bladeReflectionClass = new \ReflectionClass('\Illuminate\View\Compilers\BladeCompiler');
        if ($bladeReflectionClass->hasMethod('withoutDoubleEncoding')) {
            Blade::withoutDoubleEncoding();
        }
    }
1137568
public function boot() {

		// Reference
		$self = $this;

		// Register Eloquent Hooks
		Event::listen('eloquent.created: *', function($obj) use ($self) { return $self->sync($obj); }, 10);
		Event::listen('eloquent.updated: *', function($obj) use ($self) { return $self->sync($obj); }, 10);
		Event::listen('eloquent.deleted: *', function($obj) use ($self) { return $self->delete($obj); }, 10);
	}
1111156
public function boot()
    {
        /*Load views*/
        $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'webed-core');
        /*Load translations*/
        $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'webed-core');

        $this->publishes([
            __DIR__ . '/../../resources/views' => config('view.paths')[0] . '/vendor/webed-core',
        ], 'views');
        $this->publishes([
            __DIR__ . '/../../resources/lang' => base_path('resources/lang/vendor/webed-core'),
        ], 'lang');
        $this->publishes([
            __DIR__ . '/../../config' => base_path('config'),
        ], 'config');
        $this->publishes([
            __DIR__ . '/../../resources/assets' => resource_path('assets'),
        ], 'webed-assets');
        $this->publishes([
            __DIR__ . '/../../resources/root' => base_path(),
            __DIR__ . '/../../resources/public' => public_path(),
        ], 'webed-public-assets');
    }