A Rapid development PHP API framework
Welcome to Fony API PHP framework. The whole idea of this project is to allow the fast development of APIs or PoC over data definitions.
- Initialize your project using Composer:
$ composer init
- Add the fony dependency:
$ composer require geekcow/fony
- Add the installation script into the
composer.json
file:
"scripts": {
"setup-fony": "Geekcow\\Fony\\Installer\\Setup::init"
}
- Proceed to the installation script:
$ composer run-script setup-fony
Currently Fony API has support for apache
and mysql
. However there is work in progress for nginx
and multiple DBMS (via dbCore)
Also need to have installed mod_rewrite
module for Apache
Additionally, need to have the following changes in your directory configuration for your virtual server in Apache:
<Directory /var/www/yourfolderlocationforyourproject>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Note we removed the Indexes
option from the directory, in order to not display the tree view.
You can now run a local instance of your built API using a shell command in your root folder
$ ./fony-serve.sh {PORT}
The default port is 8080
but you can customize your own port
If you cannot execute the shell command, you can manually use the php command to serve your own application.
You need to be aware as Fony overrides the URL requests, you need to use the custom router for the built-in PHP server.
The router is included as a hidden file as .router.php
in your root folder.
$ php -S localhost:8080 .router.php
There is some work creating a docker image to host your Fony implementation. That will be available soon.
June 2020: There is still a lot of work to do.
- Unit tests are not done
- Tooling is still in progress
- I want to add a sample of a complete implementation in the Installer.
- Wiki only has titles.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request