Ignore:
Timestamp:
Feb 15, 2012 6:21:26 AM (15 months ago)
Author:
thomasb
Message:

Split rcube::shutdown()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/devel-framework/roundcubemail/program/include/rcmail.php

    r5881 r5884  
    740740  } 
    741741 
     742 
     743  /** 
     744   * Function to be executed in script shutdown 
     745   */ 
     746  public function shutdown() 
     747  { 
     748    parent::shutdown(); 
     749 
     750    foreach ($this->address_books as $book) { 
     751      if (is_object($book) && is_a($book, 'rcube_addressbook')) 
     752        $book->close(); 
     753    } 
     754 
     755    // before closing the database connection, write session data 
     756    if ($_SERVER['REMOTE_ADDR'] && is_object($this->session)) { 
     757      session_write_close(); 
     758    } 
     759 
     760    // write performance stats to logs/console 
     761    if ($this->config->get('devel_mode')) { 
     762      if (function_exists('memory_get_usage')) 
     763        $mem = rcube_ui::show_bytes(memory_get_usage()); 
     764      if (function_exists('memory_get_peak_usage')) 
     765        $mem .= '/'.rcube_ui::show_bytes(memory_get_peak_usage()); 
     766 
     767      $log = $this->task . ($this->action ? '/'.$this->action : '') . ($mem ? " [$mem]" : ''); 
     768      if (defined('RCMAIL_START')) 
     769        self::print_timer(RCMAIL_START, $log); 
     770      else 
     771        self::console($log); 
     772    } 
     773  } 
    742774 
    743775  /** 
Note: See TracChangeset for help on using the changeset viewer.