@@ -23,7 +23,7 @@ |
||
| 23 | 23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 24 | 24 | * THE SOFTWARE. |
| 25 | 25 | */ |
| 26 | -$_SERVER["DOCUMENT_ROOT"]="/var/www/"; |
|
| 27 | -$_SERVER["REQUEST_METHOD"] ="GET"; |
|
| 28 | -$_SERVER["REQUEST_URI"] ="/tests/"; |
|
| 26 | +$_SERVER["DOCUMENT_ROOT"] = "/var/www/"; |
|
| 27 | +$_SERVER["REQUEST_METHOD"] = "GET"; |
|
| 28 | +$_SERVER["REQUEST_URI"] = "/tests/"; |
|
| 29 | 29 | require_once "./vendor/autoload.php"; |
| 30 | 30 | \ No newline at end of file |
@@ -136,8 +136,8 @@ discard block |
||
| 136 | 136 | <body> |
| 137 | 137 | <h1>Tight Framework Exception</h1> |
| 138 | 138 | EXC; |
| 139 | - $output .= "<p><strong>" . get_class($ex) . ": </strong>" . $ex->getMessage() . "</p>"; |
|
| 140 | - $output .= "<p class='padding-left'>in <strong>" . $lastTrace['file'] . "</strong> at line <strong>" . $lastTrace['line'] . "</strong></p>"; |
|
| 139 | + $output .= "<p><strong>".get_class($ex).": </strong>".$ex->getMessage()."</p>"; |
|
| 140 | + $output .= "<p class='padding-left'>in <strong>".$lastTrace['file']."</strong> at line <strong>".$lastTrace['line']."</strong></p>"; |
|
| 141 | 141 | $output .= "<br/>"; |
| 142 | 142 | $output .= "<p>Stack Trace:</p>"; |
| 143 | 143 | $trace = $ex->getTrace(); |
@@ -146,9 +146,9 @@ discard block |
||
| 146 | 146 | $class = isset($el["class"]) ? $el["class"] : ""; |
| 147 | 147 | $type = isset($el["type"]) ? $el["type"] : ""; |
| 148 | 148 | $func = isset($el["function"]) ? $el["function"] : ""; |
| 149 | - $file = isset($el["file"]) ? "at <strong>" . $el["file"] . "</strong>" : ""; |
|
| 150 | - $line = isset($el["line"]) ? "at line <strong>" . $el["line"] . "</strong>" : ""; |
|
| 151 | - $output .= "<p>#" . ($index + 1) . ": " . $class . $type . $func . "() ". $file . $line . "</strong></p>"; |
|
| 149 | + $file = isset($el["file"]) ? "at <strong>".$el["file"]."</strong>" : ""; |
|
| 150 | + $line = isset($el["line"]) ? "at line <strong>".$el["line"]."</strong>" : ""; |
|
| 151 | + $output .= "<p>#".($index + 1).": ".$class.$type.$func."() ".$file.$line."</strong></p>"; |
|
| 152 | 152 | } |
| 153 | 153 | echo $output; |
| 154 | 154 | } |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | } |
| 172 | 172 | $pattern = array_shift($args); // 1st index-> Pattern |
| 173 | 173 | $callable = array_pop($args); // Last index-> callable |
| 174 | - $route = new Route(Utils::removeDouble($this->basePath . $pattern, "/"), $callable); |
|
| 174 | + $route = new Route(Utils::removeDouble($this->basePath.$pattern, "/"), $callable); |
|
| 175 | 175 | $route->setHttpMethods($methods); |
| 176 | 176 | if (count($args) > 0) { |
| 177 | 177 | // Adds the middleware |
@@ -240,14 +240,14 @@ discard block |
||
| 240 | 240 | * @return string Request URN |
| 241 | 241 | */ |
| 242 | 242 | public function getRequestUrn() { |
| 243 | - $output = Utils::addTrailingSlash("/" . Utils::removeSubstring($_SERVER['REQUEST_URI'], $this->basePath)); |
|
| 243 | + $output = Utils::addTrailingSlash("/".Utils::removeSubstring($_SERVER['REQUEST_URI'], $this->basePath)); |
|
| 244 | 244 | return $output; |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | public function runMvc() { |
| 248 | 248 | //@todo Create routes depending on the request URI using MVC |
| 249 | 249 | $requestUrn = $this->getRequestUrn(); |
| 250 | - if("/" == $requestUrn){ |
|
| 250 | + if ("/" == $requestUrn) { |
|
| 251 | 251 | $name = \Tight\Tight::getInstance()->getConfig()->mvc["indexName"]; |
| 252 | 252 | echo $name; |
| 253 | 253 | } |