/** * Outputs the object as plain text. * @param EXCEPTION_SIGNATURE $obj * @access private * @abstract */ protected function _display_as_plain_text($obj) { $page_name = $obj->page_name; $dynamic_class_name = $obj->dynamic_class_name; $class_name = $obj->class_name; $application_description = $obj->application_description; $routine_name = $obj->routine_name; $error_message = $obj->message; $browser = $this->env->browser(); echo $this->par($error_message); echo $this->sep(); $table = new TEXT_TABLE_RENDERER($this); $table->add_item('Page', $page_name); if ($application_description) { $table->add_item('Application', $application_description); } if ($routine_name) { if ($dynamic_class_name) { if ($dynamic_class_name != $class_name) { $table->add_item('Class', "{$dynamic_class_name} ({$class_name})"); } else { $table->add_item('Class', $class_name); } } else { $table->add_item('Class', $class_name); } if ($class_name == $routine_name) { $table->add_item('Routine', '<constructor>'); } else { $table->add_item('Routine', $routine_name); } } else { $table->add_item('Scope', 'global'); } $table->add_separator(); $table->add_item('Server', $this->env->server_info()); $table->add_item('Library', 'WebCore ' . $this->env->version); /** @var $options EXCEPTION_RENDERER_OPTIONS */ $options = $this->_options; if ($options->include_browser_info) { $table->add_separator(); $table->add_item('Browser', $browser->description_as_plain_text()); $table->add_item('OS', $browser->system_id()); $table->add_item('User agent', $browser->user_agent_string); } $table->display(); echo $this->line(); if ($options->include_page_data) { $this->_show_array_as_text('Post', $obj->variables_for(Var_type_post)); $this->_show_array_as_text('URL', $obj->variables_for(Var_type_get)); $this->_show_array_as_text('Cookie', $obj->variables_for(Var_type_cookie)); $this->_show_array_as_text('Uploads', $obj->variables_for(Var_type_upload)); } }
/** * Builds the error condition context * @param string $message Message issued with the exception. * @param string $routine_name The name of the routine where the error occurred (can be empty) * @param string $class_name The name of the class where the error occurred (can be empty) * @param object $obj Reference to the object where the error occurred (can be empty) * @return EXCEPTION_SIGNATURE * @access private */ public function signature($message, $routine_name, $class_name, $obj) { include_once 'webcore/sys/exception_signature.php'; $Result = new EXCEPTION_SIGNATURE($message, $routine_name, $class_name, $obj); $Result->load_from_exception($message, $routine_name, $class_name, $obj); return $Result; }
/** * Send the error to the logger. * @param EXCEPTION_SIGNATURE $sig * @param string $msg * @access private */ public function dispatch($sig, $msg) { if ($this->env->is_http_server() && $this->env->buffered() && $this->env->exception_handler_page) { $current_url = $this->env->url(); $handler_url = $this->env->resolve_file($this->env->exception_handler_page); if (strpos($current_url, $handler_url) === false) { $parameters = $sig->as_query_string(); $this->env->redirect_root($handler_url . '?' . $parameters); } else { parent::dispatch($sig, $msg); } } else { parent::dispatch($sig, $msg); } }