/**
  * 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;
 }
Esempio n. 2
0
 /**
  * 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;
 }
Esempio n. 3
0
 /**
  * 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;
 }