Exemplo n.º 1
0
 /**
  * Creates a new path information instance from a given URL
  *
  * @param   string      $url        The URL
  * @param   string      $protocol   The protocol registered
  * @param   Binary      $binary     The Git binary
  */
 public function __construct($url, $protocol, Binary $binary)
 {
     $url = self::parseUrl($url, $protocol);
     $this->fullPath = $url['path'];
     $this->repository = Repository::open($this->fullPath, $binary, false);
     $this->localPath = $this->repository->resolveLocalPath($this->fullPath);
     $this->ref = array_key_exists('fragment', $url) ? $url['fragment'] : 'HEAD';
     $arguments = array();
     if (array_key_exists('query', $url)) {
         parse_str($url['query'], $arguments);
     }
     $this->arguments = $arguments;
     $this->url = $protocol . '://' . $this->fullPath . '#' . $this->ref . '?' . http_build_query($this->arguments);
 }