コード例 #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();
 }