本文整理汇总了PHP中JInstaller::set方法的典型用法代码示例。如果您正苦于以下问题:PHP JInstaller::set方法的具体用法?PHP JInstaller::set怎么用?PHP JInstaller::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JInstaller
的用法示例。
在下文中一共展示了JInstaller::set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: triggerManifestScript
/**
* Executes a custom install script method
*
* @param string $method The install method to execute
*
* @return boolean True on success
*
* @since 3.4
* @throws RuntimeException
*/
protected function triggerManifestScript($method)
{
ob_start();
ob_implicit_flush(false);
if ($this->parent->manifestClass && method_exists($this->parent->manifestClass, $method)) {
switch ($method) {
// The preflight and postflight take the route as a param
case 'preflight':
case 'postflight':
if ($this->parent->manifestClass->{$method}($this->route, $this) === false) {
if ($method != 'postflight') {
// Clean and close the output buffer
ob_end_clean();
// The script failed, rollback changes
throw new RuntimeException(JText::sprintf('JLIB_INSTALLER_ABORT_INSTALL_CUSTOM_INSTALL_FAILURE', JText::_('JLIB_INSTALLER_' . $this->route)));
}
}
break;
// The install, uninstall, and update methods only pass this object as a param
// The install, uninstall, and update methods only pass this object as a param
case 'install':
case 'uninstall':
case 'update':
if ($this->parent->manifestClass->{$method}($this) === false) {
if ($method != 'uninstall') {
// Clean and close the output buffer
ob_end_clean();
// The script failed, rollback changes
throw new RuntimeException(JText::sprintf('JLIB_INSTALLER_ABORT_INSTALL_CUSTOM_INSTALL_FAILURE', JText::_('JLIB_INSTALLER_' . $this->route)));
}
}
break;
}
}
// Append to the message object
$this->extensionMessage .= ob_get_clean();
// If in postflight or uninstall, set the message for display
if (($method == 'uninstall' || $method == 'postflight') && $this->extensionMessage != '') {
$this->parent->set('extension_message', $this->extensionMessage);
}
return true;
}
示例2: onExtensionAfterUpdate
public function onExtensionAfterUpdate($installer, $eid)
{
$lang = JFactory::getLanguage();
$lang->load('install_override', dirname(__FILE__), $lang->getTag(), true);
$this->toplevel_installer->set('extension_message', $this->getMessages());
}