Download the PHP package thnguyendev/phpcore without Composer
On this page you can find all versions of the php package thnguyendev/phpcore. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thnguyendev/phpcore
More information about thnguyendev/phpcore
Files in thnguyendev/phpcore
Informations about the package phpcore
phpcore 3.0.0
phpcore is a tiny MVC framework to develop web-based applications in PHP. It's simple and easy to use.
Quick start
- Download and install Composer by the following url https://getcomposer.org/download/
-
Create phpcore project by Composer. Execute below commands
-
Configure web server
-
Apache server Modify .htaccess file of project as per following
- Nginx server Insert following codes into your server configuration in nginx.conf
-
-
Create Routes [project folder]/src/server/models/Routes.php
-
Modify startup file [project folder]/src/server/Startup.php
-
Create HomeController [project folder]/src/server/controllers/HomeController.php
- Create a view for HomeController [project folder]/src/server/views/Home.php
Web API
Steps to create a Web API with phpcore framework.
- Follow steps 1 to 3 from Quick start to setup new project.
-
Create Routes [project folder]/src/server/models/Routes.php
-
Modify startup file [project folder]/src/server/Startup.php
- Create an API controller [project folder]/src/server/controllers/api/GetInfoController.php
Use Doctrine ORM to work with Sqlite database
This example will create a Web API that returns data from SQLite with Doctrine, make sure that SQLite PDO has been enabled in PHP configuration.
- Follow steps 1 to 3 from Quick start to setup new project.
-
Modify file [project folder]/composer.json
Run below command in console to update project
-
Create Info class [project folder]/src/server/models/Info.php
-
Create DataService class [project folder]/src/server/services/DataService.php
-
Create database schema with Doctrine command-line interface. First, create configuration file [project folder]/cli-config.php
Then run below command
-
Create Routes [project folder]/src/server/models/Routes.php
-
Modify startup file [project folder]/src/server/Startup.php
- Create an API controller [project folder]/src/server/controllers/api/GetInfoController.php
Firebase jwt authorization
This example demonstrate authentication with Firebase Jwt.
- Follow steps 1 to 3 from Quick start to setup new project.
-
Modify file [project folder]/composer.json
Run below command in console to update project
-
Create AuthorizationService class [project folder]/src/server/services/AuthorizationService.php
-
Create Routes [project folder]/src/server/models/Routes.php
-
Modify startup file [project folder]/src/server/Startup.php
-
Create Authenticate User API controller [project folder]/src/server/controllers/api/AuthenticateUserController.php
- Create an API controller [project folder]/src/server/controllers/api/GetInfoController.php