Changeset 5884 in subversion


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

Split rcube::shutdown()

Location:
branches/devel-framework/roundcubemail/program/include
Files:
2 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  /** 
  • branches/devel-framework/roundcubemail/program/include/rcube.php

    r5881 r5884  
    763763    if (is_object($this->smtp)) 
    764764      $this->smtp->disconnect(); 
    765 /* 
    766     foreach ($this->address_books as $book) { 
    767       if (is_object($book) && is_a($book, 'rcube_addressbook')) 
    768         $book->close(); 
    769     } 
    770 */ 
     765 
    771766    foreach ($this->caches as $cache) { 
    772767        if (is_object($cache)) 
     
    776771    if (is_object($this->storage)) 
    777772      $this->storage->close(); 
    778  
    779     // before closing the database connection, write session data 
    780     if ($_SERVER['REMOTE_ADDR'] && is_object($this->session)) { 
    781       session_write_close(); 
    782     } 
    783  
    784     // write performance stats to logs/console 
    785     if ($this->config->get('devel_mode')) { 
    786       if (function_exists('memory_get_usage')) 
    787         $mem = rcube_ui::show_bytes(memory_get_usage()); 
    788       if (function_exists('memory_get_peak_usage')) 
    789         $mem .= '/'.rcube_ui::show_bytes(memory_get_peak_usage()); 
    790  
    791       $log = $this->task . ($this->action ? '/'.$this->action : '') . ($mem ? " [$mem]" : ''); 
    792       if (defined('RCMAIL_START')) 
    793         self::print_timer(RCMAIL_START, $log); 
    794       else 
    795         self::console($log); 
    796     } 
    797773  } 
    798774 
Note: See TracChangeset for help on using the changeset viewer.