Commit Graph

48 Commits

Author SHA1 Message Date
Simon Sessingø
97753f5370 Minor optimisations. 2017-11-10 08:23:15 +01:00
Simon Sessingø
957a382248 Ensured that Request class is using unencoded-url header to avoid encoding issues on IIS (issue: #268) 2017-08-24 02:05:18 +01:00
Simon Sessingø
65c811356d Fixed url parsing for unicode characters. 2017-08-23 21:04:11 +01:00
Simon Sessingø
e84c8c2f02 Uri is now always urldecoded in Request class to ensure compability with
most webservers (issue: #268).
2017-08-23 16:13:44 +01:00
Simon Sessingø
ca381d445f Development
- Changed router so it supports both string and object as exception handlers.
- Added `Router::error($callback)` method to `Router` class (issue #238).
- Fixed issues calling `getController` and `getMethod` when callback is an object (issue #239).
- Updated documentation to reflect new changes.
- Added `addExceptionHandler` to `IGroupRoute` interface and `RouteGroup` class.
- Other minor bugfixes and optimisations.
2017-07-06 15:25:04 +02:00
Simon Sessingø
8c5d8c2dc9 Development
- Fixed: namespace being prepended on `RouterController` routes with absolute namespaces.
- Fixed: match domain on `RouteController` and `RouteResource`.
- Fixed: strict url-matching on `RouteController`. Fix should provide better url-matching.
- Fixed: `RouterResource` always matching first url when having simular urls (ex: `/funny-cat` and `/funny-dog`).
- Added `loadRoutes` method to `Router` class so routes now can be loaded without routing the request (useful when running in Cli etc).
- Removed `getInstance` from `Router` class. Please use `SimpleRouter::router()` for singleton usage instead.
- Added `getRemoteAddr` alias-method for `getIp` in `Request` class.
- Added `getValue` to `IInputItem` interface.
- Other minor optimizations.
- Updated documentation with note on absolute/relative namespaces.
2017-02-26 09:18:35 +01:00
Simon Sessingø
2a448fccd2 Development
- Fixed: only set default namespace on relative callbacks.
- Fixed: default-namespace not being set when calling `SimpleRouter::resource`.
- Minor optimisations.
2017-02-15 03:28:34 +01:00
Simon Sessingø
79414255e0 Development
- Using `$request->setRewriteRoute($route);` rewrite-callback now renders any added middlewares on the route.
- Rewrite callbacks now sets default-namespace on route, if defined.
2017-02-13 06:29:22 +01:00
Simon Sessingø
ce276bd5b7 Version 3
- Easier rewrite management.
- Optimisations.
- Updated documentation.
2017-02-09 13:18:05 +01:00
Simon Sessingø
d9b97ccf42 Bugfixes 2016-11-28 04:20:34 +01:00
Simon Sessingø
c1835152b6 Removed PHP 7 specific functionality. 2016-11-26 04:53:05 +01:00
Simon Sessingø
6213f2fb75 Development
- Optimised Input-classes.
- `get` and `getObject` methods on `Input` now supports filtering on multiple method-types when using the `$method` parameter.
- Input classes now know how to parse that stupid nested $_FILES array.
- It's now possible to change method-names on ResourceControllers.
- Removed `getValue` and `setValue` from `InputFile` classes.
- Ensured that request-method are only parsed from $_POST or $_SERVER.
- Fixed minor parameter-issues with subdomain routing.
- Added PHPDocs.
- Added even more unit-tests.
- Many small optimisations tweaks.
2016-11-26 04:30:00 +01:00
Simon Sessingø
1c515119b4 Development
- Ensure that request-method is always lowercase.
- Fixed spaces instead of tabs to comply with PSR-2.
2016-11-25 12:51:45 +01:00
Simon Sessingø
7edee8e6d3 Fixed Exception when using Request 2016-11-25 02:04:42 +01:00
Simon Sessingø
c6bce8a420 Development
- Began work on new documentation.
- BaseCsrfVerifier now only matches `POST`, `PUT` and `DELETE`.
- Parameters are now parsed on custom regex-matches.
- Added `$type` option to `get` method in `Input` class.
2016-11-25 01:53:02 +01:00
Simon Sessingø
abe427ff59 Development
- Optimised Input and Input-related features.
- Removed InputCollection class.
- Changed more foreach to for.
- Updated documentation.
2016-11-24 22:44:58 +01:00
Simon Sessingø
258e0e0f13 Optimisations + bugfixes 2016-11-24 09:36:10 +01:00
Simon Sessingø
8f33cc1a39 Development 2016-11-19 04:41:29 +01:00
Simon Sessingø
ed1ac74e7a Development
- Fixed updatae causing middlewares to sometimes load on wrong routes.
- Converted project to PSR/2.
- Updated InputCollection class and added get method for easy access to values.
- Complete refactor of RouterBase.
- Added findRoute method to RouterBase.
- It's now possible to change parameter modifiers and symbol by overwriting properties on RouterBase.
- Added RouterUrlTest unit-test for testing route-urls.
- Added IRestController that can be easily implemented in custom ResourceController-classes.
- It's now possible to use "-" instead of "_" when using getHeader method in Request class.
- Added PHPDocs.
- Fixed "/" route sometimes returning "//" as url.
- Optimisations and bugfixes.
2016-11-19 02:48:19 +01:00
Simon Sessingø
d5e7a13d89 Development + bugfixes 2016-11-15 03:43:26 +01:00
Simon Sessingø
28ffa30d3e Development
- all() in Input class now returns correct array.
- all() now supports json data.
- Minor bugfixes.
2016-11-08 18:21:21 +02:00
Simon Sessingø
8740db9582 Development
- Isolated Http classes from router.
- Removed getInstance from Request object - current router request should now be obtained through SimpleRouter::request().
- Fixed broken test cases.
- Added test for regular expression match.
- Updated documentation to reflect changes.
- Added more helper examples to documentation.
- Added helpers to demo-project.
- Optimisations.
2016-11-07 04:40:28 +01:00
Simon Sessingø
035a5b1629 Development
- Added support for cloudflare when using getIp method in Request.
- Fixed undefined variable notice in RouterBase class.
2016-11-05 23:07:14 +01:00
Simon Sessingø
832aff0358 Optimised for cli-usage 2016-10-28 07:40:51 +02:00
Simon Sessingø
1a9351c690 - Fixed notifications if included in projects running in command-line where certain variables aren't available. 2016-05-01 00:02:42 +02:00
Simon Sessingø
ec355c90b5 Removed old input method from Request class. 2016-04-15 23:20:16 +02:00
Simon Sessingø
17adfb8aa4 [FEATURE] Added Input classes from pecee-framework.
- Updated documentation to reflect new changes.
2016-04-15 23:07:51 +02:00
Simon Sessingø
3da7c4b446 - Fixed getIp in HttpRequest class not picking up local-ip.
- Made setdefaultNamespace method chainable.
- Simplified SimpleRouter class.
2016-04-11 22:37:15 +02:00
Simon Sessingø
1bafbab56b [TASK] Moved RouterException. Readded lost stuff from Request. 2016-03-19 16:27:25 +01:00
Simon Sessingø
b29f2ce37d [FEATURE] Added custom boot managers 2016-03-19 16:14:36 +01:00
Simon Sessingø
5483ffe458 [TASK] Readded group match inheritence .
- Settings on routes now have higher priority when merging settings from
  group.
2016-03-18 17:43:57 +01:00
Simon Sessingø
c4fcf750d4 Added support for x-forwarded-proto http header 2016-03-14 01:09:35 +01:00
Simon Sessingø
aeacda1812 [FEATURE] Added option to change route and get information about current
route through the Request object.

- Updated documentation to relfect new changes.
2016-01-15 11:06:13 +01:00
Simon Sessingø
849749969d [OPTIMISATION] Made getAllHeaders protected. 2015-12-19 20:20:42 +01:00
Simon Sessingø
c37a7159d2 [OPTIMISATION] No reason to str_replace twice. 2015-12-19 20:18:35 +01:00
Simon Sessingø
df2545dd37 [TASK]
- Added support for setups where getallheaders function is not availible.
- Made matchDomain method in RouterGroup always return boolean.
2015-12-19 20:15:10 +01:00
Simon Sessingø
19dc295199 [FEATURE] Added getIsSecure method to Request class. 2015-11-18 19:19:15 +01:00
Simon Sessingø
3fc81b6492 [TASK] Readded Pecee folder. 2015-11-02 08:08:49 +01:00
Simon Sessingø
b400b86322 [TASK] Removed Pecee folder. 2015-11-02 08:06:49 +01:00
Simon Sessingø
3dd9dba029 [FEATURE] All headers in Request class now has lowercased keys. 2015-11-01 10:13:00 +01:00
Simon Sessingø
aca7d3d503 [FEATURE] Added magic method getters and setters, and made request a
singleton applied configuration can be availible from everywhere.
2015-11-01 07:44:13 +01:00
Simon Sessingø
5e5a424ee8 [BUGFIX] Bugfixes
- getUri() method in Request class no longer appends "/".
- Optimised parseParameters method in RouterRoute class for regex matches.
2015-10-25 15:29:14 +01:00
Simon Sessingø
f5597c24ce [FEATURE] Added getInput method to return request items. 2015-10-22 21:13:54 +02:00
Simon Sessingø
b8061f2aa7 [TASK] Added getUserAgent and getReferer methods to Request class. 2015-10-22 21:04:52 +02:00
Simon Sessingø
6c7ac2b250 [TASK] Added ip method to Response class. 2015-10-22 21:01:26 +02:00
Simon Sessingø
1ba05b923c [FEATURE] Csrf token
- Added functionality to CsrfToken class.
- Added header support to Request class.
- Added option to set BaseCsrfVerifier class in RouterBase and
  SimpleRouter.
2015-10-21 18:12:53 +02:00
Simon Sessingø
8959a237f9 [FEATURE] Minor features
- Added basic auth to Response class.
- Added getPassword() method for basic auth password in Response class.
2015-10-21 15:09:32 +02:00
Simon Sessingø
b3b362a9e6 [BUGFIX] Improvements
- Fixed errors with getRoute method.
- Added Response and Request classes.
- Added CSRF stuff.
- Cleanup and bugfixes.
2015-10-18 17:36:06 +02:00