/** * Update upload directory * @param qio\Directory|string $uploadDirectory * @throws qio\Exception */ function setUploadDirectory($uploadDirectory) { if (is_string($uploadDirectory)) { $uploadDirectory = new qio\Directory($uploadDirectory); } if (!$uploadDirectory->exists()) { throw new qio\Exception('Provided upload directory does not exist ("' . $uploadDirectory . '")'); } if (!$uploadDirectory->isWritable()) { throw new qio\Exception('Provided upload directory is not writable ("' . $uploadDirectory . '")'); } $this->uploadDirectory = $uploadDirectory; }
/** * Open up directory stream * @return boolean */ public function open() { $this->setPointer(opendir($this->directory->getPath())); return parent::open(); }