Exemplo n.º 1
0
 /**
  * Stores the category in the filesystem
  *
  * @param $input
  * @return bool
  * @throws CategoryAlreadyExistsException
  */
 public function storeNewCategory($input)
 {
     if (isset($input['name']) && isset($input['category'])) {
         $localPath = $this->CategoryPaths->fromDot($input['category']);
         $serverPath = $this->CategoryPaths->serverPath($localPath);
         if ($this->Filesystem->isDirectory($serverPath . $input['name'])) {
             throw new CategoryAlreadyExistsException('This category already exists, cannot create ' . $input['name']);
         }
         return $this->Filesystem->makeDirectory($serverPath . $input['name'], 0775);
     }
     return false;
 }