fas / example
Example using fas
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:template
Requires
- fas/configuration: ^0.2
- fas/di: ^0.4
- fas/routing: ^0.7
- filp/whoops: ^2.13
- laminas/laminas-diactoros: ^2.6
- laminas/laminas-httphandlerrunner: ^1.4
- laminas/laminas-stratigility: ^3.4
Requires (Dev)
- phpmd/phpmd: ^2.10
- phpunit/phpunit: ^9
- squizlabs/php_codesniffer: ^3.6
README
Installation
composer create-project fas/example myproject
Usage (dev mode)
docker-compose up --build -d
Files
cache/ # contains precompiled container, routes, preloads, etc.
coverage/ # phpunits test coverage in html
docker/apache.conf # apache configuration
docker/php.ini # general php configuration
docker/prod.sh # init script for docker container in prod mode
docker/php.dev.ini # php overrides for dev mode
docker/dev.sh # init script for docker container in dev mode
public/.htaccess # standard htaccess for sending requests to index.php
public/index.php # entrypoint for php application
src/ContainerFactory.php # di container setup
src/RouterFactory.php # routes setup
bin/compile.php # script for compiling container and routes for prod
bin/compile.config.php # script for compiling configuration for prod
bin/preload.php # preload entry point for production
bin/preload.app.php # preloads specific to this application
config.yaml # custom configuration file for your project
config.prod.yaml # example of could-be prod config file
Simplest form
If not using docker, compiled builds or tests, the code sums down to this:
public/.htaccess # standard htaccess for sending requests to index.php
public/index.php # entrypoint for php application
src/ContainerFactory.php # di container setup
src/RouterFactory.php # routes setup
Create prod build
docker build -t fas:prod --target prod .
Run the prod build
docker run -d --name fas --rm -it -p8081:80 -v`pwd`/config.yaml:/app/config.yaml:ro fas:prod