/** * Construction of the exception - a message is needed (1st argument) * * @param string $message The exception message * @param numeric $code The exception code * @param misc $previous The previous exception if so */ public function __construct($message, $code = 0, $previous = null) { // We let the default PHP Exception manager construction parent::__construct($message, $code, $previous); $this->trace = parent::getTrace(); $this->previous = parent::getPrevious(); if (isset($php_errormsg)) { $this->php_error_message = $php_errormsg; } $dom_id = Profiler::getNewDomId('exception'); $this->infos = array('message' => self::_buildExceptionStr(), 'type' => 'exception', 'scope' => 'Exception', 'file' => $this->getFile(), 'line' => $this->getLine(), 'filename' => basename($this->getFile()), 'dirname' => dirname($this->getFile()), 'dom_id' => $dom_id, 'source' => Profiler::getHighlightedSource($this->getFile(), $this->getLine())); $this->infos['traces'] = Profiler::getHighlightedTraces($this->getTrace(), $this->infos); $this->debugger = Debugger::getInstance(); $this->debugger->addStack('message', $this->infos); $this->debugger->setDebuggerTitle(self::_buildExceptionStr(true), Url::getRequestUrl()); }
public function __construct($route = null, Collection $routes = null, array $arguments_table = array(), $matcher = null) { if (!is_null($routes)) { $this->setRoutes($routes); } if (!is_null($arguments_table)) { $this->setArgumentsTable($arguments_table); } if (!is_null($matcher)) { $this->setMatcher($matcher); } if (!is_null($route)) { $this->setRoute($route); } else { $this->setRoute(UrlHelper::getRequestUrl()); } }
/** * Construction of the error - a message is needed (1st argument) * * @param string $message The error message * @param numeric $code The error code * @param numeric $severity The error severity code * @param string $filename The file name of the error * @param numeric $lineno The line number of the error * @param misc $previous The previous error if so */ public function __construct($message, $code = 0, $severity = 1, $filename = __FILE__, $lineno = __LINE__, $previous = null) { // This error code is not in the error_reporting() if (!(error_reporting() & $code)) { return; } // We let the default PHP Exception manager construction parent::__construct($message, $code, $severity, $filename, $lineno, $previous); $this->trace = parent::getTrace(); $this->previous = parent::getPrevious(); if (isset($php_errormsg)) { $this->php_error_message = $php_errormsg; } switch ($this->getCode()) { case E_ERROR: case E_USER_ERROR: $this->setType('fatal'); $this->setScope('Fatal Error'); $this->exit = true; break; case E_WARNING: case E_USER_WARNING: $this->setType('warning'); $this->setScope('Warning'); break; case E_NOTICE: case E_USER_NOTICE: case @E_STRICT: $this->setType('notice'); $this->setScope('Notice'); break; case @E_RECOVERABLE_ERROR: $this->setType('catchable'); $this->setScope('Catchable Error'); break; case E_PARSE: $this->setType('parse'); $this->setScope('Parsing Error'); break; case @E_DEPRECATED: case @E_USER_DEPRECATED: $this->setType('deprecated'); $this->setScope('Deprecated Error'); break; default: $this->setType('unknown'); $this->setScope('Unknown Error'); $this->exit = true; break; } $dom_id = Profiler::getNewDomId($this->getType()); $this->infos = array('message' => self::_buildExceptionStr(), 'scope' => $this->getScope(), 'type' => $this->getType(), 'file' => $this->getFile(), 'line' => $this->getLine(), 'severity' => $this->getSeverity(), 'filename' => basename($this->getFile()), 'dirname' => dirname($this->getFile()), 'dom_id' => $dom_id, 'source' => Profiler::getHighlightedSource($this->getFile(), $this->getLine())); $this->infos['traces'] = Profiler::getHighlightedTraces($this->getTrace(), $this->infos); $this->debugger = Debugger::getInstance(); $this->debugger->addStack('message', $this->infos); $this->debugger->setDebuggerTitle(self::_buildExceptionStr(true), Url::getRequestUrl()); return false; }
return str_replace(join($ds, $parts), $ds . '[***]', $path); } /** * GET arguments settings */ $arg_ln = isset($_GET['ln']) ? $_GET['ln'] : 'en'; function getPhpClassManualLink($class_name, $ln = 'en') { return sprintf('http://php.net/manual/%s/class.%s.php', $ln, strtolower($class_name)); } if (file_exists($a = __DIR__ . '/../vendor/autoload.php')) { require_once $a; } else { die('You need to run Composer on your project to use this interface!'); } $webservice_domain = str_replace('demo', 'www', \Library\Helper\Url::getRequestUrl()); ?> <!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <title>Test & documentation of PHP "WebServices" package</title> <meta name="description" content="" /> <meta name="viewport" content="width=device-width" /> <link rel="stylesheet" href="assets/html5boilerplate/css/normalize.css" /> <link rel="stylesheet" href="assets/html5boilerplate/css/main.css" /> <script src="assets/html5boilerplate/js/vendor/modernizr-2.6.2.min.js"></script>
/** * Populate the request object with current HTTP request values * * @return self * @see \Library\Helper\Url::getRequestUrl() */ public function guessFromCurrent() { $this->setUrl(UrlHelper::getRequestUrl())->setProtocol(UrlHelper::getHttpProtocol())->setMethod($_SERVER['REQUEST_METHOD'])->setHeaders($this->getallheaders())->setArguments(isset($_GET) ? $_GET : array())->setData(isset($_POST) ? $_POST : array())->setSession(isset($_SESSION) ? $_SESSION : array())->setFiles(isset($_FILES) ? $_FILES : array())->setCookies(isset($_COOKIE) ? $_COOKIE : array())->setAuthenticationUser(isset($_SERVER['PHP_AUTH_USER']) ? $_SERVER['PHP_AUTH_USER'] : null)->setAuthenticationPassword(isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : null)->setAuthenticationType(!empty($_SERVER['PHP_AUTH_DIGEST']) ? 'digest' : 'basic'); return $this; }
public static function getProfiler() { $docbook = FrontController::getInstance(); return array('date' => new DateTime(), 'timezone' => date_default_timezone_get(), 'php_uname' => php_uname(), 'php_version' => phpversion(), 'php_sapi_name' => php_sapi_name(), 'apache_version' => function_exists('apache_get_version') ? apache_get_version() : '?', 'user_agent' => $_SERVER['HTTP_USER_AGENT'], 'git_clone' => DirectoryHelper::isGitClone($docbook->getPath('root_dir')), 'request' => UrlHelper::getRequestUrl()); }
/** * Get the path that seem to be thr root http url */ public static function getRootHttp() { return defined('_ROOTHTTP') ? _ROOTHTTP : Url::getRequestUrl(false, true); }
/** * @return array */ protected function getUsageParams() { $data = $this->getUserOptions(); $data['webservice_url'] = UrlHelper::getRequestUrl(false, true, false, true); return $data; }