svn: /pear2/Pyrus/trunk/src/Pyrus/ OSGuess.php

From: Date: Tue, 22 Dec 2009 14:06:04 +0000
Subject: svn: /pear2/Pyrus/trunk/src/Pyrus/ OSGuess.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-9133@lists.php.net to get a copy of this message
dufuz Tue, 22 Dec 2009 14:06:04 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=292480 Log: Kill of ereg, sync with PEAR OS/Guess Changed paths: U pear2/Pyrus/trunk/src/Pyrus/OSGuess.php Modified: pear2/Pyrus/trunk/src/Pyrus/OSGuess.php =================================================================== --- pear2/Pyrus/trunk/src/Pyrus/OSGuess.php 2009-12-22 13:55:24 UTC (rev 292479) +++ pear2/Pyrus/trunk/src/Pyrus/OSGuess.php 2009-12-22 14:06:04 UTC (rev 292480) @@ -180,7 +180,7 @@ $release = preg_replace('/^([0-9]+\.[0-9]+).*/', '\1', $parts[2]); break; default: - $release = preg_replace('-.*', '', $parts[2]); + $release = preg_replace('/-.*/', '', $parts[2]); break; } @@ -258,7 +258,7 @@ } // features.h 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]); } } @@ -303,11 +303,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) { @@ -340,5 +336,4 @@ * indent-tabs-mode: nil * c-basic-offset: 4 * End: - */ -?> + */ \ No newline at end of file

« previous php.pear.core (#9133) next »