49 if ( ini_get(
'max_execution_time' ) > 0 ) {
50 if ( self::$totalCalls >= self::MAX_TOTAL_CALLS ) {
51 trigger_error(
"Maximum invocations of " . __CLASS__ .
" exceeded." );
52 } elseif ( self::$totalElapsed >= self::MAX_TOTAL_TIME ) {
53 trigger_error(
"Time limit within invocations of " . __CLASS__ .
" exceeded." );
54 } elseif ( self::$stackDepth > 0 ) {
55 trigger_error(
"Resursive invocation of " . __CLASS__ .
" attempted." );
57 $this->oldIgnoreAbort = ignore_user_abort(
true );
58 $this->oldTimeout = ini_set(
'max_execution_time', $seconds );
59 $this->startTime = microtime(
true );
71 if ( $this->oldTimeout ) {
74 set_time_limit( max( 1, $this->oldTimeout - (
int)$elapsed ) );
79 self::$totalElapsed += $elapsed;
81 ignore_user_abort( $this->oldIgnoreAbort );