diff options
author | Nozomi Anzai | 2010-06-23 04:24:09 +0000 |
---|---|---|
committer | Nozomi Anzai | 2010-06-23 04:24:09 +0000 |
commit | 0de7fcfdd9d5c20ccbb35aa20a917f38b8545330 (patch) | |
tree | ccfbf9463b945a93f2e8026abfc4918a48474bf4 | |
parent | d79035b375063777e0bb2591a51fe87622c78e3d (diff) |
Replace deprecated functions
- ereg -> preg_match
- split -> explode
- ereg_replace -> str_replace
-rw-r--r-- | common.php | 10 | ||||
-rw-r--r-- | pgconfig.php | 8 | ||||
-rw-r--r-- | procInfo.php | 2 |
3 files changed, 10 insertions, 10 deletions
@@ -91,7 +91,7 @@ $messageList = array(); $res_dir = opendir('lang/'); while($file_name = readdir( $res_dir )) { - if(ereg('.*\.lang\.php$', $file_name)) { + if(preg_match('/.*\.lang\.php$/', $file_name)) { if(@is_file('lang/' . $file_name)) { include('lang/' . $file_name); $messageList[$message['lang']] = $message['strLang']; @@ -344,14 +344,14 @@ function readConfigParams($paramList = FALSE) { foreach ($configFile as $line_num => $line) { $line = trim($line); if(preg_match("/^\w/", $line)) { - list($key, $value) = split("=", $line); + list($key, $value) = explode("=", $line); $key = trim($key); $value = trim($value); if(preg_match("/^backend_hostname/", $key)) { $num = str_replace('backend_hostname', '', $key); - $configParam['backend_hostname'][$num] = ereg_replace("'", "", $value); + $configParam['backend_hostname'][$num] = str_replace("'", "", $value); } else if(preg_match("/^backend_port/", $key)) { $num = str_replace('backend_port', '', $key); @@ -363,10 +363,10 @@ function readConfigParams($paramList = FALSE) { } else if(preg_match("/^backend_data_directory/", $key)) { $num = str_replace('backend_data_directory', '', $key); - $configParam['backend_data_directory'][$num] = ereg_replace("'", "", $value); + $configParam['backend_data_directory'][$num] =str_replace("'", "", $value); } else { - $configParam[$key] = ereg_replace("'", "", $value); + $configParam[$key] = str_replace("'", "", $value); } } } diff --git a/pgconfig.php b/pgconfig.php index 56b5d3e..8e70e97 100644 --- a/pgconfig.php +++ b/pgconfig.php @@ -308,11 +308,11 @@ function check($key, $value, &$configParam ,&$error) { */ function checkString($str, $pattern) { - if(ereg($pattern, $str)) { + if(preg_match("/$pattern/", $str)) { return true; } else { return false; - } + } } /** @@ -328,7 +328,7 @@ function checkInteger($str, $min, $max) if(is_numeric($str)) { $minLen = strlen($min); $maxLen = strlen($max); - if(ereg("^[0-9]{".$minLen.",".$maxLen."}$", $str)) { + if(preg_match('/^[0-9]{'.$minLen.','.$maxLen.'}$/', $str)) { if($str < $min || $str > $max) { return false; } else { @@ -389,7 +389,7 @@ function writeConfigFile($configValue, $pgpoolConfigParam) for($i=0; $i < count($configFile); $i++) { $line = $configFile[$i]; if(preg_match("/^\w/", $line)) { - list($key, $value) = split("=", $line); + list($key, $value) = explode("=", $line); $key = trim($key); if(!preg_match("/^backend_hostname/", $key) && !preg_match("/^backend_port/", $key) diff --git a/procInfo.php b/procInfo.php index 1b4d418..01a8839 100644 --- a/procInfo.php +++ b/procInfo.php @@ -36,7 +36,7 @@ if(!array_key_exists('SUCCESS', $ret)) { $tpl->display('innerError.tpl'); exit(); } else { - $procPids = split(" ", $ret['SUCCESS']); + $procPids = explode(" ", $ret['SUCCESS']); } for($i=0; $i<count($procPids); $i++) { |