本文整理汇总了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;
}
}