コード例 #1
0
 /**
  * {@inheritDoc}
  */
 public function delete(Filesystem $remote, array $options = array())
 {
     if (!$remote instanceof File) {
         throw new \InvalidArgumentException(sprintf("Invalid filesystem given, expected instance of File got %s", get_class($remote)));
     }
     if (null === $this->manager->findFileByFile($remote)) {
         throw new DirectoryException(sprintf("Could not locate file %s", $remote->getRealpath()));
     }
     $this->wrapper->delete($remote->getRealpath());
     return true;
 }
コード例 #2
0
ファイル: FTP.php プロジェクト: sasquatch-mc/php-ftp-wrapper
 /**
  * {@inheritDoc}
  */
 public function fileExists(File $file)
 {
     try {
         return null !== $this->manager->findFileByFile($file);
     } catch (DirectoryException $e) {
         return false;
     }
 }