cleanupHandlers() static public method

*! \return An array with cleanup handlers.
static public cleanupHandlers ( )
Beispiel #1
0
 static function cleanup()
 {
     $handlers = eZExecution::cleanupHandlers();
     foreach ( $handlers as $handler )
     {
         if ( is_callable( $handler ) )
             call_user_func( $handler );
         else
             eZDebug::writeError('Could not call cleanup handler, is it a static public function?', __METHOD__ );
     }
 }
 /**
  * Registers the 'cleanup' function as shutdown handler, trying to do it only once
  *
  * @param bool $onlyIfConfigured when true, the registration only happens subject to an ini setting
  * @return bool false if registration is aborted, true if the handler is (or was already) registered
  */
 public static function registerShutdownPerfLogger($onlyIfConfigured = false, $eZ5Context = false)
 {
     if ($onlyIfConfigured && eZPerfLoggerINI::variable('GeneralSettings', 'AlwaysRegisterShutdownPerfLogger') !== 'enabled') {
         return false;
     }
     foreach (eZExecution::cleanupHandlers() as $handler) {
         if ($handler == array(__CLASS__, 'cleanup') || $handler == array(__CLASS__, 'cleanupOnCleanExit')) {
             return true;
         }
     }
     if ($eZ5Context) {
         eZExecution::addCleanupHandler(array(__CLASS__, 'cleanupOnCleanExit'));
     } else {
         eZExecution::addCleanupHandler(array(__CLASS__, 'cleanup'));
     }
     return true;
 }