Development

Changeset 3222

You must first sign up to be able to contribute.

Changeset 3222

Show
Ignore:
Timestamp:
01/11/07 08:52:41 (2 years ago)
Author:
fabien
Message:

lime: removed harcoded /tmp directory in coverage class

Files:

Legend:

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

    r3175 r3222  
    261261  { 
    262262    $this->output->comment($message); 
     263  } 
     264 
     265  static function get_temp_directory() 
     266  { 
     267    if ('\\' == DIRECTORY_SEPARATOR) 
     268    { 
     269      foreach (array('TEMP', 'TMP', 'windir') as $dir) 
     270      { 
     271        if ($var = isset($_ENV[$dir]) ? $_ENV[$dir] : getenv($dir)) 
     272        { 
     273          return $var; 
     274        } 
     275      } 
     276 
     277      return getenv('SystemRoot').'\temp'; 
     278    } 
     279 
     280    if ($var = isset($_ENV['TMPDIR']) ? $_ENV['TMPDIR'] : getenv('TMPDIR')) 
     281    { 
     282      return $var; 
     283    } 
     284 
     285    return '/tmp'; 
    263286  } 
    264287} 
     
    571594 
    572595    $coverage = array(); 
    573     $tmp_file = '/tmp/test.php'; 
     596    $tmp_file = lime_test::get_temp_directory().DIRECTORY_SEPARATOR.'test.php'; 
    574597    foreach ($this->harness->files as $file) 
    575598    {