예제 #1
0
파일: Dump.php 프로젝트: podlom/nasgrate
 protected function _getDb()
 {
     if (null === $this->_dbConnection) {
         $this->_dbConnection = Db::getInstance()->getPrimaryConnection();
     }
     return $this->_dbConnection;
 }
예제 #2
0
파일: Base.php 프로젝트: podlom/nasgrate
 protected function _getDb()
 {
     return Db::getInstance()->getPrimaryConnection();
 }
예제 #3
0
파일: Console.php 프로젝트: podlom/nasgrate
 private function _commandDiff()
 {
     $generator = $this->_getGenerator()->setFirstDataSource($this->_getDumper()->getState());
     switch (VERSION_CONTROL_STRATEGY) {
         case "file":
             $generator->setSecondDataSource($this->_getLastSavedState());
             break;
         case "database":
             $secondaryDumper = clone $this->_getDumper();
             $secondaryDumper->setConnection(\Util\Db::getInstance()->getSecondaryConnection());
             $generator->setSecondDataSource($secondaryDumper->getState());
             break;
         default:
             throw new \Exception('Wrong version control strategy. Check .environment file VERSION_CONTROL_STRATEGY parameter');
     }
     return $generator->getDiff();
 }