OnUpgrade() public static method

Updates plugins if needed
public static OnUpgrade ( ) : void
return void
示例#1
0
CampCache::singleton()->clear('user');
CampCache::singleton()->clear();
SystemPref::DeleteSystemPrefsFromCache();
// replace $campsite by $gimme
require_once $g_documentRoot . '/classes/TemplateConverterNewscoop.php';
$template_files = camp_read_files($g_documentRoot . '/templates');
$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);
}