setTime() public static méthode

Set PHP execution time limit (doesn't work in safe mode)
public static setTime ( integer $newLimit )
$newLimit integer
Exemple #1
0
 public function testSetTimeAndMemory()
 {
     Sys::setTime(1800);
     Sys::setMemory('128M');
     isSame('128M', Sys::iniGet('memory_limit'));
     //isSame('1800', Sys::iniGet('set_time_limit'));
     //isSame('1800', Sys::iniGet('max_execution_time'));
 }
Exemple #2
0
 /**
  * @return int
  */
 protected function _setEnv()
 {
     // set limits & reporting
     if ($this->_isDebug()) {
         error_reporting(-1);
     } else {
         error_reporting(E_ERROR | E_WARNING);
     }
     $memory = $this->_globConfig->get('memory', '1024M');
     $time = (int) $this->_globConfig->get('time', 1800);
     Sys::iniSet('display_errors', 1);
     Sys::setTime($time);
     Sys::setMemory($memory);
 }