当前位置: 首页>>代码示例>>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;未经允许,请勿转载。