/** * Relaunches all pages having the same spm. * Launches only pages, which are already launched. * * @param integer ID of the sitepage-master */ function relaunchPagesBySPM($spm) { global $c; ini_set("max_execution_time", $c["timeout"]); $launchArray = createDBCArray("sitepage", "SPID", "SPM_ID = $spm AND DELETED=0 AND CLNID IS NOT NULL AND CLNID<>0"); $variations = createDBCArray("variations", "VARIATION_ID", "DELETED=0"); includePGNSources(); for ($i = 0; $i < count($launchArray); $i++) { for ($j = 0; $j < count($variations); $j++) { if (SPVarExists($launchArray[$i], $variations[$j])) { if (isSPVarLive($launchArray[$i], $variations[$j])) { launchSitepage($launchArray[$i], 10, $variations[$j]); } } } } }
/** * rebuilds the complete cache of the whole website. * */ function rebuildCache() { global $c, $db; if ($c["renderstatichtml"]) { $maxtime = ini_get("max_execution_time"); ini_set("max_execution_time", $c["timeout"]); $sp_sql = "SELECT SPID FROM sitepage WHERE DELETED=0 AND VERSION=10"; $sp_query = new query($db, $sp_sql); $clist_id = 0; while ($sp_query->getrow()) { $my_spid = $sp_query->field("SPID"); $sv_sql = "SELECT VARIATION_ID FROM variations"; $sv_query = new query($db, $sv_sql); while ($sv_query->getrow()) { $my_variation = $sv_query->field("VARIATION_ID"); if (isCached($my_spid, $my_variation)) { if (SPVarExists($my_spid, $my_variation)) { renderSitePage($my_spid, $my_variation); } } } } ini_set("max_execution_time", $maxtime); } }