Exemple #1
0
 /**
  * Constructor...
  *
  * @param \r8\FileSys\File $file The file being opened
  */
 public function __construct(\r8\FileSys\File $file)
 {
     $file->requirePath();
     if (!$file->isReadable()) {
         throw new \r8\Exception\FileSystem\Permissions($file->getPath(), "File is not readable");
     }
     parent::__construct($file->getPath());
 }
Exemple #2
0
 /**
  * Constructor...
  *
  * @param String $name The original name of the file on the client machine
  * @param Integer $code The error code associated with this file
  * @param \r8\FileSys\File $file $file The temporary file the upload was saved to
  */
 public function __construct($name, $code, \r8\FileSys\File $file)
 {
     $file->requirePath();
     $this->file = $file;
     $name = trim((string) $name);
     if (\r8\IsEmpty($name)) {
         throw new \r8\Exception\Argument(0, "File Name", "Must not be empty");
     }
     $this->name = $name;
     $this->code = max((int) $code, 0);
 }