Changeset 2981 for trunk/system/core/Kohana.php
- Timestamp:
- 07/07/2008 12:51:57 PM (5 months ago)
- Files:
-
- 1 modified
-
trunk/system/core/Kohana.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/core/Kohana.php
r2978 r2981 334 334 335 335 /** 336 * Closes all open output buffers, either by flushing or cleaning all 337 * open buffers, including the Kohana output buffer. 338 * 339 * @param boolean disable to clear buffers, rather than flushing 340 * @return void 341 */ 342 public static function close_buffers($flush = TRUE) 343 { 344 if (ob_get_level() >= self::$buffer_level) 345 { 346 // Set the close function 347 $close = ($flush === TRUE) ? 'ob_end_flush' : 'ob_end_clean'; 348 349 while (ob_get_level() > self::$buffer_level) 350 { 351 // Flush or clean the buffer 352 $close(); 353 } 354 355 // This will flush the Kohana buffer, which sets self::$output 356 ob_end_clean(); 357 } 358 } 359 360 /** 336 361 * Triggers the shutdown of Kohana by closing the output buffer, runs the system.display event. 337 362 * … … 340 365 public static function shutdown() 341 366 { 342 while (ob_get_level() > self::$buffer_level) 343 { 344 // Flush all open output buffers above the internal buffer 345 ob_end_flush(); 346 } 347 348 // This will flush the Kohana buffer, which sets self::$output 349 (ob_get_level() === self::$buffer_level) and ob_end_clean(); 367 // Close output buffers 368 self::close_buffers(TRUE); 350 369 351 370 // Run the output event
