Exemple #1
0
 private function _cleanLogs()
 {
     $config = Configuration::getMultiple(array('EBAY_LOGS_LAST_CLEANUP', 'EBAY_LOGS_DAYS', 'EBAY_API_LOGS', 'EBAY_ACTIVATE_LOGS'));
     if (isset($config['EBAY_LOGS_LAST_CLEANUP']) && $config['EBAY_LOGS_LAST_CLEANUP'] >= date('Y-m-d\\TH:i:s', strtotime('-1 day')) . '.000Z') {
         return;
     }
     $has_cleaned_logs = false;
     if (isset($config['EBAY_API_LOGS']) && $config['EBAY_API_LOGS']) {
         EbayApiLog::cleanOlderThan($config['EBAY_LOGS_DAYS']);
         $has_cleaned_logs = true;
     }
     if (isset($config['EBAY_ACTIVATE_LOGS']) && $config['EBAY_ACTIVATE_LOGS']) {
         EbayOrderLog::cleanOlderThan($config['EBAY_LOGS_DAYS']);
         $has_cleaned_logs = true;
     }
     if ($has_cleaned_logs) {
         Configuration::updateValue('EBAY_LOGS_LAST_CLEANUP', true, false, 0, 0);
     }
 }