Register default global paths.

@return  static

@since   2.0
767319
protected function registerPaths()
    {
        $config = $this->config;

        // Priority (1)
        $this->addPath(
            realpath($config->get('path.templates')),
            PriorityQueue::LOW - 20
        );

        // Priority (2)
        $this->addPath(
            realpath(__DIR__ . '/../Resources/Templates'),
            PriorityQueue::LOW - 30
        );

        return $this;
    }
433921
public function unregisterGlobals() {
        if (ini_get('register_globals')) {
            $array = array('_SESSION', '_POST', '_GET', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES');
            foreach ($array as $value) {
                foreach ($GLOBALS[$value] as $key => $var) {
                    if ($var === $GLOBALS[$key]) {
                        unset($GLOBALS[$key]);
                    }
                }
            }
        }
    }
681438
private function setGlobals()
    {
        /** @var Environment $twig */
        $twig = $this->app['twig'];
        /** @var \Bolt\Config $config */
        $config = $this->app['config'];
        /** @var \Bolt\Users $users */
        $users = $this->app['users'];
        $zone = null;
        /** @var RequestStack $requestStack */
        $requestStack = $this->app['request_stack'];
        if ($request = $requestStack->getCurrentRequest()) {
            $zone = Zone::get($request);
        }

        // User calls can cause exceptions that block the exception handler
        try {
            /** @deprecated Deprecated since 3.0, to be removed in 4.0. */
            $usersVal = $users->getUsers();
            $usersCur = $users->getCurrentUser();

            $sandbox = $this->app['twig.extension.sandbox'];
            $usersVal = array_map(function ($user) use ($sandbox) {
                return new ArrayAccessSecurityProxy($user, $sandbox, 'User');
            }, $usersVal);
            $usersCur = new ArrayAccessSecurityProxy($usersCur, $sandbox, 'User');
        } catch (\Exception $e) {
            $usersVal = null;
            $usersCur = null;
        }

        $twig->addGlobal('frontend', $zone === Zone::FRONTEND);
        $twig->addGlobal('backend', $zone === Zone::BACKEND);
        $twig->addGlobal('async', $zone === Zone::ASYNC);
        $twig->addGlobal('theme', $config->get('theme'));
        $twig->addGlobal('user', $usersCur);
        $twig->addGlobal('users', $usersVal);
    }
1151090
public function getPath() : ?string 
    {
        if ( ! $this->hasPath()) {
            $this->setPath($this->getDefaultPath());
        }
        return $this->path;
    }
745198
protected function getDefaults() {
        if (!$this->_defaults) {
            $this->_defaults = new DefaultsList($this->version, $this->solution['sid']);
        }

        return $this->_defaults;
    }
731309
public function updatePaths()
    {
        if (isset($this->configs['paths'])) {
            $paths = Loader::getInstance()->getPaths();
            foreach ($this->configs['paths'] as $key => $file) {
                $file = str_replace('@PEAR-DIR@', $paths['php_dir'], $file);
                $file = str_replace('@DATA-DIR@', $paths['data_dir'], $file);
                $this->configs['paths'][$key] = $file;
            }
        }
        return $this;
    }
702508
public function setupDrupalFilesystem()
    {
        $this->taskFilesystemStack()
            ->chmod($this->sitesPath, 0775, 0000, true)
            ->mkdir("{$this->sitesPath}/default/files", 0775, true)
            ->run();

        if ($this->getProjectVersion() >= 8) {
            $install_path = $this->getInstallPath();

            $this->taskFilesystemStack()
                ->mkdir("{$install_path}/profiles/custom", 0775, true)
                ->mkdir("{$install_path}/modules/custom", 0775, true)
                ->mkdir("{$install_path}/modules/contrib", 0775, true)
                ->run();
        }

        return $this;
    }
145855
protected function set_defaults()
	{
		parent::set_defaults();
		$this->headers = array();

		if ( ! empty($this->preserve_resource))
		{
			$this->resource = $this->preserve_resource;
			$this->preserve_resource = null;
		}

		return $this;
	}
276116
public function registerAnnotationsPathWithRegistry($path)
    {
        foreach (Finder::create()->files()->in($path) as $file) {
            AnnotationRegistry::registerFile($file->getRealPath());
        }

        return $this;
    }
559514
protected function getUserDefinedGlobals()
    {
        if (file_exists(realpath(__DIR__.'/../../../../config/twig.php'))) {
            $this->config = require realpath(__DIR__.'/../../../../config/twig.php');
        } elseif (file_exists(realpath(__DIR__.'/../config/twig.php'))) {
            $this->config = require realpath(__DIR__.'/../config/twig.php');
        }

        return isset($this->config['twig_global']) ? $this->config['twig_global'] : [];
    }
259861
public function setFiles()
    {
        $this->files = [];
        $path = $this->getValue();

        if (!preg_match('#^/#', $path)) {
            $path = $this->parser->getServer()->getPrefix().'/'.$path;
        }

        $iterator = new GlobIterator($path);
        foreach ($iterator as $path) {
            $this->files[] = $path;
        }

        return $this;
    }
174223
protected function initDefaults()
    {
        if (!$this->hasDefaults) {
            return '';
        }

        $this->defaultsLocation = get_calling_class_directory($this) . DIRECTORY_SEPARATOR . $this->defaultsLocation;

        return ConfigFactory::loadConfigFile($this->defaultsLocation);
    }
779011
public function registerDefaults()
    {
        $requestSubscriber = new RequestSubscriber();
        $this->addSubscriber($requestSubscriber);

        $userAgentHeaderPlugin = new UserAgentHeaderPlugin();
        $this->addSubscriber($userAgentHeaderPlugin);

        return $this;
    }
501218
def register_plugin_dir(path):
    """"""
    import glob
    for f in glob.glob(path + '/*.py'):
        for k, v in load_plugins_from_module(f).items():
            if k:
                global_registry[k] = v
1153183
def default_static_path():
    
    fdir = os.path.dirname(__file__)
    return os.path.abspath(os.path.join(fdir, '../assets/'))
1301161
public function setPaths() : ApplicationInterface
    {
        $this->container->set('app', $this);
        $paths = $this->bootstrappers->getBootstrapper()->getPaths();

        foreach ($paths->all() as $key => $path) {
            $this->container->set($key, $path);
        }

        return $this;
    }
1271720
public static function globAll(array $paths)
    {
        $result = [];

        foreach ($paths as $path) {
            $result = array_merge($result, static::glob($path));
        }

        return $result;
    }