/**
  * Returns the file contents of an archived file.
  *
  * @param PharFileInfo $file The archived file.
  *
  * @return string The contents of the file.
  */
 protected function getFileContents(PharFileInfo $file)
 {
     $reader = File::create($file->getPathname());
     $contents = '';
     do {
         $contents .= $reader->fgets();
     } while (!$reader->eof());
     return $contents;
 }
Exemplo n.º 2
0
 /**
  * Returns the contents of a file.
  *
  * @param string $path The path to the file.
  *
  * @return string The contents of the file.
  */
 private function getFileContents($path)
 {
     $contents = '';
     $file = File::create($path);
     do {
         $contents .= $file->fgets();
     } while (!$file->eof());
     return $contents;
 }