本文整理汇总了PHP中Editor::addCopyResolver方法的典型用法代码示例。如果您正苦于以下问题:PHP Editor::addCopyResolver方法的具体用法?PHP Editor::addCopyResolver怎么用?PHP Editor::addCopyResolver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Editor
的用法示例。
在下文中一共展示了Editor::addCopyResolver方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: install_one
/**
* Install only this mod
*
* @param string $phpbb phpBB root
*/
public function install_one($phpbb)
{
// Don't let install mods to non-phpBB
if (!$this->test_phpbb($phpbb)) {
throw new NotPhpbb('phpBB not found');
}
$editor = new Editor($phpbb);
foreach ($this->copyresolvers as $test)
{
$editor->addCopyResolver($test);
}
try
{
// Perform copy action
foreach ($this->actions['copy'] as $file)
{
$editor->copy($file['from'], $file['to']);
}
// Perform delete action
foreach ($this->actions['delete'] as $file)
{
$editor->delete($file);
}
// Perform edits
foreach ($this->actions['edit'] as $file => $edits)
{
$editor->file_open($file);
foreach ($edits as $edit)
{
$this->do_edit($editor, $edit);
}
$editor->file_close();
}
// Perform sql queries
foreach ($this->actions['sql'] as $dbms => $queries)
{
foreach ($queries as $query)
{
$editor->sql($query, $dbms);
}
}
// Perform sql queries
if (!empty($this->actions['installer'])) {
$editor->installer($this->actions['installer']);
}
}
catch (EditorException $e)
{
throw new InstallFailed("Editor exception", 0, $e);
}
$editor->commit_changes();
}