Re: Re: New Class: OS
| From: | Tomas V.V.Cox | Date: | Sun, 27 Jan 2002 05:04:11 +0000 |
| Subject: | Re: Re: New Class: OS | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-4209@lists.php.net to get a copy of this message | ||
Sterling Hughes wrote:
>
> > Hello,
> >
> > Sterling Hughes wrote:
> > >
> > > Hey all,
> > >
> > > I've written a new OS class (currently very-beta, I wrote it in the
> > > past 1/2 hour :). Which will give you information about the current
> > > operating system that your using.
> > >
> > > The source code is available at:
> > > http://www.bumblebury.com/OS.phps,
> > > and a test script is available at:
> > > http://www.bumblebury.com/tst.phps.
> > >
> > > I'll add this in a day or so, unless someone speaks up (is there
> > > some sort of "process" for module acceptance, since I've last
> > > posted
> > > here? :)
> >
> > It is a little hard to take this seriously with functions named:
> > isWinblows! :-)
> >
> > Now seriously, nobody has to simpathize with Microsoft, but a
> > significant part of PHP user base uses Windows and may take that as a
> > biased insult. Is that joke function name really necessary?
> >
>
> nobody can take a joke these days :) That's just a temporary thing,
> it would of course be removed once I commit it to pear.
>
You could maintain the joke with:
$a_stable = OS::isWindows()? 'The answer is': 'no';
:-)
Apart from that and correct me if I'm wrong, the PHP_OS string will
return Win32 but also others like WinNT, so the isWindows() test should
be more good. Perhaps setting also with a new general entry OS_WINDOWS
(btw also OS_UNIX). I'm saying that because it will be very useful for
the dependencies checker of the PEAR Installer. People could use:
<dep type="os">OS_WINDOWS</dep>
or
<dep type="os">OS_WINNT</dep>
I would like to use this class for checking this type of dependencies.
Tomas V.V.Cox