Commit Graph

165 Commits

Author SHA1 Message Date
Simon Sessingø e5700477e0 [BUGFIX] Fixed optinal parameters not availible when getting route.
[BUGFIX] Fixed optinal parameters not availible in url.
2015-11-21 19:43:23 +01:00
Simon Sessingø 3b4954821a [FEATURE] Optimised route matching, added optional parameters.
- Optimised route matching. This should be way more officient and also
  seems to fix issues with getting the current route using the getRoute class.

- Added support for optional routes, for example: {id?}.

- Updated documentation to reflect new changes.
2015-11-21 19:31:06 +01:00
Simon Sessingø b930c06683 [BUGFIX] Fixed support for urls like /path/{param}/path 2015-11-20 07:17:49 +01:00
Simon Sessingø 19dc295199 [FEATURE] Added getIsSecure method to Request class. 2015-11-18 19:19:15 +01:00
Simon Sessingø 388c027d04 [BUGFIX] Group will now always be rendered no matter of what prefix is. 2015-11-17 00:55:59 +01:00
Simon Sessingø eb93584d85 [BUGFIX] Fixed routeMatch in RouterEntry not matching routes with multiple
arguments.
2015-11-14 22:21:11 +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ø 889ceaa37f [OPTIMISATION] Fixed Group only loading middleware when initialised. 2015-11-01 10:24:05 +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ø be277f276f [FEATURE] Added support for patch.
- Put now also allow patch request types.
2015-11-01 09:21:47 +01:00
Simon Sessingø f215eaa9cf [BUGFIX] Bugfixes and optimisations
- Fixed support for multiple middlewares using array.
- Fixed match and parameters-match not not being merged when used on group.
2015-11-01 09:11:17 +01:00
Simon Sessingø b3f8910cab [TASK] Removed Middleware class. 2015-11-01 08:28:28 +01:00
Simon Sessingø 8557741083 [FEATURE] Bugfixes and optimisations
- Changed Middleware to interface - as it's easier to inherit and use in
  other frameworks/projects.

- RouterController now loads method based on request-method.

- Changed references to old Middleware abstract class.

- Middleware must now be instance of IMiddleware instead of Middleware
  class.
2015-11-01 08:23:46 +01:00
Simon Sessingø 637b998f02 [TASK] Made RouterBase use singleton HttpRequest class. 2015-11-01 07:48:29 +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ø 846c9e6584 [BUGFIX] Optimised getRoute for custom urls. 2015-11-01 07:36:13 +01:00
Simon Sessingø 649ed28a91 [BUGFIX] Fixed Exceptions due to route null value. 2015-10-30 02:27:44 +01:00
Simon Sessingø a2edc1504c [BUGFIX] Fixed regular expression matching after last release. 2015-10-28 05:04:11 +01:00
Simon Sessingø bc16388613 [OPTIMISATION] Optimised middleware loading and routes. 2015-10-27 17:35:56 +01:00
Simon Sessingø d3ed3a61b5 [BUGFIX] Middlewares are no longer loaded on invalid routes 2015-10-27 16:42:39 +01:00
Simon Sessingø c2cf2334e7 [OPTIMISATION] Optimised router handling - router will now use the order provided when loading routes. 2015-10-27 14:01:19 +01:00
Simon Sessingø f5a32cf520 [BUGFIX] Fixed router paths. 2015-10-27 10:35:57 +01:00
Simon Sessingø 1843ea0594 [BUGFIX] Fixed routes always matching /show/{id} when other routes are added. 2015-10-27 10:29:40 +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ø ac2993f804 [BUGFIX] Bugfixes and optimisations
- When no parameter is recieved, router now returns null instead of empty
  string.
- json method in Response class now stops response after execution.
- Updated composer.json with correct autoload.
2015-10-25 02:34:25 +02:00
Simon Sessingø 2a66350883 [BUGFIX] Fixed missing "/" in getRoute on some rare occasions. 2015-10-24 23:24:06 +02:00
Simon Sessingø 20fc067765 [FEATURE] If no parameters are specified in the route, getRoute will now
add the parameters provided to the method instead.
2015-10-24 23:18:16 +02:00
Simon Sessingø d6bdcbe70c [BUGFIX] Fixed getRoute method in SimpleRouter not being static. 2015-10-23 19:34:27 +02:00
Simon Sessingø b37c73d5dd [FEATURE] Added more features to Response class. 2015-10-22 21:42:33 +02: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ø 63dfbb24af [BUGFIX] Bugfix
- Fixed csrf-token cookie not being set on some paths.
- Changed RouterException in BaseCsrfVerifier to TokenMismatchException.
2015-10-22 19:33:20 +02:00
Simon Sessingø bdb5b2dead [BUGFIX] Fixed missing / in beginning of url in getRoute when route does not exist. 2015-10-22 00:17:49 +02:00
Simon Sessingø 03cac14e8e [FEATURE] Support for custom csrf verifier
- Added support for custom csrf verifier.
- Updated documentation.
2015-10-21 19:07:45 +02:00
Simon Sessingø 9d6a3c328f [TASK] Updated documentation. 2015-10-21 18:30:03 +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ø c221381c02 [FEATURE] csrf token
- Removed request-type prefix when loading methods.
- Optimised csrf token class.
2015-10-21 17:09:31 +02:00
Simon Sessingø 54ae628f4e [BUGFIX] Fixed middleware not loading and giving "class must be instance of Middleware" exception. 2015-10-21 15:22:09 +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ø 58e4eb85bb [BUGFIX] Fixed method not allowed exception.
- Method request type are now checked on all classes in the RouterBase class.
2015-10-21 10:14:21 +02:00
Simon Sessingø 8db60f85a1 [TASK] Updated documentation. 2015-10-21 00:30:00 +02:00
Simon Sessingø 626a3b2f6a [TASK] Changes
- Added support for alias on RouterRoute.
- Added typo in resource (renamed class from Ressource to Resource).
- Added optional settings parameter in most of the methods in the
  SimpleRouter class.
2015-10-21 00:27:47 +02:00
Simon Sessingø 2524428926 [BUGFIX] Bugfixing
- Urls now always returns ending slash when using getRoute().
- Fixed common errors with routing.
- Simplified getRoute method.
2015-10-20 23:54:05 +02:00
Simon Sessingø c1a6c63dc7 [FEATURE/BUGFIX] Improvements
- Added match method to match specific regular expression.
- GetRoute now returns provided controller and method if no match is found.
- Bugfixes and other minor improvements.
2015-10-18 23:18:58 +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
Simon Sessingø b6f0f6899a [TASK] Moved parameter stuff to RouterEntry class. 2015-10-14 20:48:17 +02:00
Simon Sessingø 93d8c26416 [BUGFIX] Fixed router for controller and ressources not matching /something? 2015-10-14 19:55:05 +02:00
Simon Sessingø aec1f5f10c [FEATURE] Features and optimisations
- Added where method to RouterRoute to support custom regular expression matches on routes.
- Moved parameters property to RouterRoute class.
- Added IRouteEntry class.
2015-10-14 13:54:53 +02:00