* @package  Mediboard
 * @author   SARL OpenXtrem <dev@openxtrem.com>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
CCanDo::checkAdmin();
CApp::setTimeLimit(0);
CApp::setMemoryLimit("1024M");
$dry_run = CValue::get("dry_run", false);
$table = CValue::get("table");
switch ($table) {
    case "access_log":
        CAccessLog::aggregate(10, 60, 1440, $dry_run);
        break;
    case "access_log_archive":
        CAccessLogArchive::aggregate(10, 60, 1440, $dry_run);
        break;
    case "datasource_log":
        CDataSourceLog::aggregate(10, 60, 1440, $dry_run);
        break;
    case "datasource_log_archive":
        CDataSourceLogArchive::aggregate(10, 60, 1440, $dry_run);
        break;
    default:
        CAccessLog::aggregate(10, 60, 1440, $dry_run);
        CAccessLogArchive::aggregate(10, 60, 1440, $dry_run);
        CDataSourceLog::aggregate(10, 60, 1440, $dry_run);
        CDataSourceLogArchive::aggregate(10, 60, 1440, $dry_run);
}
echo CAppUI::getMsg();
Пример #2
0
                 foreach ($graphs_by_module[$log->_module]["series"] as $_k1 => $_serie) {
                     if ($_serie["label"] == $_one_serie) {
                         foreach ($_serie["data"] as $_k2 => $_data) {
                             // We merge the associated data witch has different indexes according to the graph ($_k1 and $_k)
                             $graphs_by_module[$log->_module]["series"][$_k1]["data"][$_k2][1] += $_graph["series"][$_k]["data"][$_k2][1];
                         }
                     }
                 }
             }
             $graphs_by_module[$log->_module]["datetime_by_index"] += $_graph["datetime_by_index"];
         }
     }
     break;
 case 2:
     $_graph = CDataSourceLog::graphDataSourceLog(null, null, $from, $to, $interval, $human_bot);
     $_archive_graph = CDataSourceLogArchive::graphDataSourceLog(null, null, $from, $to, $interval, $human_bot);
     if (!isset($_graph["series"]) && !isset($_archive_graph["series"])) {
         continue;
     }
     $graphs_by_module["all"] = $_graph;
     $_series = CMbArray::pluck($_graph["series"], "label");
     $_archive_series = CMbArray::pluck($_archive_graph["series"], "label");
     foreach ($_archive_series as $_k => $_one_serie) {
         // If series doesn't exist, simply push it
         if (!in_array($_one_serie, $_series)) {
             $graphs_by_module["all"]["series"][] = $_archive_graph["series"][$_k];
         } else {
             foreach ($graphs_by_module["all"]["series"] as $_k1 => $_serie) {
                 if ($_serie["label"] == $_one_serie) {
                     foreach ($_serie["data"] as $_k2 => $_data) {
                         // We merge the associated data witch has different indexes according to the graph ($_k1 and $_k)