本文整理匯總了PHP中JError::addWarning方法的典型用法代碼示例。如果您正苦於以下問題:PHP JError::addWarning方法的具體用法?PHP JError::addWarning怎麽用?PHP JError::addWarning使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JError
的用法示例。
在下文中一共展示了JError::addWarning方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: findManifest
/**
* Tries to find the package manifest file
*
* @return boolean True on success, False on error
*/
public function findManifest()
{
jimport('joomla.filesystem.folder');
// Get an array of all the XML files from the installation directory
$xmlfiles = JFolder::files($this->installer->getPath('source'), '.xml$', 1, true);
// If at least one XML file exists
if (!empty($xmlfiles)) {
foreach ($xmlfiles as $file) {
// Is it a valid Joomla installation manifest file?
$manifest = $this->isManifest($file);
if (!is_null($manifest)) {
// If the root method attribute is set to upgrade, allow file overwrite
if ((string) $manifest->attributes()->method == 'upgrade') {
if (method_exists($this->installer, 'setUpgrade')) {
$this->installer->setUpgrade(true);
}
$this->installer->setOverwrite(true);
}
// If the overwrite option is set, allow file overwriting
if ((string) $manifest->attributes()->overwrite == 'true') {
$this->installer->setOverwrite(true);
}
// Set the manifest object and path
$this->installer->manifest = $manifest;
$this->installer->setPath('manifest', $file);
// Set the installation source path to that of the manifest file
$this->installer->setPath('source', dirname($file));
return true;
}
}
// None of the XML files found were valid install files
JError::addWarning(JText::_('JLIB_INSTALLER_ERROR_NOTFINDJOOMLAXMLSETUPFILE'));
return false;
} else {
// No XML files were found in the install folder
JError::addWarning(JText::_('JLIB_INSTALLER_ERROR_NOTFINDXMLSETUPFILE'));
return false;
}
}