diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-02-04 01:27:45 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-02-04 01:27:45 +0000 |
commit | 97c538e24f5552427a32008efbf4156d2432e851 (patch) | |
tree | 785edecc1efc52b5be645fa751d996d01b9a1eea /lib/general.lib.php | |
parent | 984a2d8dbad4f98f886a06eef683625e445f7bbc (diff) | |
download | ampache-97c538e24f5552427a32008efbf4156d2432e851.tar.gz ampache-97c538e24f5552427a32008efbf4156d2432e851.tar.bz2 ampache-97c538e24f5552427a32008efbf4156d2432e851.zip |
slight tweak to dba class to try to make it a little more bullet proof, commented added functions
Diffstat (limited to 'lib/general.lib.php')
-rw-r--r-- | lib/general.lib.php | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/general.lib.php b/lib/general.lib.php index 60a38819..d7645d29 100644 --- a/lib/general.lib.php +++ b/lib/general.lib.php @@ -457,6 +457,12 @@ function __autoload($class) { } // __autoload +/** + * win_checkdnsrr + * This is a windows emulation of the normal PHP functions + * not sure how I feel about the exec in here, but it's escaped + * this most likely won't work on a lot of systems + */ function win_checkdnsrr($host, $type='MX') { if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') { return; } if (empty($host)) { return; } @@ -469,15 +475,20 @@ function win_checkdnsrr($host, $type='MX') { foreach($output as $line){ if (preg_match('/^'.$host.'/',$line)) { return true; } } -} +} // win_checkdnsrr -// Define +// See if the function exists, and return as needed if (!function_exists('checkdnsrr')) { function checkdnsrr($host, $type='MX') { return win_checkdnsrr($host, $type); } } +/** + * win_getmxrr + * This emulates the normal PHP function for getting MX records + * most likely won't work on systems due to use of exec + */ function win_getmxrr($hostname, &$mxhosts, &$mxweight=false) { if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') return; if (!is_array ($mxhosts) ) $mxhosts = array(); @@ -498,9 +509,9 @@ function win_getmxrr($hostname, &$mxhosts, &$mxweight=false) { } } return ($i!=-1); -} +} // win_getmxrr -// Define +// If no getmxrr return if (!function_exists('getmxrr')) { function getmxrr($hostname, &$mxhosts, &$mxweight=false) { return win_getmxrr($hostname, $mxhosts, $mxweight); |