static function Acron($onlycaches = array()) { $stdout = ""; $newcache = $updatedRecords = array(); // ---------------------- // -- Update current event data from Agenda // ---------------------- if (!class_exists("fromdb_nwevents", FALSE)) { require_once PATH_CLASSES . "/fromdb/nwevents.php"; } if (!isset($dbEv) || !is_object($dbEv)) { $dbEv = new fromdb_nwevents(); } $updatedRecords = $dbEv->updateCurrentEventsFromAgenda(); // ---------------------- // -- Recreate all caches // ---------------------- if (!class_exists("fromcache", FALSE)) { require_once PATH_CLASSES . "/lib/fromcache.php"; } $cachesCallback = fromcache::get_cache_callback(); foreach (array_reverse($cachesCallback) as $cachename => $callback) { $callback = str_replace("URL_PREFIX", URL_PREFIX, $callback); eval("\$c = functions::callMethod(" . $callback . ");"); if ($c) { $newcache[] = $cachename . "\r\n"; } } // ---------------------- // -- Output confirmation // ---------------------- $thecache = is_array($onlycaches) || !empty($onlycaches) ? $onlycaches : $newcache; $stdout .= "<div class='col-content-left' style='width:30%'>\r\n"; if (count($updatedRecords)) { $stdout .= "<h3>Updated data for events:</h3>" . " <ul>\r\n"; foreach ($updatedRecords as $confId) { $stdout .= " <li><a href='http://agenda.albanova.se/conferenceDisplay.py?confId=" . $confId . "'>" . $dbEv->getEventTitle($confId) . "</a></li>\r\n"; } $stdout .= " </ul>\r\n"; } $stdout .= "<h3>Recreated Caches:</h3>" . "<ul>\r\n"; foreach ($thecache as $c) { $stdout .= "<li>" . $c . "</li>\r\n"; } $stdout .= "</ul>\r\n" . "\r\n</div><div class='col-content-right' style='width:60%'>\r\n" . admin::AcacheFilesList() . "</div>\r\n"; return $stdout; }
$out = array(); foreach ($files as $file) { if (file_exists(INCLEVEL . $file)) { $out[] = "<strong class='green'>SUCCESS</strong> - The source file <strong style='margin:0 0.5em'>" . $file . "</strong> exists on the local server."; } else { $out[] = "<strong class='red'>ERROR</strong> - The soruce file <strong style='margin:0 0.5em'>" . $file . "</strong> does not exist on the local server."; } } print "<p>" . join("\r\n<br>", $out) . "</p>\r\n"; print "<div style='float:left;width:45%;padding:0 1em 0.5em 1.5em;margin:0 0 1.5em 0;border:1px solid black'>\r\n" . "<h4>On a local Mac</h4>\r\n" . "<ul>\r\n" . " <li><code>sudo cp ./_cron/<strong>createcache.sh</strong> /usr/local/bin/createcache.sh</code></li>\r\n" . " <li><code>sudo chmod 644 /usr/local/bin/createcache.sh</code></li>\r\n" . "</ul>\r\n" . "<ul>\r\n" . " <li><code>sudo bbedit /usr/local/bin/createcache.sh</code></li>\r\n" . "</ul>\r\n" . "<ul>\r\n" . " <li><code>sudo cp ./_cron/<strong>org.nordita.createcache.plist</strong> /Users/hvzm/Library/LaunchAgents/org.nordita.createcache.plist</code></li>\r\n" . " <li><code>sudo chmod 644 /Users/hvzm/Library/LaunchAgents/org.nordita.createcache.plist</code></li>\r\n" . "</ul>\r\n" . "<ul>\r\n" . " <li><code>sudo bbedit /Users/hvzm/Library/LaunchAgents/org.nordita.createcache.plist</code></li>\r\n" . "</ul>\r\n" . "<ul>\r\n" . "<li><code><strong>launchctl load</strong> /Users/hvzm/Library/LaunchAgents/org.nordita.createcache.plist</code></li>\r\n" . " <li><code>launchctl list | grep ordita</code></li>\r\n" . "</ul>\r\n" . "</div>\r\n"; print "<div style='float:left;width:45%;padding:0 1em 0.5em 1.5em;margin:0 0 1.5em 2em;border:1px solid black'>\r\n" . "<h4>On a server running Scientific Linux</h4>\r\n" . "<p>TBA...</p>\r\n" . "</div>\r\n" . "<div style='clear:both'></div>\r\n"; // ------------------------------------------ print "<hr>\r\n"; print "<div style='float:left;padding:0 1em 0.5em 1.5em;margin:0 0 1.5em 0'>\r\n" . "<p style='font-weight:bold;font-size:2em; margin-top:0'>» <a href='" . URL_PREFIX . "/_cron/index.php'>RUN CRON MANUALLY</a></p>\r\n" . "</div>\r\n"; require_once PATH_CLASSES . "/lib/admin.php"; print "<div style='float:left;padding:0 1em 0.5em 2.5em;margin:0 0 1.5em 5em;border-left:1px solid black'>\r\n" . admin::AcacheFilesList('0') . "</div>\r\n"; print "<div style='clear:both'></div>\r\n"; /* SEEMS TO BE TOO MANY THINGS MISSING TO RUN CACHE UPDATE FROM HERE print "<hr>\r\n" . "<p style='font-weight:bold;font-size:2em; margin-top:0'>» <a href='" . $_SERVER["PHP_SELF"] . "?doit=1'>RUN CRON MANUALLY</a></p>\r\n"; if (isset($_REQUEST["doit"])) { if (!class_exists("admin",FALSE)) { require_once PATH_CLASSES . "/document.php"; require_once PATH_CLASSES . "/lib/functions.php"; require_once PATH_CLASSES . "/lib/fromcache.php"; require_once PATH_CLASSES . "/lib/admin.php"; $GLOBALS["documentClass"] = new document(); print "<style>.col-content-left,.col-content-right{display:block;position:relative;float:left;padding:0 1em 1em 1em;border:1px solid black;margin: -1em 0 1em 2em;}.col-content-left{clear: both;width: 45%;}.col-content-right{width: 45%;}</style>\r\n" . //"<div style='width:auto;padding:0 1em 1em 1em;margin:-1em 0 1em 2em;border:1px solid black'>\r\n" . admin::Acron() . //"</div>" .