本文整理汇总了PHP中jApp::includePlugin方法的典型用法代码示例。如果您正苦于以下问题:PHP jApp::includePlugin方法的具体用法?PHP jApp::includePlugin怎么用?PHP jApp::includePlugin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jApp
的用法示例。
在下文中一共展示了jApp::includePlugin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: compile
/**
* compile the given class id.
* @param jSelectorDao $selector
*/
public function compile($selector)
{
$daoPath = $selector->getPath();
// load the XML file
$doc = new DOMDocument();
if (!$doc->load($daoPath)) {
throw new jException('jelix~daoxml.file.unknown', $daoPath);
}
if ($doc->documentElement->namespaceURI != JELIX_NAMESPACE_BASE . 'dao/1.0') {
throw new jException('jelix~daoxml.namespace.wrong', array($daoPath, $doc->namespaceURI));
}
$tools = jApp::loadPlugin($selector->driver, 'db', '.dbtools.php', $selector->driver . 'DbTools');
if (is_null($tools)) {
throw new jException('jelix~db.error.driver.notfound', $selector->driver);
}
$parser = new jDaoParser($selector);
$parser->parse(simplexml_import_dom($doc), $tools);
$class = $selector->dbType . 'DaoBuilder';
if (!jApp::includePlugin($selector->dbType, 'daobuilder', '.daobuilder.php', $class)) {
throw new jException('jelix~dao.error.builder.notfound', $selector->dbType);
}
$generator = new $class($selector, $tools, $parser);
// generation of PHP classes corresponding to the DAO definition
$compiled = '<?php ';
$compiled .= "\nif (jApp::config()->compilation['checkCacheFiletime']&&(\n";
$compiled .= "\n filemtime('" . $daoPath . '\') > ' . filemtime($daoPath);
$importedDao = $parser->getImportedDao();
if ($importedDao) {
foreach ($importedDao as $selimpdao) {
$path = $selimpdao->getPath();
$compiled .= "\n|| filemtime('" . $path . '\') > ' . filemtime($path);
}
}
$compiled .= ")){ return false;\n}\nelse {\n";
$compiled .= $generator->buildClasses() . "\n return true; }";
jFile::write($selector->getCompiledFilePath(), $compiled);
return true;
}