예제 #1
0
 /**
  * Construct a directory adapter. If the $path isn't a directory, and 
  * exception will be thrown.
  * 
  * @param string $path
  * @throws FinderException
  */
 public function __construct($path)
 {
     $fileInfo = new SplFileInfo($path);
     if (!$fileInfo->isDir()) {
         throw new FinderException("{$path} is not a directory.");
     }
     parent::__construct($fileInfo->getRealPath());
 }
예제 #2
0
 /**
  * Construct a phar data adapter. If the path isn't a file or if the path
  * isn't a file that phardata understands, an exception will be thrown.
  * 
  * @param string $path
  * @throws FinderException if $path is not a file
  * @throws UnexpectedValueException if $path isn't a phardata file.
  */
 public function __construct($path)
 {
     $fileInfo = new SplFileInfo($path);
     if (!$fileInfo->isFile()) {
         throw new FinderException("{$path} is not a file.");
     }
     parent::__construct(self::PHAR_PREFIX . $fileInfo->getRealPath());
 }