| | |
| | | private $address_books = array(); |
| | | private $caches = array(); |
| | | private $action_map = array(); |
| | | private $shutdown_functions = array(); |
| | | |
| | | |
| | | /** |
| | |
| | | $this->output->set_env('comm_path', $this->comm_path); |
| | | $this->output->set_charset(RCMAIL_CHARSET); |
| | | |
| | | // add some basic label to client |
| | | // add some basic labels to client |
| | | $this->output->add_label('loading', 'servererror'); |
| | | |
| | | return $this->output; |
| | |
| | | */ |
| | | public function shutdown() |
| | | { |
| | | foreach ($this->shutdown_functions as $function) |
| | | call_user_func($function); |
| | | |
| | | if (is_object($this->smtp)) |
| | | $this->smtp->disconnect(); |
| | | |
| | |
| | | $this->imap->close(); |
| | | |
| | | // before closing the database connection, write session data |
| | | if ($_SERVER['REMOTE_ADDR']) { |
| | | if ($_SERVER['REMOTE_ADDR'] && is_object($this->session)) { |
| | | $this->session->cleanup(); |
| | | session_write_close(); |
| | | } |
| | |
| | | else |
| | | console($log); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Registers shutdown function to be executed on shutdown. |
| | | * The functions will be executed before destroying any |
| | | * objects like smtp, imap, session, etc. |
| | | * |
| | | * @param callback Function callback |
| | | */ |
| | | public function add_shutdown_function($function) |
| | | { |
| | | $this->shutdown_functions[] = $function; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | $url = './'; |
| | | $delm = '?'; |
| | | foreach (array_reverse($p) as $key => $val) |
| | | { |
| | | if (!empty($val)) { |
| | | foreach (array_reverse($p) as $key => $val) { |
| | | if ($val !== '') { |
| | | $par = $key[0] == '_' ? $key : '_'.$key; |
| | | $url .= $delm.urlencode($par).'='.urlencode($val); |
| | | $delm = '&'; |