mageekguy\atoum\fs\path::resolve PHP Méthode

resolve() public méthode

public resolve ( )
    public function resolve()
    {
        if ($this->isAbsolute() === false) {
            $this->absolutize();
        }
        $components = array();
        foreach (explode('/', ltrim($this->components, '/')) as $component) {
            switch ($component) {
                case '.':
                    break;
                case '..':
                    if (sizeof($components) <= 0) {
                        throw new exception('Unable to resolve path \'' . $this . '\'');
                    }
                    array_pop($components);
                    break;
                default:
                    $components[] = $component;
            }
        }
        $this->components = '/' . join('/', $components);
        return $this;
    }

Usage Example

Exemple #1
0
 /**
  * @param Path $path
  *
  * @return mixed
  */
 protected function getSourceCode(Path $path)
 {
     return $this->adapter->file_get_contents((string) $path->resolve());
 }
All Usage Examples Of mageekguy\atoum\fs\path::resolve