Minimal PSR/composer based framework. Utilises defined PSR standards where possible and aims to keep dependencies to a minimum.
- PHP 8.3 +
- MySQL/Maria 15.1+
- interwebs! uses various CDN libraries
- SCSS if you wish to compile the css from sources
- local webserver : apache2 (due to the current .htaccess requirement) or even just PHP's build in webserver
- clone this repo
- in the root dir run
composer install - navigate to /example and run
composer install - setup hosts/vhosts (as required) pointing to /example/public
- copy config.ini.sample to /example/config.ini and update as necessary
- create a local database using the scripts in /example/sql
- mount /example/public browse away using your local webserver of choice (see below)
- to view the admin area you will need to create an admin user via cli.php
php cli.php add-user {email} {password}
- highly PSR compliant
- highly composer based ... uses the composer autoloader with additional PSR4 support
- the example has auto/magic image resizing ... place an image in /image then use {image_name}{width}{height}.{extension} for intervention to resize it!
- as mentioned uses various CDN distributed libraries
- dedicated CLI bootstrap
- add a PSR-15 based middleware support with a couple of example implementations
- further unit/acceptance tests
- rename /image to /images!!
Run the unit & acceptance tests like this:
./codecept run
Additionally generate a coverage report (to /_output/coverage) like this:
./codecept run --coverage --coverage-html
You can view the example using PHP's built in webserver, something like this:
php -S localhost:8000 example/public/router.php
If you have valet installed then on the command line go to gaffer/example/public and add a valet link
valet link gaffer
If using apache then just mount gaffer/example/public as a VirtualHost and it wil use the provided .htaccess If using nginx then you'll need both mount gaffer/example/public and rewrite traffic to index.php using try_files
During coverage report generation you may see this error:
XDEBUG_MODE=coverage or xdebug.mode=coverage has to be set
If so then you can either run it like this
XDEBUG_MODE=coverage && ./codecept run --coverage --coverage-html
or update your php.ini settings for xdebug with multiple available modes like this
xdebug.mode=develop,debug,coverage
... and then restart php-fpm
Any security issues spotted please email developers@newicon.net