本文整理汇总了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');
}
}
}