本文整理匯總了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;
}