Requirements
PHP Version
At least 8.2
. Resonance extensively uses the latest PHP features.
Required PHP Extensions
Without those extensions, running the framework is not possible.
extension | symbol | why? |
---|---|---|
Data Structures | ext- |
Data Structures are not only fast, but they have better memory management than the base PHP arrays, which is essential to create stable long-running applications. You can learn more in this article: Efficient data structures for PHP 7 |
Swoole | ext- |
Provides asynchronous features to PHP. Can also be replaced by it's fork - OpenSwoole. |
If you are using Psalm or PHPStan
and you need types then you can install
php-ds/polyfill for php-
and
swoole/ide-helper for swoole
.
php-
polyfill is configured to use the native extension if it's installed,
so if you use both the extension and polyfill, it will effectively provide just
the types. Do not rely on polyfill instead of having the extensions installed,
because the polyfill won't grant you the memory management features, which
is the primary reason behind having the extension here.
Recommended PHP Extensions
Without the recommended extensions, some framework's features won't work at all or would operate at a degraded performance.
extension | symbol | why? |
---|---|---|
Igbinary | ext- |
It's used to serialize and unserialize Sessions. It has a better memory footprint than a basic PHP serialize and allows to use ext- to store the session data. |
Intl | ext- |
Handles date formatting, helps with translations etc. |
Mailparse | ext- |
Only if you want to integrate with Postfix. |
OpenSSL | ext- |
Handles security keys, especially useful for OAuth 2.0. |
Readline | ext- |
Unlocks Console features, formatting, piping etc. |
Redis | ext- |
Redis to handle Sessions |
uuid | ext- |
Faster UUID validation and generation |
Installation
Preferably you should start the project by using
Composer's create-
command:
shell$ composer create-project distantmagic/resonance-project my-project
Alternatively you can manually clone the
distantmagic/resonance-project
repository and run composer install
afterwards. The end result is going to be
identical as using the create-
.
First Use
After installing the project, you should create the config.ini
file
(you can copy config.ini.example
with it's default values)
and then use bin/resonance.php
as an entry
point. After invoking php bin/resonance.php
in the shell, you should see
the list of available commands:
shellResonance Usage: command [options] [arguments] Options: -h, --help Display help for the given command. When no command is given display help for the list command -q, --quiet Do not output any message -V, --version Display this application version --ansi|--no-ansi Force (or disable --no-ansi) ANSI output -n, --no-interaction Do not ask any interactive question -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug Available commands: completion Dump the shell completion script help Display help for a command list List commands generate generate:http-controller Generate http-controller generate:http-responder Generate http-responder static-pages static-pages:build Generate static pages
php bin/resonance.php serve
should start the HTTP server. If you need to,
you can generate the SSL Certificate for Local Development.