diff options
author | Andrei Zmievski <andrei@php.net> | 1999-11-29 18:10:05 +0000 |
---|---|---|
committer | Andrei Zmievski <andrei@php.net> | 1999-11-29 18:10:05 +0000 |
commit | 8f39384d919f0637061138c40d7fa1328d4a5463 (patch) | |
tree | e5be3b32a5609cb17793047fe98405c121e7ba02 /pear | |
parent | e3b5b988130761011f2176fcf47d0cff17fac7ac (diff) | |
download | php-git-8f39384d919f0637061138c40d7fa1328d4a5463.tar.gz |
Modified to use preg_* functions.
Diffstat (limited to 'pear')
-rw-r--r-- | pear/DB.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/pear/DB.php b/pear/DB.php index fee3db5236..e3c177443d 100644 --- a/pear/DB.php +++ b/pear/DB.php @@ -186,11 +186,11 @@ class DB { 'username' => false, 'password' => false ); - if (ereg('^([^:]+)://', $dsn, &$arr)) { + if (preg_match('|^([^:]+)://|', $dsn, &$arr)) { $dbtype = $arr[1]; - $dsn = ereg_replace('^[^:]+://', '', $dsn); + $dsn = preg_replace('|^[^:]+://|', '', $dsn); // match "phptype(dbsyntax)" - if (ereg('^([^\(]+)\((.+)\)$', $dbtype, &$arr)) { + if (preg_match('|^([^\(]+)\((.+)\)$|', $dbtype, &$arr)) { $parsed['phptype'] = $arr[1]; $parsed['dbsyntax'] = $arr[2]; } else { @@ -198,7 +198,7 @@ class DB { } } else { // match "phptype(dbsyntax)" - if (ereg('^([^\(]+)\((.+)\)$', $dsn, &$arr)) { + if (preg_match('|^([^\(]+)\((.+)\)$|', $dsn, &$arr)) { $parsed['phptype'] = $arr[1]; $parsed['dbsyntax'] = $arr[2]; } else { @@ -207,21 +207,21 @@ class DB { return $parsed; // XXX ADDREF } - if (ereg('^(.*)/([^/]+)$', $dsn, &$arr)) { + if (preg_match('|^(.*)/([^/]+)$|', $dsn, &$arr)) { $parsed['database'] = $arr[2]; $dsn = $arr[1]; } - if (ereg('^([^:]+):([^@]+)@?(.*)$', $dsn, &$arr)) { + if (preg_match('|^([^:]+):([^@]+)@?(.*)$|', $dsn, &$arr)) { $parsed['username'] = $arr[1]; $parsed['password'] = $arr[2]; $dsn = $arr[3]; - } elseif (ereg('^([^:]+)@(.*)$', $dsn, &$arr)) { + } elseif (preg_match('|^([^:]+)@(.*)$|', $dsn, &$arr)) { $parsed['username'] = $arr[1]; $dsn = $arr[3]; } - if (ereg('^([^\+]+)\+(.*)$', $dsn, &$arr)) { + if (preg_match('|^([^\+]+)\+(.*)$|', $dsn, &$arr)) { $parsed['protocol'] = $arr[1]; $dsn = $arr[2]; } |