当前位置: 首页>>代码示例>>PHP>>正文


PHP Editor::addCopyResolver方法代码示例

本文整理汇总了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();
	}
开发者ID:nevkontakte,项目名称:MODX-Lib,代码行数:66,代码来源:mod_parser.php


注:本文中的Editor::addCopyResolver方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。