-
Notifications
You must be signed in to change notification settings - Fork 97
#17 upgrade to slim 4 #18
base: slim-4
Are you sure you want to change the base?
#17 upgrade to slim 4 #18
Conversation
- upgrade required php version to >=7.2 - upgrade slim up to v4.0 - remove slim/php-view since there is no need for templates - add nyholm/psr7 and nyholm/psr7-server to handle HTTP abstraction - add PHP-DI for dependency management as substitute of Pimple
- remove service providers - add boot.php file to start bootable services (db)
- migrate callable middleware to psr-15 interface implementations - add definitions in container
- fix stable version of phinx - update JWT middleware to v3 (psr-15)
- update htaccess to handle Authorization header instead of HTTP_AUTHORIZATION - update functional tests - update OptionalAuth
- build app from container - add new home page route without renderer - indent new settings section - fix validator declaration
- remove session from validator - remove slim 3 specific HTTP messages method calls - JWT in request in an array instead of object
- fix action methods signatures - fix doc blocks - all controllers now extends from BaseController - use getParsedBody() and getQueryParams() to retrieve request data instead of specific 'getParam()' from Slim 3 ServerRequest object - update response generation with methods from BaseController which uses the application ResponseFactory implementaion
when offset is present the SQL count were returning an empty set, to fix it we have to count the articles before defining the offset clause in query builder
Thanks @gustavofabiane for your contribution and the great work, and apologies for my delay :( I run the test suits and run the app with vue frontend, everything works fine. It would be great if @EricSimons could assign the repo to someone else from the slim community or perhaps @gustavofabiane can take over. |
Hello, I just upgraded the readme.md with the changes that affected some application core, since Slim 4 are decoupled from another libraries (besides FastRoute), the main changes affected the way middleware, settings, routes and dependencies are declared. PHP-DI also uses autowire so the Container don't need to be injected in controllers. BaseController now has a constructor that resolves the application dependencies, as the project is an example we can keep it simple. @alhoqbani There still points where we can do some improvements. I don't have much time either but I can contribute whenever I can. |
#17 Update the application to Slim 4.
Note: I'm opening the PR as draft and will update the readme.md and docs/ soon.
Tests suites are OK, also tested with React + Redux Front End.
Postman collection API Test is running with errors for date format [
Article's "createdAt" property is an ISO 8601 timestamp
] and also fails in register tests because response attributes doesn't match.Also found an issue on article list that the articlesCount were resulting an empty set if the OFFSET clause exists in the query builder so I've adjusted it to count the articles before addins the offset clause.
Fixed validation of timestamps in model transformers which were using undefined variable
$user
New dependencies: