/** * Reads the sites from the data source * @return array */ protected function readSites() { $sites = array(); if (!$this->path->exists()) { return $sites; } $defaultRevision = $this->nodeModel->getDefaultRevision(); $siteDirectories = $this->path->read(); foreach ($siteDirectories as $siteDirectory) { if ($siteDirectory->isHidden() || !$siteDirectory->isDirectory()) { continue; } $site = $this->readSite($siteDirectory, $defaultRevision); $sites[$site->getId()] = $site; } return $sites; }
/** * Sets the permanent upload directory * @return null */ protected function setUploadDirectoryPermanent(File $directory) { if (!$directory->exists()) { $directory->create(); } elseif (!$directory->isDirectory()) { throw new FileSystemException('Could not set upload directory: ' . $directory . ' is not a directory'); } $this->uploadDirectoryPermanent = $directory; }
/** * Clears the cache of this node IO * @return null */ public function clearCache() { $this->nodes = null; if ($this->file->exists()) { $this->file->delete(); } if (isset($this->needsClear)) { unset($this->needsClear); } $this->needsWrite = true; }