Esempio n. 1
0
	/**
	 * Resolves the current Wolpath and assigns it to the session for saving.
	 */
	protected function resolveWolPath()
	{
		$route_path = vB_Router::getCurrentRoute();

		$wol_info_phrase = (isset($this->wol_info[$this->action][0]))
							? $this->wol_info[$this->action][0]
							: $this->wol_info['Default'][0];

		$wol_info_segments = (isset($this->wol_info[$this->action][1]))
							? $this->wol_info[$this->action][1]
							: $this->wol_info['Default'][1];

		if ($wol_info_segments)
		{
			$route = vB_Router::createRoute($route_path);
			$route->setSegments($wol_info_segments);

			$route_path = (string)$route;
		}

		if ($wol_info_phrase)
		{
			$action_phrase = implode('|', $wol_info_phrase);
		}
		else
		{
			$action_phrase = 'global|viewing';
		}

		$wol = array(
			urlencode($route_path),
			$action_phrase,
			urlencode($this->getTitle())
		);

		$wolpath = implode('|', $wol);

		vB::$vbulletin->session->set('location', 'route:' . $wolpath);
		define('WOLPATH', $wolpath);
	}
Esempio n. 2
0
 /**
  * Creates a string representation of the error.
  * This is useful when logging or mailing the error and displays full details
  * of the error and where it occurred, including a full stack trace.
  *
  * @param bool $verbose					- Whether to display full details
  * @return string
  */
 public function toString($verbose = false)
 {
     // Build string
     $str = $this->message . "\r\n";
     // Add details
     if ($verbose) {
         $str .= "********************\r\n";
         $str .= 'Occured in file: ' . $this->file . " on line {$this->line}\r\n";
         $str .= 'Current Route: ' . vB_Router::getCurrentRoute() . "\r\n";
         $str .= 'Initial Route: ' . vB_Router::getInitialRoute() . "\r\n";
         $str .= 'Time: ' . date('l dS \\of F Y h:i:s A') . "\r\n";
         $str .= "Stack Trace:\n" . $this->getTraceAsString() . "\r\n";
     }
     return $str;
 }