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