Example #1
0
    header_remove("Server");
    header_remove("X-Powered-By");
}
// Execute cron tab functions if they haven't been run in 24 hours
$last_check = $cms->getSetting("bigtree-internal-cron-last-run");
if ($last_check === false) {
    $admin->createSetting(array("id" => "bigtree-internal-cron-last-run", "system" => "on"));
}
// It's been more than 24 hours since we last ran cron.
if (time() - $last_check > 24 * 60 * 60) {
    // Update the setting.
    $admin->updateSettingValue("bigtree-internal-cron-last-run", time());
    // Email the daily digest
    $admin->emailDailyDigest();
    // Cache google analytics
    $ga = new BigTreeGoogleAnalyticsAPI();
    if ($ga->API && $ga->Profile) {
        // The Google Analytics wrappers can cause Exceptions and we don't want the page failing to load due to them.
        try {
            $ga->cacheInformation();
        } catch (Exception $e) {
            // We should log this in 4.1
        }
    }
}
// Normal page routing.
$ispage = false;
$inc = false;
$primary_route = $bigtree["path"][1];
$module_path = array_slice($bigtree["path"], 1);
// Check custom
Example #2
0
<?php

header("Content-type: text/json");
$analytics = new BigTreeGoogleAnalyticsAPI();
try {
    $analytics->cacheInformation();
    echo "true";
} catch (Exception $e) {
    echo "false";
}