OnAfterUpgrade() public static method

Updates plugins environment if needed
public static OnAfterUpgrade ( ) : void
return void
示例#1
0
$converter = new TemplateConverterNewscoop();
if (!empty($template_files)) {
    foreach ($template_files as $template_file) {
        $converter->read($template_file);
        $converter->parse();
        $converter->write();
    }
}
// update plugins
CampPlugin::OnUpgrade();
CampRequest::SetVar('step', 'finish');
$install = new CampInstallation();
$install->initSession();
$step = $install->execute();
// update plugins environment
CampPlugin::OnAfterUpgrade();
CampTemplate::singleton()->clearCache();
// replace javascript by js in .htaccess file
$htaccesspath = $g_documentRoot . '/.htaccess';
if (upgrade_htaccess($htaccesspath) == false) {
    display_upgrade_error('Could not write .htaccess file.<br />Please read the ' . 'UPGRADE.txt file in this same directory to see what changes need to ' . 'be apply for this specific version of Newscoop.', FALSE);
}
if (file_exists($upgrade_trigger_path)) {
    @unlink($upgrade_trigger_path);
}
function display_upgrade_error($p_errorMessage, $exit = TRUE)
{
    if (defined('APPLICATION_ENV') && APPLICATION_ENV == 'development') {
        var_dump($p_errorMessage);
        if ($exit) {
            exit(1);