cvs: pear-core /OS Guess.php
| From: | Helgi �ormar �orbj�rnsson | Date: | Thu, 09 Apr 2009 22:24:12 +0000 |
| Subject: | cvs: pear-core /OS Guess.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-8314@lists.php.net to get a copy of this message | ||
dufuz Thu Apr 9 22:24:12 2009 UTC
Modified files:
/pear-core/OS Guess.php
Log:
Kill of ereg
http://cvs.php.net/viewvc.cgi/pear-core/OS/Guess.php?r1=1.28&r2=1.29&diff_format=u
Index: pear-core/OS/Guess.php
diff -u pear-core/OS/Guess.php:1.28 pear-core/OS/Guess.php:1.29
--- pear-core/OS/Guess.php:1.28 Tue Feb 24 23:39:35 2009
+++ pear-core/OS/Guess.php Thu Apr 9 22:24:12 2009
@@ -10,7 +10,7 @@
* @author Gregory Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php
New BSD License
- * @version CVS: $Id: Guess.php,v 1.28 2009/02/24 23:39:35 dufuz Exp $
+ * @version CVS: $Id: Guess.php,v 1.29 2009/04/09 22:24:12 dufuz Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since PEAR 0.1
*/
@@ -152,7 +152,6 @@
case 'Linux' :
$extra = $this->_detectGlibcVersion();
// use only the first two digits from the kernel version
- //$release = ereg_replace('^([[:digit:]]+\.[[:digit:]]+).*',
'\1', $parts[2]);
$release = preg_replace('/^([0-9]+\.[0-9]+).*/', '\1',
$parts[2]);
break;
case 'Mac' :
@@ -171,15 +170,13 @@
$cpu = 'powerpc';
}
}
- //$release = ereg_replace('^([[:digit:]]+\.[[:digit:]]+).*',
'\1', $parts[2]);
$release = preg_replace('/^([0-9]+\.[0-9]+).*/', '\1',
$parts[2]);
break;
default:
- $release = ereg_replace('-.*', '', $parts[2]);
+ $release = preg_replace('/-.*/', '', $parts[2]);
break;
}
-
if (isset($sysmap[$sysname])) {
$sysname = $sysmap[$sysname];
} else {
@@ -258,7 +255,7 @@
if (!($major && $minor) && @is_link('/lib/libc.so.6')) {
// Let's try reading the libc.so.6 symlink
- if (ereg('^libc-(.*)\.so$', basename(readlink('/lib/libc.so.6')),
$matches)) {
+ if (preg_match('/^libc-(.*)\.so$/',
basename(readlink('/lib/libc.so.6')), $matches)) {
list($major, $minor) = explode('.', $matches[1]);
}
}
@@ -305,11 +302,7 @@
function matchSignature($match)
{
- if (is_array($match)) {
- $fragments = $match;
- } else {
- $fragments = explode('-', $match);
- }
+ $fragments = is_array($match) ? $match : explode('-', $match);
$n = count($fragments);
$matches = 0;
if ($n > 0) {