Esempio n. 1
0
<?php

// If this is not from command line, exit.
if (!empty($_SERVER['HTTP_HOST'])) {
    exit;
}
require_once 'inc/config.php';
require_once 'inc/memcaching.php';
$m = new Memcaching();
echo "\n";
print_r($m->getExtendedStats());
echo "\n";
Esempio n. 2
0
    if (defined('THROTTLE_LOGGING') && THROTTLE_LOGGING) {
        //Are we behind a proxy and given the IP via an alternate enviroment variable? If so, use it.
        if (!empty($_SERVER["HTTP_X_FORWARDED_FOR"])) {
            $ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
        } else {
            $ip = $_SERVER["REMOTE_ADDR"];
        }
        error_log('AUS2 THROTTLE: ' . $ip . ' ' . $_SERVER['REQUEST_URI']);
    }
    $xml->printXml();
    exit;
}
// Find everything between our CWD and 255 in QUERY_STRING.
$rawPath = substr(urldecode($_SERVER['QUERY_STRING']), 5, 255);
// Connect to memcache and try to pull output.
$memcache = new Memcaching();
$_cached_xml = $memcache->get($rawPath);
if ($_cached_xml) {
    $xml = $_cached_xml;
} else {
    // Munge he resulting string and store it in $path.
    $path = explode('/', $rawPath);
    // Determine incoming request and clean inputs.
    // These are common URI elements, agreed upon in revision 0.
    // For successive versions, the path of least resistence is to append and not reorder.
    $clean = array();
    $clean['updateVersion'] = isset($path[0]) ? intval($path[0]) : null;
    $clean['product'] = isset($path[1]) ? trim($path[1]) : null;
    $clean['version'] = isset($path[2]) ? urlencode($path[2]) : null;
    $clean['build'] = isset($path[3]) ? trim($path[3]) : null;
    $clean['platform'] = isset($path[4]) ? trim($path[4]) : null;
Esempio n. 3
0
<?php

// If this is not from command line, exit.
if (!empty($_SERVER['HTTP_HOST'])) {
    exit;
}
require_once 'inc/config.php';
require_once 'inc/memcaching.php';
$m = new Memcaching();
$m->flush();
echo "Flushing memcache entries... \n";
echo "Updated stats:  \n\n";
print_r($m->getExtendedStats());
echo "\n";