]> git.mxchange.org Git - mailer.git/blobdiff - inc/classes/resolver.class.php
Renamed all SQL-related functions to camel-case notation
[mailer.git] / inc / classes / resolver.class.php
index 8f48213a18d830ebdc1b1a142d7485d6718a8b7b..aca38bb87560fc31304b019731204aa7a756dc91 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -66,13 +66,13 @@ class HostnameResolver {
                $ret = '0.0.0.0';
 
                // Search for hostname in cache
-               $result = SQL_QUERY_ESC("SELECT `ip` FROM `{?_MYSQL_PREFIX?}_dns_cache` WHERE `hostname`='%s' LIMIT 1",
+               $result = sqlQueryEscaped("SELECT `ip` FROM `{?_MYSQL_PREFIX?}_dns_cache` WHERE `hostname`='%s' LIMIT 1",
                        array($hostname), __METHOD__, __LINE__);
 
                // Does an entry exist?
-               if (SQL_NUMROWS($result) == 1) {
+               if (sqlNumRows($result) == 1) {
                        // Then load the hostname
-                       list($ip) = SQL_FETCHROW($result);
+                       list($ip) = sqlFetchRow($result);
 
                        // Count cache hit
                        incrementStatsEntry('dns_cache_hits');
@@ -93,7 +93,7 @@ class HostnameResolver {
                                // Seems to be an IP! Now check deeper...
                                if (($matches[0] == $ip) && ($matches[1] >= 0) && ($matches[1] <= 255) && ($matches[2] >= 0) && ($matches[2] <= 255) && ($matches[3] >= 0) && ($matches[3] <= 255) && ($matches[4] > 0) && ($matches[4] < 255)) {
                                        // We also cache IP addresses
-                                       SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_dns_cache` (`ip`, `hostname`, `added`) VALUES ('%s', '%s', NOW())",
+                                       sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_dns_cache` (`ip`, `hostname`, `added`) VALUES ('%s', '%s', NOW())",
                                                array($ip, $hostname), __METHOD__, __LINE__);
 
                                        // Set return value to $ip
@@ -108,7 +108,7 @@ class HostnameResolver {
                                //* DEBUG: */ logDebugMessage(__METHOD__, __LINE__, sprintf("Cannot lookup: %s", $hostname));
                        } else {
                                // Put entry in DB
-                               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_dns_cache` (`ip`, `hostname`, `added`) VALUES ('%s', '%s', NOW())",
+                               sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_dns_cache` (`ip`, `hostname`, `added`) VALUES ('%s', '%s', NOW())",
                                        array($ip, $hostname), __METHOD__, __LINE__);
 
                                // Set return value to $ip
@@ -118,7 +118,7 @@ class HostnameResolver {
                }
 
                // Free result
-               SQL_FREERESULT($result);
+               sqlFreeResult($result);
 
                // Return IP number (let's hope it)
                return $ret;
@@ -127,7 +127,7 @@ class HostnameResolver {
        // Purge old entries
        function purgeEntries() {
                // SQL for cleaning up
-               SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_dns_cache` WHERE (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(`added`) >= {?dns_cache_timeout?})',
+               sqlQuery('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_dns_cache` WHERE (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(`added`) >= {?dns_cache_timeout?})',
                        __METHOD__, __LINE__);
        }
 }