Development

Changeset 2989

You must first sign up to be able to contribute.

Changeset 2989

Show
Ignore:
Timestamp:
12/09/06 12:10:45 (2 years ago)
Author:
fabien
Message:

lime: fastest Windows Detection

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tools/lime/lib/lime.php

    r2981 r2989  
    332332  { 
    333333    // disable colors if not supported (windows or non tty console) 
    334     if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' || !function_exists('posix_isatty') || !@posix_isatty(STDOUT)) 
     334    if (DIRECTORY_SEPARATOR == '\\' || !function_exists('posix_isatty') || !@posix_isatty(STDOUT)) 
    335335    { 
    336336      return $text; 
     
    380380  { 
    381381    $path = getenv('PATH') ? getenv('PATH') : getenv('Path'); 
    382     $exe_suffixes = substr(PHP_OS, 0, 3) == 'WIN' ? (getenv('PATHEXT') ? explode(PATH_SEPARATOR, getenv('PATHEXT')) : array('.exe', '.bat', '.cmd', '.com')) : array(''); 
     382    $exe_suffixes = DIRECTORY_SEPARATOR == '\\' ? (getenv('PATHEXT') ? explode(PATH_SEPARATOR, getenv('PATHEXT')) : array('.exe', '.bat', '.cmd', '.com')) : array(''); 
    383383    foreach (array('php5', 'php') as $php_cli) 
    384384    {