registerPaths

@param bool $refresh

@return static
@throws \ReflectionException
426833
public function registerPaths($refresh = false)
    {
        if (!$this->pathRegistered || $refresh) {
            $this->renderer->setPaths(new PriorityQueue());

            $package = $this->getPackage();

            if (!$package instanceof NullPackage) {
                $locale  = $package->app->get('language.locale', 'en-GB');
                $default = $package->app->get('language.default', 'en-GB');

                $selfPath = dirname(ReflectionHelper::getPath(static::class));

                $this->renderer->addPath($selfPath . '/templates/' . $locale, PriorityQueue::BELOW_NORMAL);

                if ($default !== $locale) {
                    $this->renderer->addPath($selfPath . '/templates/' . $default, PriorityQueue::BELOW_NORMAL);
                }

                $this->renderer->addPath($selfPath . '/templates', PriorityQueue::BELOW_NORMAL);

                if ($this->name) {
                    $globalPath = $this->getPackage()->app->get('path.templates');

                    $this->renderer->addPath(
                        $globalPath . '/' . $this->getName() . '/' . $locale,
                        PriorityQueue::BELOW_NORMAL
                    );

                    if ($default !== $locale) {
                        $this->renderer->addPath(
                            $globalPath . '/' . $this->getName() . '/' . $default,
                            PriorityQueue::BELOW_NORMAL
                        );
                    }

                    $this->renderer->addPath($globalPath . '/' . $this->getName(), PriorityQueue::BELOW_NORMAL);
                }
            }
        }

        return $this;
    }
69763
public function getFileCollection($prefix = 'fs', $refresh = false)
    {
        if ($refresh || !array_key_exists($prefix, $this->_fileCollections)) {
            $this->_fileCollections[$prefix] = $this->selectFileCollection($prefix);
        }

        return $this->_fileCollections[$prefix];
    }
1243265
public function Refresh() {
      $LocalName = $this->Current();
      
      $ApplicationWhiteList = Gdn::ApplicationManager()->EnabledApplicationFolders();
      $PluginWhiteList = Gdn::PluginManager()->EnabledPluginFolders();

      $ForceRemapping = TRUE;

      $this->Set($LocalName, $ApplicationWhiteList, $PluginWhiteList, $ForceRemapping);
   }
157550
public static function loadWords($refresh = false)
    {
        $key = __METHOD__;
        if (YII_DEBUG || static::$words === null || $refresh || Yii::$app->cache === null || ((static::$words = Yii::$app->cache->get($key)) === false)) {
            $words = Banword::find()->select('word')->asArray()->all();
            static::$words = [];
            foreach ($words as $w) {
                static::$words[] = $w['word'];
            }
            if (Yii::$app->cache !== null) {
                Yii::$app->cache->set($key, static::$words, 0, new TagDependency (['tags' => self::CACHE_TAG]));
            }
        }
    }
393000
protected function registerPathMappings($factory)
    {
        $assetPath = $this->app->__invoke(PathFinder::class)->to('assets');

        $factory->map('css', $assetPath->absolute('css'), $assetPath->url('css'));
        $factory->map('js', $assetPath->absolute('js'), $assetPath->url('js'));
    }
1127817
public function redirect($url, $permanent = false, $refresh = false)
	{
		if(strpos($url, '://') === false)
		{
			$host = APP_HOST;
			if( strlen($url) && $url[0] !== "/" )
			{
				$host .= "/";
			}

			$url = BASE_PROTOCOL . '://' . $host . $url;
		}

		EventManager::dispatch(new ResponseRedirectEvent($this, $url, $permanent, $refresh));

		if( headers_sent() )
		{
			$body  = '<html><head>';
			$body .= '<meta http-equiv="refresh" content="1; url=' . $url . '" />';
			$body .= '<title>Redirecting</title>';
			$body .= '</head><body onload="location.replace(\'' . str_replace( "'", "\\'", $url );
			$body .= '\' + document.location.hash)">Redirecting you to ' . $url . '</body></html>';
			$this->setBody($body);
		}
		else
		{
			$this->setCode($permanent ? 301 : 302);
			if( $refresh )
			{
				$this->header("Refresh", "0; URL=" . $url);
			}
			else
			{
				$this->header('Location', $url);
			}
		}

		$this->lock();

		return $this;
	}
622429
private function registerFilesystem()
    {
        $this->singleton(Contracts\Utilities\Filesystem::class, function ($app) {
            /**
             * @var  \Illuminate\Config\Repository      $config
             * @var  \Illuminate\Filesystem\Filesystem  $files
             */
            $config     = $app['config'];
            $files      = $app['files'];
            $filesystem = new Utilities\Filesystem($files, $config->get('log-viewer.storage-path'));

            $pattern = $config->get('log-viewer.pattern', []);

            $filesystem->setPattern(
                Arr::get($pattern, 'prefix',    Utilities\Filesystem::PATTERN_PREFIX),
                Arr::get($pattern, 'date',      Utilities\Filesystem::PATTERN_DATE),
                Arr::get($pattern, 'extension', Utilities\Filesystem::PATTERN_EXTENSION)
            );

            return $filesystem;
        });
    }
1266084
public function register($class, $transforms)
    {
        if (!is_array($transforms)) {
            $transforms = array($transforms);
        }
        foreach ($transforms as $t) {
            if (!($t instanceof TransformationInterface)) {
                throw new \InvalidArgumentException("Only instances of TransformationInterface can be registered");
            }
        }

        if (!isset($this->transforms[$class])) {
            $this->classes[] = $class;
            $this->transforms[$class] = array();
        }

        foreach ($transforms as $t) {
            $this->transforms[$class][] = $t;
        }
    }
806175
public function registerUrl($url, $flush = false)
    {
        if ($flush) {
            $this->urls = [];
        }

        if (is_array($url)) {
            $this->log->debug('Registered urls', $url);
            $this->urls = array_merge($this->urls, $url);
        } else {
            $this->log->debug("Registered url -> $url");
            $this->urls[] = $url;
        }
    }
1226618
public function hasRequiredSettings(bool $refresh = false): bool
    {
        $required = $this->getParsedRequiredProperties($refresh);

        if (!$this->allRequired && (empty($required) || $required === null)) {
            return true;
        }

        return $this->validateProperties($required);
    }
617832
public function setRefreshToken($refreshToken)
    {
        if (in_array('refresh_token', $this->persistantMap)) {
            $this->store->set('refresh_token', $refreshToken);
        }

        $this->refreshToken = $refreshToken;
        return $this;
    }
790330
public function getEngine($refresh = false)
    {
        if (empty($this->detection['engine']) || $refresh) {
            $this->detectEngine($this->userAgent);
        }

        return $this->engine;
    }
1122618
public function refresh($forceForever = false, $resetClaims = false)
    {
        $this->requireToken();

        return $this->manager->customClaims($this->getCustomClaims())
                             ->refresh($this->token, $forceForever, $resetClaims)
                             ->get();
    }
65597
public function register($restore = true, $type = E_ALL | E_STRICT, $shutdown = false)
    {
        if ($type === null) {
            $type = E_ALL | E_STRICT;
        }

        if ($restore) {
            $this->restore();
        }

        set_error_handler([$this, 'error'], $type);
        set_exception_handler([$this, 'exception']);

        if ($shutdown) {
            register_shutdown_function([$this, 'down']);
        }
    }
538113
public function getSelector(bool $refresh = false): string
    {
        if (!isset($this->selector) || $refresh) {
            $this->generateSelector();
        }

        return $this->selector;
    }
1361304
protected function fetchSearchRegistry( $requireFresh = false )
    {
        $location = $this->properties['location'];
        if ( !is_array( $this->searchRegistry ) )
        {
            $this->searchRegistry = array();
        }
        if ( !isset( $this->searchRegistry[$location] )
             || !is_array( $this->searchRegistry[$location] ) )
        {
            $this->searchRegistry[$location] = array();
        }

        // Makes sure the registry exists
        if ( empty( $this->searchRegistry[$location] )
             || $requireFresh === true )
        {
            $this->searchRegistry[$location] = $this->backend->fetch( $this->registryName . '_' . urlencode( $location ) );
        }
    }
23281
public function load($refresh = false, array $options = array())
    {
        if ($refresh || $this->_contents === null) {
            $this->_contents = @file_get_contents($this->_path);

            if ($this->_contents === false) {
                throw LoadException::create($this->_path);
            }

            $this->setContents($this->decode($options));
        }

        return $this;
    }