Register a new path for the given name and path
@param string $name
@param string $path
@param bool $absolute
@return \Exedra\Path
439457
public function register($name, $path, $absolute = false)
    {
        if($path instanceof \Exedra\Path)
            return $this->pathRegistry[$name] = $path;

        $path = $absolute ? $path : $this->basePath.'/'.ltrim($path, '/\\');

        $this->pathRegistry[$name] = new static($path);

        return $this->pathRegistry[$name];
    }
160116
public function file($path, $absolute = false)
    {
        return $this->get('files/' . trim($path, '/'), array(), $absolute, true);
    }
1048201
private function createDirectory($path = '', $name = '')
    {
        $directory = new ArrayObject();
        $directory['name'] = $name;
        $directory['real_path'] = $path;
        $directory['directories'] = [];
        $directory['files'] = [];

        return $directory;
    }
516620
public static function route( $name, $parameters = [], $absolute = true )
	{
		return static::__do( __FUNCTION__, args_with_keys( func_get_args(), __CLASS__, __FUNCTION__ ) );
	}
226693
public static function getRouteByName($name, $parameters = [], $absolute = true) {
		foreach ( self::$routes as $routePath => $routeDetails ) {
			if (self::checkRouteName ( $routeDetails, $name )) {
				if (\sizeof ( $parameters ) > 0)
					$routePath = self::_getURL ( $routePath, $parameters );
				if (! $absolute)
					return \ltrim ( $routePath, '/' );
				else
					return $routePath;
			}
		}
		return false;
	}
815004
public function package($name, $path = '/packages/%s.json')
	{
		$url = sprintf($this->getUrl() . $path, $name);
		$this->_response = new Response(['json' => $this->request($url)]);
		return $this;
	}
973415
public function route($name, $parameters = array(), $absolute = true, $route = null)
    {
        if($path = $this->getPathFinder()->toRouteName($name, $parameters)){
            if($absolute){
                return $this->to($path);
            }
            return $path;
        }

        return parent::route($name, $parameters, $absolute, $route);
    }
460380
public static function create($app, $name, $path)
    {
        $pathComponents = explode('/', $path);

        $config = static::loadAddonConfig($path, $name);

        return new static($app, $name, $path, $config);
    }
1350094
public function subtree($path, &$name, $create = false)
  {
    $parts = $this->split($path);

    $_name = array_shift($parts);
    if (!sizeof($parts)) {
      $name = $_name;
      $subtree = $this;
    } else {

      $exists = isset($this->_subTrees[$_name]);
      if (!$exists && !$create) {
        $subtree = null;
        $name = null;
      } else {
        if (!$exists && $create) {
          $this->_subTrees[$_name] = new self();
        }
        $subtree = $this->_subTrees[$_name]->subtree($parts, $name, $create);
      }

    }
    return $subtree;
  }
1357578
public function ext($name, $path)
    {
        if(null === $path)
        {
            $path = File::path(dirname(Imi::getNamespacePath(App::getNamespace())), 'ide-helper');
        }
        foreach($name as $extName)
        {
            echo 'Generating ', $extName, '...', PHP_EOL;
            $extensionReflection = new ExtensionReflection($extName);
            $extensionReflection->save(File::path($path, $extName));
        }
        echo 'Complete!', PHP_EOL;
    }
553177
public static function download($path = false, $extension = false, $name = false) {

        if($path && File::isFile($path)) {

            if(!$extension) {
                $extension = File::extension($path);
            }

            if(!$name) {
                $name = basename($path);
            }

            header('Content-Type: application/' . $extension);
            header("Content-Transfer-Encoding: Binary");
            header("Content-disposition: attachment; filename=" . $name);
            readfile($path);
            exit();
        }

        return false;
    }
1186920
public function createFile($attribute, $path, $name)
    {
        $handlerCreateFile = $this->fileOption($attribute, 'createFile');
        $file = $handlerCreateFile($path, $name);
        if ($file) {
            $storage = $this->fileStorage($attribute);
            $contents = file_get_contents($path);
            $handlerTemplatePath = $this->fileOption($attribute, 'templatePath');
            if ($storage->write($handlerTemplatePath($file), $contents)) {
                $this->setState($attribute, $file);
                $this->owner->{$attribute} = $file->id;
                return $file;
            }
        } // @codeCoverageIgnore
        return false; // @codeCoverageIgnore
    }
282836
public function register($name, $path)
    {
        if (!Str::contains($path, '.js')) {
            throw new \Exception('Path should lead to javascript file');
        }
        $this->modules->push(compact('name', 'path'));
    }
665974
public static function registerHandler($path, $handler, $name = null)
    {
        $routeInfo             = [
            $path,
            $handler
        ];
        static::$routes[$path] = $routeInfo;
        if (!empty($name)) {
            self::$namedRoutes[$name] = $routeInfo;
        }
    }
349727
public function embed($path, $name = null)
    {
        $name = $name ?: basename($path);
        $this->messageBuilder->addInlineImage("@{$path}", $name);

        return "cid:{$name}";
    }
164036
public function getFromPath($name = false, $path = false)
    {
        if ($path && $name) {
            $this->img       = $path . '/' . $name;
            $this->handle    = new Upload($this->img);
            $this->_new_name = $this->s3->sanitizeFilename(uniqid("", true) . $this->handle->file_src_name);
        }
    }
413383
public function resolve(
        AbsolutePathInterface $basePath,
        PathInterface $path
    ) {
        if ($path instanceof AbsolutePathInterface) {
            return $path;
        }
        if ($path instanceof RelativeWindowsPathInterface) {
            if ($path->isAnchored()) {
                return $path->joinDrive($basePath->drive());
            }
            if ($path->hasDrive() && !$path->matchesDrive($basePath->drive())) {
                return $path->toAbsolute();
            }
        }

        return $basePath->join($path);
    }