X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp.php;h=b910765e12f02c35719523d9c9393c6a2cfd86f6;hb=9a5f9829c11998284620a804eee15049fccc0757;hp=1fb79deceacb0f9579961d564e2c140d70423a92;hpb=8f9c0fe14956efbcaf0db9dbfb83222e18e0ab2f;p=friendica.git diff --git a/src/App.php b/src/App.php index 1fb79decea..b910765e12 100644 --- a/src/App.php +++ b/src/App.php @@ -120,6 +120,7 @@ class App * @see initHead() * * @param string $path + * @throws InternalServerErrorException */ public function registerStylesheet($path) { @@ -136,6 +137,7 @@ class App * @see initFooter() * * @param string $path + * @throws InternalServerErrorException */ public function registerFooterScript($path) { @@ -158,7 +160,7 @@ class App * * @throws Exception if the Basepath is not usable */ - public function __construct($basePath, $logger, $isBackend = true) + public function __construct($basePath, LoggerInterface $logger, $isBackend = true) { $this->logger = $logger; @@ -616,6 +618,7 @@ class App * finally for PWD * * @return string + * @throws InternalServerErrorException */ public function getBasePath() { @@ -675,6 +678,7 @@ class App * * @param bool $ssl Whether to append http or https under SSL_POLICY_SELFSIGN * @return string Friendica server base URL + * @throws InternalServerErrorException */ public function getBaseURL($ssl = false) { @@ -699,7 +703,7 @@ class App $this->hostname = Core\Config::get('config', 'hostname'); } - return $scheme . '://' . $this->hostname . !empty($this->getURLPath() ? '/' . $this->getURLPath() : '' ); + return $scheme . '://' . $this->hostname . (!empty($this->getURLPath()) ? '/' . $this->getURLPath() : '' ); } /** @@ -708,6 +712,7 @@ class App * Clears the baseurl cache to prevent inconsistencies * * @param string $url + * @throws InternalServerErrorException */ public function setBaseURL($url) { @@ -881,6 +886,7 @@ class App * @param string $origURL * * @return string The cleaned url + * @throws InternalServerErrorException */ public function removeBaseURL($origURL) { @@ -934,6 +940,7 @@ class App * Returns the current UserAgent as a String * * @return string the UserAgent as a String + * @throws InternalServerErrorException */ public function getUserAgent() { @@ -1057,6 +1064,7 @@ class App * @brief Checks if the minimal memory is reached * * @return bool Is the memory limit reached? + * @throws InternalServerErrorException */ public function isMinMemoryReached() { @@ -1101,6 +1109,7 @@ class App * @brief Checks if the maximum load is reached * * @return bool Is the load reached? + * @throws InternalServerErrorException */ public function isMaxLoadReached() { @@ -1133,6 +1142,7 @@ class App * * @param string $command The command to execute * @param array $args Arguments to pass to the command ( [ 'key' => value, 'key2' => value2, ... ] + * @throws InternalServerErrorException */ public function proc_run($command, $args) { @@ -1189,7 +1199,10 @@ class App /** * @brief Checks if a given directory is usable for the system * + * @param $directory + * @param bool $check_writable * @return boolean the directory is usable + * @throws Exception */ public static function isDirectoryUsable($directory, $check_writable = true) { @@ -1367,6 +1380,7 @@ class App * Generates the site's default sender email address * * @return string + * @throws InternalServerErrorException */ public function getSenderEmailAddress() { @@ -1387,6 +1401,7 @@ class App * Returns the current theme name. * * @return string the name of the current theme + * @throws InternalServerErrorException */ public function getCurrentTheme() { @@ -1468,6 +1483,7 @@ class App * Provide a sane default if nothing is chosen or the specified theme does not exist. * * @return string + * @throws InternalServerErrorException */ public function getCurrentThemeStylesheetPath() { @@ -1853,14 +1869,14 @@ class App // And then append it to the target $target->documentElement->appendChild($item); } - } - if (isset($_GET["mode"]) && ($_GET["mode"] == "raw")) { - header("Content-type: text/html; charset=utf-8"); + if ($_GET["mode"] == "raw") { + header("Content-type: text/html; charset=utf-8"); - echo substr($target->saveHTML(), 6, -8); + echo substr($target->saveHTML(), 6, -8); - exit(); + exit(); + } } $page = $this->page; @@ -1929,7 +1945,7 @@ class App * Should only be used if it isn't clear if the URL is either internal or external * * @param string $toUrl The target URL - * + * @throws InternalServerErrorException */ public function redirect($toUrl) {