zendframework / zend-expressive-skeleton
Zend expressive skeleton. Begin developing PSR-15 middleware applications in seconds!
Installs: 53 594
Dependents: 0
Suggesters: 0
Security: 0
Stars: 151
Watchers: 50
Forks: 102
Open Issues: 6
Type:project
Requires
- php: ^7.1
- zendframework/zend-component-installer: ^2.1.1
- zendframework/zend-config-aggregator: ^1.0
- zendframework/zend-diactoros: ^1.7.1 || ^2.0
- zendframework/zend-expressive: ^3.0.1
- zendframework/zend-expressive-helpers: ^5.0
- zendframework/zend-stdlib: ^3.1
Requires (Dev)
- composer/composer: ^1.5
- elie29/zend-phpdi-config: ^3.0
- filp/whoops: ^2.1.12
- jsoumelidis/zend-sf-di-config: ^0.3
- mikey179/vfsstream: ^1.6.5
- northwoods/container: ^3.0
- phpstan/phpstan: ^0.9.2
- phpstan/phpstan-strict-rules: ^0.9.0
- phpunit/phpunit: ^7.0.1
- roave/security-advisories: dev-master
- squizlabs/php_codesniffer: ^2.9.1
- zendframework/zend-auradi-config: ^1.0
- zendframework/zend-coding-standard: ~1.0.0
- zendframework/zend-expressive-aurarouter: ^3.0
- zendframework/zend-expressive-fastroute: ^3.0
- zendframework/zend-expressive-platesrenderer: ^2.0
- zendframework/zend-expressive-tooling: ^1.0
- zendframework/zend-expressive-twigrenderer: ^2.0
- zendframework/zend-expressive-zendrouter: ^3.0
- zendframework/zend-expressive-zendviewrenderer: ^2.0
- zendframework/zend-pimple-config: ^1.0
- zendframework/zend-servicemanager: ^3.3
- zfcampus/zf-development-mode: ^3.1
- dev-master / 3.2.x-dev
- dev-develop / 3.3.x-dev
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.0
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 3.0.0rc4
- 3.0.0rc3
- 3.0.0rc2
- 3.0.0rc1
- 3.0.0alpha3
- 3.0.0alpha2
- 3.0.0alpha1
- 2.2.0
- 2.1.0
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 1.0.0rc8
- 1.0.0rc7
- 1.0.0rc6
- 1.0.0rc5
- 1.0.0rc4
- 1.0.0rc3
- 1.0.0rc2
- 1.0.0rc1
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.0
- 0.3.0
- 0.2.0
- 0.1.1
- 0.1.0
This package is auto-updated.
Last update: 2020-01-20 17:57:31 UTC
README
Repository abandoned 2019-12-31
This repository has moved to mezzio/mezzio-skeleton.
Begin developing PSR-15 middleware applications in seconds!
zend-expressive builds on zend-stratigility to provide a minimalist PSR-15 middleware framework for PHP with routing, DI container, optional templating, and optional error handling capabilities.
This installer will setup a skeleton application based on zend-expressive by choosing optional packages based on user input as demonstrated in the following screenshot:
The user selected packages are saved into composer.json
so that everyone else
working on the project have the same packages installed. Configuration files and
templates are prepared for first use. The installer command is removed from
composer.json
after setup succeeded, and all installer related files are
removed.
Getting Started
Start your new Expressive project with composer:
$ composer create-project zendframework/zend-expressive-skeleton <project-path>
After choosing and installing the packages you want, go to the
<project-path>
and start PHP's built-in web server to verify installation:
$ composer run --timeout=0 serve
You can then browse to http://localhost:8080.
Linux users
On PHP versions prior to 7.1.14 and 7.2.2, this command might not work as expected due to a bug in PHP that only affects linux environments. In such scenarios, you will need to start the built-in web server yourself, using the following command:
$ php -S 0.0.0.0:8080 -t public/ public/index.php
Setting a timeout
Composer commands time out after 300 seconds (5 minutes). On Linux-based systems, the
php -S
command thatcomposer serve
spawns continues running as a background process, but on other systems halts when the timeout occurs.As such, we recommend running the
serve
script using a timeout. This can be done by usingcomposer run
to execute theserve
script, with a--timeout
option. When set to0
, as in the previous example, no timeout will be used, and it will run until you cancel the process (usually viaCtrl-C
). Alternately, you can specify a finite timeout; as an example, the following will extend the timeout to a full day:$ composer run --timeout=86400 serve
Troubleshooting
If the installer fails during the composer create-project
phase, please go
through the following list before opening a new issue. Most issues we have seen
so far can be solved by self-update
and clear-cache
.
- Be sure to work with the latest version of composer by running
composer self-update
. - Try clearing Composer's cache by running
composer clear-cache
.
If neither of the above help, you might face more serious issues:
- Info about the zlib_decode error.
- Info and solutions for composer degraded mode.
Application Development Mode Tool
This skeleton comes with zf-development-mode. It provides a composer script to allow you to enable and disable development mode.
To enable development mode
Note: Do NOT run development mode on your production server!
$ composer development-enable
Note: Enabling development mode will also clear your configuration cache, to allow safely updating dependencies and ensuring any new configuration is picked up by your application.
To disable development mode
$ composer development-disable
Development mode status
$ composer development-status
Configuration caching
By default, the skeleton will create a configuration cache in
data/config-cache.php
. When in development mode, the configuration cache is
disabled, and switching in and out of development mode will remove the
configuration cache.
You may need to clear the configuration cache in production when deploying if you deploy to the same directory. You may do so using the following:
$ composer clear-config-cache
You may also change the location of the configuration cache itself by editing
the config/config.php
file and changing the config_cache_path
entry of the
local $cacheConfig
variable.
Skeleton Development
This section applies only if you cloned this repo with git clone
, not when you
installed expressive with composer create-project ...
.
If you want to run tests against the installer, you need to clone this repo and
setup all dependencies with composer. Make sure you prevent composer running
scripts with --no-scripts
, otherwise it will remove the installer and all
tests.
$ composer update --no-scripts
$ composer test
Please note that the installer tests remove installed config files and templates before and after running the tests.
Before contributing read the contributing guide.