/** * Process an array of update information * * @param array $data * @param RemoteSyncroNode $node */ public function processUpdateData($data, $node = null) { $updateTime = null; foreach ($data as $item) { $this->processUpdatedObject($item); if (isset($item->Title) && isset($item->ID)) { $this->log->logInfo("Sync'd {$item->ClassName} #{$item->ID} '" . $item->Title . "'"); } else { $this->log->logInfo("Sync'd {$item->ContentID}"); } if (isset($item->LastEditedUTC) || isset($item->UpdatedUTC)) { if ($item->LastEditedUTC || $item->UpdatedUTC) { $timeInt = strtotime($item->LastEditedUTC); if ($timeInt > $updateTime) { $updateTime = $timeInt; } $timeInt = strtotime($item->UpdatedUTC); if ($timeInt > $updateTime) { $updateTime = $timeInt; } } } } if ($updateTime && $node) { $node->LastSync = gmdate('Y-m-d H:i:s'); $node->write(); } }
/** * * 1- Obtener generos del WS * http://maxx.me.net-m.net/me/maxx/2146850/contentGroups?contentTypeKey=FULLTRACK * 2- por cada genero, obtener temas * http://maxx.me.net-m.net/me/maxx/2146850/items?start=-499&contentTypeKey=FULLTRACK&maxSize=500&contentGroupId=15649 * 3- por cada tema, asociar a album/artist * select * from bd * 4- si no tengo asociacion album/artista, obtener artista y album * http://maxx.me.net-m.net/me/maxx/2146850/items?contentTypeKey=FT_BUNDLE&icpn=0602527529042 * */ include_once "config.php"; include_once "includes.php"; $logFile = LOG_DIR . "/la-" . date("Ymd") . ".log"; $log = new klogger($logFile, TRUE); $dbc = new dbcAmazon(); $contractId = WS_CONTRACTID_LA; // LA $log->add("*** Started sync process, using contractId={$contractId} ***"); $tableName = "generos"; $log->add("cleaning up temporary db table {$tableName}..."); if (emptyTable($dbc, $tableName) === TRUE) { $log->add("success!"); } else { $log->add("fail!"); // enviar aviso cel $log->add("sending sms notification"); avisoCel("could not clean up temp db: {$tableName}"); } $tableName = "temas";
} class LogPost { public $time; public $post_type; public $nick; public $content; function __construct($strTime, $strType, $strNick, $strContent) { $this->time = $strTime; $this->nick = $strNick; $this->content = $strContent; $this->post_type = $strType; } } $klgEngine = new klogger($settings["host"], $settings["dbname"], $settings["username"], $settings["password"]); switch (filter_input(INPUT_POST, "funcName", FILTER_SANITIZE_FULL_SPECIAL_CHARS)) { case "Autocomplete_User_Name": $term = filter_input(INPUT_POST, "strTerm", FILTER_SANITIZE_FULL_SPECIAL_CHARS); $klgEngine->Autocomplete_User_Name($term); break; case "Get_Monthly_Digest": $intYear = filter_input(INPUT_POST, "year", FILTER_SANITIZE_NUMBER_INT); $intMonth = filter_input(INPUT_POST, "month", FILTER_SANITIZE_NUMBER_INT); $klgEngine->Get_Monthly_Digest($intYear, $intMonth); break; case "Get_Logs": $strDate = filter_input(INPUT_POST, "date", FILTER_SANITIZE_FULL_SPECIAL_CHARS); $klgEngine->Get_Logs($strDate); break; case "Get_User_Stats":