當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Factory::getDumpEngine方法代碼示例

本文整理匯總了PHP中Akeeba\Engine\Factory::getDumpEngine方法的典型用法代碼示例。如果您正苦於以下問題:PHP Factory::getDumpEngine方法的具體用法?PHP Factory::getDumpEngine怎麽用?PHP Factory::getDumpEngine使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Akeeba\Engine\Factory的用法示例。


在下文中一共展示了Factory::getDumpEngine方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _run

 /**
  * Implements the _run() abstract method
  *
  * @return  void
  */
 protected function _run()
 {
     if ($this->getState() == 'postrun') {
         Factory::getLog()->log(LogLevel::DEBUG, __CLASS__ . " :: Already finished");
         $this->setStep('');
         $this->setSubstep('');
     } else {
         $this->setState('running');
     }
     // Make sure we have a dumper instance loaded!
     if (is_null($this->dump_engine) && !empty($this->database_list)) {
         Factory::getLog()->log(LogLevel::DEBUG, __CLASS__ . " :: Iterating next database");
         // Create a new instance
         $this->dump_engine = Factory::getDumpEngine(true);
         // Configure the dumper instance and pass on the volatile database root registry key
         $registry = Factory::getConfiguration();
         $rootkeys = array_keys($this->database_list);
         $root = array_shift($rootkeys);
         $registry->set('volatile.database.root', $root);
         $this->database_config = array_shift($this->database_list);
         $this->database_config['root'] = $root;
         $this->database_config['process_empty_prefix'] = $root == '[SITEDB]' ? true : false;
         Factory::getLog()->log(LogLevel::DEBUG, __CLASS__ . " :: Now backing up {$root} ({$this->database_config['database']})");
         $this->dump_engine->setup($this->database_config);
         // Error propagation
         $this->propagateFromObject($this->dump_engine);
         if ($this->getError()) {
             return;
         }
     } elseif (is_null($this->dump_engine) && empty($this->database_list)) {
         $this->setError('Current dump engine died while resuming the step');
         return;
     }
     // Try to step the instance
     $retArray = $this->dump_engine->tick();
     // Error propagation
     $this->propagateFromObject($this->dump_engine);
     if ($this->getError()) {
         return;
     }
     $this->setStep($retArray['Step']);
     $this->setSubstep($retArray['Substep']);
     // Check if the instance has finished
     if (!$retArray['HasRun']) {
         // Set the number of parts
         $this->database_config['parts'] = $this->dump_engine->partNumber + 1;
         // Push the definition
         array_push($this->dumpedDatabases, $this->database_config);
         // Go to the next entry in the list and dispose the old AkeebaDumperDefault instance
         $this->dump_engine = null;
         // Are we past the end of the list?
         if (empty($this->database_list)) {
             Factory::getLog()->log(LogLevel::DEBUG, __CLASS__ . " :: No more databases left to iterate");
             $this->setState('postrun');
         }
     }
 }
開發者ID:AlexanderKri,項目名稱:joom-upd,代碼行數:62,代碼來源:Db.php


注:本文中的Akeeba\Engine\Factory::getDumpEngine方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。