Development

Changeset 2429

You must first sign up to be able to contribute.

Changeset 2429

Show
Ignore:
Timestamp:
10/18/06 10:13:43 (2 years ago)
Author:
fabien
Message:

pake: fixed problems when using cgi php

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tools/pake/trunk/lib/pake/pakeFunction.php

    r2382 r2429  
    396396} 
    397397set_exception_handler('pake_exception_default_handler'); 
     398 
     399// fix php behavior if using cgi php 
     400// from http://www.sitepoint.com/article/php-command-line-1/3 
     401if (false !== strpos(php_sapi_name(), 'cgi')) 
     402{ 
     403   // handle output buffering 
     404   @ob_end_flush(); 
     405   ob_implicit_flush(true); 
     406 
     407   // PHP ini settings 
     408   set_time_limit(0); 
     409   ini_set('track_errors', true); 
     410   ini_set('html_errors', false); 
     411   ini_set('magic_quotes_runtime', false); 
     412 
     413   // define stream constants 
     414   define('STDIN', fopen('php://stdin', 'r')); 
     415   define('STDOUT', fopen('php://stdout', 'w')); 
     416   define('STDERR', fopen('php://stderr', 'w')); 
     417 
     418   // close the streams on script termination 
     419   register_shutdown_function(create_function('', 'fclose(STDIN); fclose(STDOUT); fclose(STDERR); return true;')); 
     420}