public function setPath($path) { parent::setPath($path); if (!file_exists($this->getPath())) { $filesystem = new Filesystem(); $filesystem->mkdir($this->getPath(), 0755, 00, true); } }
public function addStorage(AbstractStorage $storage) { #fwrite(STDOUT, 'add: '.$storage->getType().' '.get_class($storage)."\n"); if (!$this->defaultStorage) { $this->defaultStorage = $storage; $dbPath = $storage->getPath(); if (substr($dbPath, -1) == '/') { $dbPath = substr($dbPath, 0, -1); } $dbPath .= '.yml'; $storage->setDbPath($dbPath); $db = new MsgDb($dbPath); $db->load(); $storage->setDb($db); } else { $this->storages[] = $storage; } #\Doctrine\Common\Util\Debug::dump($this->defaultStorage); #\Doctrine\Common\Util\Debug::dump($this->storages); }