Esempio n. 1
0
if (!$installed) {
    if (CMS_patch::executeSqlScript(PATH_MAIN_FS . '/sql/updates/mod_object_oembed_definition.sql', true)) {
        CMS_patch::executeSqlScript(PATH_MAIN_FS . '/sql/updates/mod_object_oembed_definition.sql', false);
        $content .= 'Database successfuly updated (add Oembed definitions table)<br/>';
    } else {
        $content .= 'Error during database update ! Script ' . PATH_MAIN_FS . '/sql/updates/mod_object_oembed_definition.sql must be executed manualy<br/>';
    }
}
// END UPDATE FROM 4.2.1 TO 4.2.2
//Update Automne messages
$files = glob(PATH_MAIN_FS . "/sql/messages/*/*.sql", GLOB_NOSORT);
if (is_array($files)) {
    $content .= "Start update of Automne messages ...<br />";
    foreach ($files as $file) {
        if (file_exists($file) && CMS_patch::executeSqlScript($file, true)) {
            CMS_patch::executeSqlScript($file);
        } else {
            $content .= 'Error during database update ! Script ' . $file . ' must be executed manualy<br/>';
        }
    }
    $content .= "Automne messages updated.<br /><br />";
}
//clear caches
$content .= "Clean Automne cache.<br /><br />";
CMS_cache::clearTypeCache('polymod');
CMS_cache::clearTypeCache('atm-polymod-structure');
CMS_cache::clearTypeCache('text/javascript');
CMS_cache::clearTypeCache('text/css');
CMS_cache::clearTypeCache('atm-backtrace');
//compile polymod definitions
CMS_polymod::compileDefinitions();