示例#1
0
/**
 * dlm_create_log function.
 *
 * @access public
 *
 * @deprecated 1.6.0
 *
 * @param string $type (default: '')
 * @param string $status (default: '')
 * @param string $message (default: '')
 * @param mixed $download
 * @param mixed $version
 *
 * @return void
 */
function dlm_create_log($type = '', $status = '', $message = '', $download, $version)
{
    // Deprecated notice
    _deprecated_function(__FUNCTION__, '1.6.0', 'DLM_Logging->create_log()');
    // Logging object
    $logging = new DLM_Logging();
    // Check if logging is enabled
    if ($logging->is_logging_enabled()) {
        // Create log
        $logging->create_log($type, $status, $message, $download, $version);
    }
}
 /**
  * Create a log if logging is enabled
  *
  * @param string $type
  * @param string $status
  * @param string $message
  * @param DLM_Download $download
  * @param DLM_Download_Version $version
  */
 private function log($type = '', $status = '', $message = '', $download, $version)
 {
     // Logging object
     $logging = new DLM_Logging();
     // Check if logging is enabled and if unique ips is enabled
     if ($logging->is_logging_enabled() && false === DLM_Cookie_Manager::exists($download)) {
         // set create_log to true
         $create_log = true;
         // check if requester downloaded this version before
         if ($logging->is_count_unique_ips_only() && true === $logging->has_ip_downloaded_version($version)) {
             $create_log = false;
         }
         // check if we need to create the log
         if ($create_log) {
             // Create log
             $logging->create_log($type, $status, $message, $download, $version);
         }
     }
 }
 /**
  * Create a log if logging is enabled
  *
  * @param string $type
  * @param string $status
  * @param string $message
  * @param DLM_Download $download
  * @param DLM_Download_Version $version
  */
 private function log($type = '', $status = '', $message = '', $download, $version)
 {
     // Logging object
     $logging = new DLM_Logging();
     // Check if logging is enabled and if unique ips is enabled
     if ($logging->is_logging_enabled()) {
         // set create_log to true
         $create_log = true;
         // check if requester downloaded this version before
         if ('1' == get_option('dlm_count_unique_ips', '0') && true === $this->has_ip_downloaded_version($version)) {
             $create_log = false;
         }
         // check if we need to create the log
         if ($create_log) {
             // Create log
             $logging->create_log($type, $status, $message, $download, $version);
         }
     }
 }