Boot Twig environment.

@return \Twig_Environment
515703
private function boot() {
		list( $locations, $config ) = $this->get_engine_config();

		$loader = new Twig_Loader_Filesystem( $locations );
		$env    = new Twig_Environment( $loader, $config );

		if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
			$env->addExtension( new Twig_Extension_Debug() );
		}

		return $env;
	}
751315
public function boot()
    {
        $this->registerResources();
        $this->registerServiceProviders();
        $this->registerAliases();
        $this->registerModuleRegistry();
        $this->registerCommands();
        $this->registerRoutesAndMiddlewares();
        $this->registerFields();
        $this->registerGeneratorStubs();
        $this->registerLocales();
        $this->registerViewComposers();
        $this->registerValidationRules();
        $this->registerAssets();

        $this->app->singleton( SecurityStrategy::class, function()
        {
            return $this->app->make( SessionSecurityService::class );
        } );

        $this->loadTranslationsFrom( __DIR__ . '/resources/lang', 'arbory' );
    }
479138
public function boot()
    {
        \spl_autoload_register(__NAMESPACE__ . '\Loader::class_autoload', true);
        \spl_autoload_register(__NAMESPACE__ . '\Loader::alias_autoload', true);

        static::$aliases = Config::get('services.aliases');

        if (\is_admin() || Request::is_wp_login()) {
            $this->class_list[] = \Snap\Admin\Whitelabel::class;
            $this->class_list[] = \Snap\Admin\Columns\Post_Template::class;
            $this->class_list[] = \Snap\Media\Admin::class;

            $this->conditional_load('admin.snap_admin_theme', 'Snap\Admin\Theme');
        } else {
            $this->class_list[] = \Snap\Http\Middleware\Is_Logged_In::class;
        }

        $this->conditional_load('theme.disable_comments', 'Snap\Admin\Disable_Comments');
        $this->conditional_load('theme.disable_customizer', 'Snap\Admin\Disable_Customizer');
        $this->conditional_load('theme.disable_tags', 'Snap\Admin\Disable_Tags');

        foreach ($this->class_list as $module) {
            Container::resolve($module)->run();
        }

        $this->init_widgets();

        // Now all core files are loaded, turn on output buffer until a view is dispatched.
        \ob_start();
    }
954011
public static function init()
    {
        self::$loader = new Twig_Loader_Filesystem();

        $config = Config::getInstance();

        foreach (array_reverse($config->get('Octo.paths.templates', [])) as $path) {
            self::$loader->addPath($path);
        }

        foreach (array_reverse($config->get('Octo.paths.admin_templates', [])) as $path) {
            self::$loader->addPath($path, 'admin');
        }

        self::$loader->addPath(CMS_PATH . 'Database/Templates/', 'db');

        if (OCTO_CACHE_ENABLED) {
            self::$cache = OCTO_CACHE_PATH;
        } else {
            self::$cache = false;
        }

        self::$twig = new Twig_Environment(self::$loader, [
            'charset' => 'UTF-8',
            'cache' => self::$cache,
            'auto_reload' => true,
            'strict_variables' => false,
        ]);

        $functions = [];
        Event::trigger('TemplateInit', $functions);

        foreach ($functions as $name => $callable) {
            self::addFunction($name, $callable);
        }

        self::$initialised = true;
    }
1005036
protected function registerTwigParser()
    {
        /*
         * Register system Twig environment
         */
        App::singleton('twig.environment', function ($app) {
            $twig = new Twig_Environment(new TwigLoader, ['auto_reload' => true]);
            $twig->addExtension(new TwigExtension);
            return $twig;
        });

        /*
         * Register .htm extension for Twig views
         */
        App::make('view')->addExtension('htm', 'twig', function () {
            return new TwigEngine(App::make('twig.environment'));
        });
    }
974190
public function instance() {
		if ( ! isset( self::$environment ) ) {
			self::$environment = $this->boot();
		}

		return self::$environment;
	}
1045920
public function boot()
    {
        Blade::directive('orgmanagerHorizontal', function ($expression) {
            return $this->logo->orgmanagerHorizontal();
        });
        Blade::directive('orgmanagerHorizontalWhite', function ($expression) {
            return $this->logo->orgmanagerHorizontalWhite();
        });
        Blade::directive('orgmanagerIcon', function ($expression) {
            return $this->logo->orgmanagerIcon();
        });
        Blade::directive('orgmanagerIconWhite', function ($expression) {
            return $this->logo->orgmanagerIconWhite();
        });
        Blade::directive('orgmanagerVertical', function ($expression) {
            return $this->logo->orgmanagerVertical();
        });
        Blade::directive('orgmanagerVerticalWhite', function ($expression) {
            return $this->logo->orgmanagerVerticalWhite();
        });
    }
766426
private function loadTwig(Environment $twig)
    {
        foreach ($this->registerTwigFunctions() as $name => $options) {
            if (is_string($options)) {
                $this->addTwigFunction($name, $options);
            } else {
                $this->addTwigFunction($name, $options[0], isset($options[1]) ? $options[1] : []);
            }
        }

        foreach ($this->registerTwigFilters() as $name => $options) {
            if (is_string($options)) {
                $this->addTwigFilter($name, $options);
            } else {
                $this->addTwigFilter($name, $options[0], isset($options[1]) ? $options[1] : []);
            }
        }

        foreach ($this->registerTwigPaths() as $key => $value) {
            if (is_array($value)) {
                $this->addTwigPath($key, $value);
            } else {
                $this->addTwigPath($value);
            }
        }

        foreach ($this->twigFunctions as $twigFunction) {
            $twig->addFunction($twigFunction);
        }

        foreach ($this->twigFilters as $twigFilter) {
            $twig->addFilter($twigFilter);
        }

        $this->updateSandboxPolicy($twig);
    }
26678
public function boot()
    {
        $this->publishes([ realpath(__DIR__ . '/../config/admin-generator.php') => config_path('admin-generator.php') ], 'config');

        $templatePath = $this->getTemplatePath();

        $this->publishes([ realpath(__DIR__ . '/../templates') => $templatePath ], 'templates');
    }
61266
protected function getTwigEnvironment()
    {
        $twigEnvironment = new \Twig_Environment(new \Twig_Loader_Filesystem($this->skeletonDirs), array(
            'debug'            => true,
            'cache'            => false,
            'strict_variables' => true,
            'autoescape'       => false,
        ));

        $twigEnvironment->addExtension($this->container->get('twig.extension.text_formatter'));

        return $twigEnvironment;
    }
737412
public function bootstrap()
    {
        if (! $this->runningInConsole && $this->initializeFs()) {
            $this->buildFsTree();
            $this->initialized = true;
        }

        return $this->initialized;
    }
163874
private function initTwig(){
        if($this->twig === null){
            $this->twig = new Environment(
                new FilesystemLoader(__DIR__ . "/../resource/views"),
                [
                    "debug" => true,
                ]
            );

            $this->twig->addExtension(
                new \Twig\Extension\DebugExtension
            );
            $this->twig->addExtension(
                new \Twig\Extension\StringLoaderExtension
            );
            $this->twig->addFilter(new \Twig_Filter("md5", function($v){
                return md5($v);
            }));
        }
    }
605947
public function boot() {

		// Load the locale functions files.
		add_action( 'after_setup_theme', [ $this, 'loadLocaleFunctions' ], ~PHP_INT_MAX );

		// Load framework textdomain.
		add_action( 'after_setup_theme', [ $this, 'loadTextdomain' ], 95 );

		// Overrides the load textdomain function for the 'hybrid-core' domain.
		add_filter( 'override_load_textdomain', [ $this, 'overrideLoadTextdomain' ], 5, 3 );

		// Filter the textdomain mofile to allow child themes to load the parent theme translation.
		add_filter( 'load_textdomain_mofile', [ $this, 'loadTextdomainMofile' ], 10, 2 );
	}
242381
public static function boot() {
        parent::boot();

        $myself   = get_called_class();
        $hooks    = array('before' => 'ing', 'after' => 'ed');
        $radicals = array('sav', 'validat', 'creat', 'updat', 'delet');

        foreach ($radicals as $rad) {
            foreach ($hooks as $hook => $event) {
                $method = $hook.ucfirst($rad).'e';
                if (method_exists($myself, $method)) {
                    $eventMethod = $rad.$event;
                    self::$eventMethod(function($model) use ($method){
                        return $model->$method($model);
                    });
                }
            }
        }
    }
582078
public function boot()
    {

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


        Blade::directive('widget', function ($expression) {
            $segments = explode(',', preg_replace("/[\(\)\\\]/", '', $expression));

            if (!array_key_exists(1, $segments)) {
                return '<?php echo (new \Orchid\Widget\Widget)->get(' . $segments[0] . '); ?>';
            }

            return '<?php echo (new \Orchid\Widget\Widget)->get(' . $segments[0] . ',' . $segments[1] . '); ?>';
        });
    }
934314
public function boot()
    {
        $envFile;
        if(\file_exists(\base_path('.env')))
            $envFile = \base_path('.env');
        else
            $envFile = __DIR__.'/Publish/.env.pub.default';
		$this->publishes([
			__DIR__.'/Publish/publish.php'	=> \config_path('publish.php'),
	        $envFile => \base_path('.env.pub.default'),
	    ]);
    }
1268956
public function boot()
    {
        $configs = [
            'appsettings'       => 'appsettings.php',
            'globalviewvars'    => 'globalviewvars.php',
            'themerdefaultfiles'=> 'themerdefaultfiles.php',
            'socialmedia'       => 'socialmedia.php',
            'defaultusergroups' => 'defaultusergroups.php',
        ];

        $publishes = [];

        foreach ($configs as $key => $config) {
            $configFile = __DIR__ . '/config/' . $config;
            $this->mergeConfigFrom($configFile, $key);

            $publishes[$configFile] = config_path($config);
        }

        if ($this->app->runningInConsole()) {
            $this->publishes($publishes, 'laranix-configs');
        }
    }