Finds one directories with a given name/subpath

@param string  $name
@param boolean $reload
@param boolean $reversed
504539
public function findDir($name, $reload = false, $reversed = false)
	{
		return $this->find($name, $reload, $reversed, 'dir');
	}
235427
public function makeCacheKey($scope, $name, $reversed)
	{
		$cacheKey = $scope.'::'.$name;

		if ($reversed)
		{
			$cacheKey .= '::reversed';
		}

		return $cacheKey;
	}
965284
public function inPath($path = '', $reverse = false)
    {
        $dir = Folder::slashTerm($path);
        $current = Folder::slashTerm($this->pwd());

        if (!$reverse) {
            $return = preg_match('/^(.*)' . preg_quote($dir, '/') . '(.*)/', $current);
        } else {
            $return = preg_match('/^(.*)' . preg_quote($current, '/') . '(.*)/', $dir);
        }

        return (bool) $return;
    }
489933
public function find($name)
    {
        $name = $this->config->get("basset.aliases.assets.{$name}", $name);

        // Spin through an array of methods ordered by the priority of how an asset should be found.
        // Once we find a non-null path we'll return that path breaking from the loop.
        foreach (array('RemotelyHosted', 'PackageAsset', 'WorkingDirectory', 'PublicPath', 'AbsolutePath') as $method)
        {
            if ($path = $this->{'find'.$method}($name))
            {
                return $path;
            }
        }

        throw new AssetNotFoundException;
    }
1311003
public function load($name = '')
    {
        $load = BackupLoader::get($name);
        foreach ($load as $key => $return) {
            if (true === $return) {
                $this->info(sprintf('Your %s backup file loaded with successfully', $key));
            }
        }
    }
639393
public function runCallbacks($name, $recursive = true)
    {
        $instances = $recursive ? $this->parents(true) : [$this];
        if (strncmp($name, 'after', 5) === 0) {
            $instances = array_reverse($instances);
        }
        foreach ($instances as $instance) {
            foreach ($instance->_callbacks[$name] as $closure) {
                $this->_suite->runBlock($this, $closure, $name);
            }
        }
    }
657366
private function recursiveCall(string $name)
    {
        foreach ($this->options as $option) {
            $value = $option->{$name}();
            if ($value !== null) {
                return $value;
            }
        }

        return null;
    }
676556
protected function findRelativePathView($name)
    {
        $caller = Backtrace::getViewOrigin();
        return $this->findInPaths($name, [dirname($caller)]);
    }
622761
public static function Load($name, $force_raw_return = false)
  {
    $dir = phoxy::Config()['api_dir'];
    $names = explode('/', $name);

    $module = array_pop($names);
    $directory = $dir.'/'.implode('/', $names);

    return LoadModule($directory, $module, $force_raw_return);
  }
223713
public static function redirect($url, $rewrite = true) {
		if ($rewrite) {
			// TODO: I don't actually know why there is a try/catch around this?
			try {
				$url = \Skeleton\Core\Util::rewrite_reverse($url);
			} catch (\Exception $e) { }
		}

		header('Location: '.$url);
		echo 'Redirecting to : '.$url;
		exit;
	}
564570
public function find( $name )
    {
        $name = (string) $name;
        $path = $this->getSavePath();

        if ( ! is_file( $path . $name ) )
        {
            return null;
        }

        return $this->createStructure( array(
            'name' => $name,
            'code' => @ file_get_contents( $path . $name ),
        ) );
    }
1051048
public function findTemplate($name)
    {
        if ($this->files->exists($name)) {
            return $name;
        }

        $name = $this->normalizeName($name);

        if (isset($this->cache[$name])) {
            return $this->cache[$name];
        }

        try {
            $this->cache[$name] = $this->finder->find($name);
        } catch (InvalidArgumentException $ex) {
            throw new LoaderError($ex->getMessage());
        }

        return $this->cache[$name];
    }
341646
public function back($name)
    {
        $queue = $this->getInstance($name);
        return $queue->isEmpty() ? false : $queue->bottom();
    }
410450
static public function rmdir($dir, $recursive = false)
    {
        $dir = realpath($dir);
        if (!is_dir($dir)) return true;
        if (true !== $recursive) return @rmdir($dir);
        $dp = @opendir($dir);
        while ($file = @readdir($dp)) {
            if ('.' === $file || '..' === $file) continue;
            $cur_file = $dir . '/' . $file;
            if (is_dir($cur_file)) {
                self::rmdir($cur_file, true);
            } elseif (is_file($cur_file)) {
                @unlink($cur_file);
            }
        }
        @closedir($dp);
        return @rmdir($dir);
    }
913699
public function path($name, $folder = false)
    {

        // the current namespace prefix
        $prefix = $name;

        // work backwards through the namespace names of the fully-qualified
        // class name to find a mapped file name
        while (false !== $pos = strrpos($prefix, '\\')) {

            // retain the trailing namespace separator in the prefix
            $prefix = substr($name, 0, $pos + 1);

            // the rest is the relative class name
            $relative_class = substr($name, $pos + 1);

            // try to load a mapped file for the prefix and relative class
            $mapped_file = $this->loadMappedFile($prefix, $relative_class, $folder);
            if ($mapped_file) {
                return $mapped_file;
            }

            // remove the trailing namespace separator for the next iteration
            // of strrpos()
            $prefix = rtrim($prefix, '\\');
        }

        // never found a mapped file
        return false;
    }
1172649
public function find($name)
    {

        if (strpos($name, '::') !== false) {
            return $this->findNamedPathView($name);
        }
        return $this->findInPaths($name, $this->paths);
    }
210405
protected function destination(string $name, bool $recursively = false): Fluent
    {
        $filesystem = $this->getContainer()['files'];

        $publicPath = $this->basePath($this->getContainer()['path.public']);

        // Start chmod from public/packages directory, if the extension folder
        // is yet to be created, it would be created and own by the web server
        // (Apache or Nginx). If otherwise, we would then emulate chmod -Rf
        $publicPath = \rtrim($publicPath, '/').'/';
        $workingPath = $basePath = "{$publicPath}packages/";

        // If the extension directory exist, we should start chmod from the
        // folder instead.
        if ($filesystem->isDirectory($folder = "{$basePath}{$name}/")) {
            $recursively = true;
            $workingPath = $folder;
        }

        // Alternatively if vendor has been created before, we need to
        // change the permission on the vendor folder instead of
        // public/packages.
        if (! $recursively && Str::contains($name, '/')) {
            [$vendor, ] = \explode('/', $name);

            if ($filesystem->isDirectory($folder = "{$basePath}{$vendor}/")) {
                $workingPath = $folder;
            }
        }

        return new Fluent([
            'workingPath' => $workingPath,
            'basePath' => $basePath,
            'resursively' => $recursively,
        ]);
    }