cvs: pear-core(PEAR_1_3) /OS Guess.php

From: Date: Tue, 19 Oct 2004 04:15:56 +0000
Subject: cvs: pear-core(PEAR_1_3) /OS Guess.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-1064@lists.php.net to get a copy of this message
cellog Tue Oct 19 00:15:56 2004 EDT Modified files: (Branch: PEAR_1_3) /pear-core/OS Guess.php Log: MFH Darwin fixes http://cvs.php.net/diff.php/pear-core/OS/Guess.php?r1=1.13&r2=1.13.4.1&ty=u Index: pear-core/OS/Guess.php diff -u pear-core/OS/Guess.php:1.13 pear-core/OS/Guess.php:1.13.4.1 --- pear-core/OS/Guess.php:1.13 Thu Jan 8 12:33:11 2004 +++ pear-core/OS/Guess.php Tue Oct 19 00:15:56 2004 @@ -17,7 +17,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: Guess.php,v 1.13 2004/01/08 17:33:11 sniper Exp $ +// $Id: Guess.php,v 1.13.4.1 2004/10/19 04:15:56 cellog Exp $ // {{{ uname examples @@ -68,6 +68,11 @@ // SparcStation 20 Solaris 8: // SunOS host.example.com 5.8 Generic_108528-12 sun4m sparc SUNW,SPARCstation-20 // +// Mac OS X (Darwin) +// Darwin home-eden.local 7.5.0 Darwin Kernel Version 7.5.0: Thu Aug 5 19:26:16 PDT 2004; root:xnu/xnu-517.7.21.obj~3/RELEASE_PPC Power Macintosh +// +// Mac OS X early versions +// // }}} @@ -97,11 +102,11 @@ static $sysmap = array( 'HP-UX' => 'hpux', 'IRIX64' => 'irix', - // Darwin? ); static $cpumap = array( 'i586' => 'i386', 'i686' => 'i386', + 'ppc' => 'powerpc', ); if ($uname === null) { $uname = php_uname(); @@ -138,6 +143,24 @@ // use only the first two digits from the kernel version $release = ereg_replace('^([[:digit:]]+\.[[:digit:]]+).*', '\1', $parts[2]); break; + case 'Mac' : + $sysname = 'darwin'; + $nodename = $parts[2]; + $release = $parts[3]; + if ($cpu == 'Macintosh') { + if ($parts[$n - 2] == 'Power') { + $cpu = 'powerpc'; + } + } + break; + case 'Darwin' : + if ($cpu == 'Macintosh') { + if ($parts[$n - 2] == 'Power') { + $cpu = 'powerpc'; + } + } + $release = ereg_replace('^([[:digit:]]+\.[[:digit:]]+).*', '\1', $parts[2]); + break; default: $release = ereg_replace('-.*', '', $parts[2]); break; @@ -255,7 +278,6 @@ } } - /* * Local Variables: * indent-tabs-mode: nil

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