/**
  * Get the absolute path for a file
  * @param File $file
  * @return string
  */
 public function getAbsolutePath(File $file)
 {
     $path = $file->getPath();
     $phar = $file->isInPhar();
     if ($phar) {
         $pharFile = new File(substr($path, strlen($phar->getPath()) + 7));
         $path = $phar->getPath() . File::DIRECTORY_SEPARATOR . $pharFile->getPath();
     }
     $hasPharProtocol = $file->hasPharProtocol($path);
     if ($hasPharProtocol) {
         $path = substr($path, 7);
     }
     if (!$this->isAbsolute($file)) {
         $path = getcwd() . File::DIRECTORY_SEPARATOR . $path;
     }
     $parts = explode(File::DIRECTORY_SEPARATOR, $path);
     $absolutePath = array();
     foreach ($parts as $part) {
         if ($part == '' || $part == '.') {
             continue;
         }
         if ($part == '..') {
             array_pop($absolutePath);
             continue;
         }
         array_push($absolutePath, $part);
     }
     $absolutePath = File::DIRECTORY_SEPARATOR . implode(File::DIRECTORY_SEPARATOR, $absolutePath);
     if ($phar || $hasPharProtocol) {
         $file = new File($absolutePath);
         $absolutePath = $file->getPath();
         if ($hasPharProtocol && !$file->hasPharProtocol() && $file->isPhar()) {
             $absolutePath = 'phar://' . $absolutePath;
         }
     }
     return $absolutePath;
 }