Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/avishwakarma/php-api
PHP API setup
https://github.com/avishwakarma/php-api
Last synced: about 1 month ago
JSON representation
PHP API setup
- Host: GitHub
- URL: https://github.com/avishwakarma/php-api
- Owner: avishwakarma
- Created: 2015-06-28T20:39:53.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-29T00:19:08.000Z (over 9 years ago)
- Last Synced: 2023-03-29T13:29:25.506Z (almost 2 years ago)
- Language: PHP
- Size: 160 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
API
=======
A Powerful MySQL wrapper bind with few custom classes to achieve simple and powerful architecture for json based PHP/MySQL application, best for developing RESTful APIs for AngularJS, BackboneJs and other JavaScript MVC frameworks.Files
=======
* `api/config/config.php` store mysql database configurations also can be used store other application configuration* `api/controllers/base.php` base controller for the application
* `api/controllers/sample.php` sample controller for example of basic operations
* `api/lib/Inflector.php` inflector class for pluralize and singularize table names
* `api/lib/mysql.php` mysql query wrapper for database operations, find the [documentation](https://github.com/akvlko/phpmysql) here
* `api/lib/Session.php` session helper class to manipulate with PHP SESSION
* `api/mailer/*.php` PHPMailler library [Documentatiuon](https://github.com/PHPMailer/PHPMailer)
* `api/app.php` application bootstrapper/dispatcher class which parse the request URLs and dispatch the same to its corresponding controller and action
* `api/autoload.php` autoloader for controllers and libraries
* `api/index.php` landing file for all requests
* `.htaccess` apache rewrite rules, convert URLs to query string
Setup
=======
Make sure that the apache `re-write` module is enabledPut the `api` directory into the projects `root` directory and configure the `api/config/config.php` with the MySQL database credentials.
URL structure
=======
The REST URL structure will be as follows`http://your_base_path/api/controller/action` for example URL `http://mysite.com/api/user/all` will be dispatched to `all` method of `user` controller class