示例#1
0
文件: init.php 项目: savonix/nexista
 /**
  * Registers a function to be called on output
  *
  * This function can be used to manipulate the final output before it is
  * displayed. It can be used to create a caching system, compress output
  *
  * The handler should be a callable function or array of object/method as
  * defined in is_callable php function.  It should accept 1 arguments:
  * 1. The reference to the init class instance
  *
  * Note that the Nexista_Init::$_info property contains the current cache value
  * from the sitemap if set.
  *
  * This function should call:
  *      $output = Nexista_Init::run();
  * to get the final output. The function is responsible for displaying it.
  *
  * @param mixed $handler a function or an array of class=>method
  *
  * @return null
  */
 public static function registerOutputHandler($handler)
 {
     if (is_callable($handler)) {
         self::$_outputHandler = $handler;
     } else {
         Nexista_Error::init('Init Output Handler is not callable!');
     }
 }