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); }