circle.ch weblog by Urs Gehrig

 Search
A weblog about libre software, law, technology, politics and the like.
2013-05-11T15:38:07
Academic, Android, Apache, Apple, Art, Best Of, Biotech, Civil Society, Content Management, Cooking, Copyright, Creative Commons, Crosspost, Culture, Database, Deutsch, DRM, Economy, Education, Event, Gadget, General, Geodata, Government, Health, Howto, Humor, Innovation, Intellectual Property, Java, Language, LaTeX, Law, Linux, Media, Moblog, Mozilla, Music, Office, Open Content, Open Source, P2P, PHP, Podcast, Politics, Privacy, Projects, Random Thought, Rant, Science, Search, Social Network, Software, Sport, Talks, Technology, Technology Transfer, Travelling, Weblog, Wiki, Wireless and Mobile, XML

16. March 2004

Just no win-win situation
@ 21:24:46

Yesterday I moved a PHP project from Windows to OS X. For reasons of laziness I often code something like:
if (stristr(PHP_OS, "WIN")) {
echo "Do something Windows-related here...";
}
This worked usually perfect for scripts moved between Windows and Linux based systems. But one has to be more precise for scripts to run additionally on OS X. Since OS X comes with a PHP_OS string consisting of "Darwin". If you are wondering, why your scripts do not work on Mac try this:
if (stristr(PHP_OS, "Windows")) {
echo "Do something Windows-related here...";
}

Comments (0) Permalink del.icio.us

The URL to TrackBack this entry is:
   http://circle.ch/blog/b2trackback.php/1375

  1. Comment by funkablog » What Felix said about assuming… @ 2004-03-17 04:46:39:
    funkablog \&\;raquo\; What Felix said about assuming\&\;\#8230\;’s Gravatar [...] of server or client detection by checking for a short string anywhere in the fingerprint. This is a good example of why. Comments (0) Comments RSS feed for comments on this post. [...]
  2. Comment by funkablog @ 2004-03-17 04:47:12:
    funkablog’s Gravatar What Felix said about assuming...
    It always seemed like a bad idea to do some kind of server or client detection by checking for a short string anywhere in the fingerprint. This is a good example of why.

Comments closed.



Werbung:

Beiträge von Dritten:

Nachfolgende Titel verweisen auf von mir gelesene Weblogs.

Feeds:

Blog Content
Blog Comments

WikiAgenda:

Comments:

Good question, but...
Hi, thank you very...
Unter http://www.s...
Ich weiss mir nich...
ThanQ matthias. Th...
in case you just w...
ich liebe dir, urs...
hi there, sorry i...
Hoi Leo. I haven'...
Do you know the si...

Archives:

Blog stack:

Bill Humphries
monorom
Wendy M. Seltzer
Christian Stocker
Roger Fischer
Sandro Zic
Wez Furlong
Ben Hammersley
George Schlossnagle
Joichi Ito
Lawrence Lessig
Derek Slater
Karl-Friedrich Lenz
John Palfrey
Bernhard A.M. Seefeld
Gregor J. Rothfuss
Rainer Langenhan
Elke Engel
Sebastian Bergmann
Simon Willison
Jeremy Zwaodny
Udo Vetter
Axel A. Horns
Miguel de Icaza
Andreas Halter
Silvan Zurbrügg
Hannes Gassert
Markus Koller


$Date: 2005/11/05 11:14:30 $