Installation Festi Project
You can set up a project manually or use Festi CLI.
Installation using composer
composer.json:
{
"name": "your_company/project_name",
"description": "Description",
"repositories": [
{ "type": "composer", "url": "https://packages.festi.io/" }
],
"require": {
"festi-team/festi-framework-core": "dev-develop",
"festi-team/festi-framework-database": "dev-develop",
"festi-team/festi-framework-theme": "dev-develop",
"festi-team/festi-framework-cli": "dev-develop",
"festi-team/festi-framework-di": "dev-master",
"php": ">=8.0"
},
"minimum-stability": "dev",
"autoload": {
"psr-4": {
"": "src"
}
},
"autoload-dev": {
"psr-4": {"": ["tests"]}
},
"require-dev": {
"phpunit/phpunit": "9.*",
"phpunit/php-code-coverage": "9.*",
"phan/phan": "4.x",
"squizlabs/php_codesniffer": "3.*"
}
}
composer install
mkdir src
./vendor/bin/festi-install
Installation options
dashboard(default) - The Jimbo system plugin will be installed.site- The Jimbo system plugin will be installed. Additionally, the Contents plugin will be installed.api- The RESTful system plugin will be installed. The framework will operate in RESTful API mode.async- A project based on Festi Async Framework will be created. For writing asynchronous services for IoT, Games, Data Streaming, etc.
During installation, you will be asked if you want to install demo content. If you agree, basic settings and routing for login/registration will be created. Most projects require this and you should agree.
PHP Configuration
The following php.ini settings are required for correct framework operation:
| Setting | Required Value | Notes |
|---|---|---|
short_open_tag |
Off |
Must be disabled for correct DGS XML format support. When enabled, PHP interprets <? as an opening tag, which breaks XML declarations (<?xml ...?>). |
Example php.ini:
short_open_tag = Off
Host Configuration
The domain should point to [PROJECT_NAME]/src/[dashboard|api|site|async], or be a symbolic link.
For example, if the virtual host points to /var/www/test_user/data/www/my-domain.dev.clients.in.ua, then the structure would be:
/var/www/test_user/data/www/:
- test_project
- core
- dumps
- src
- dashboard
- api
- ...
- my-domain.dev.clients.in.ua -> test_project/src/dashboard
Possible Installation Errors
If there were errors during installation (for example, there was no database connection) then trying to reinstall may cause errors.
If the error is:
Installing [PLUGIN_NAME] Plugin... [ Info ]
'plugins/[PLUGIN_NAME]' already exists in the index [ ERROR ]
It means that the [PLUGIN_NAME] plugin has already been added to the repository as a submodule.
Solution:
1. Remove the corresponding section from the .gitmodules file.
2. Save changes to .gitmodules - git add .gitmodules
3. Remove the corresponding section from .git/config
4. Run git rm --cached path_to_submodule (without the slash).
5. Run rm -rf .git/modules/path_to_submodule (without the slash).
6. Delete the unprocessed submodule files rm -rf path_to_submodule
Now you can try installing again.
Configuration for IIS
For Microsoft IIS server, place the web.config file in the root folder of the project:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?url={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Configuration for Nginx
For nginx server, you need to specify in /etc/nginx/virtuals.conf:
server {
listen 80;
server_name YOUR_HOST.com;
access_log YOUR_PATH/logs/access.log;
error_log YOUR_PATH/logs/error.log;
root YOUR_PATH;
index index.php index.html index.htm;
location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ {
expires max;
log_not_found off;
}
location = /index.php {
root YOUR_PATH;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location / {
rewrite ^ /index.php last;
}
location ~ /\.ht {
deny all;
}
}
Local Development
Setup:
cd docker
# Start local environment
./docker-compose.sh local up -d
# Update composer dependencies
./docker-compose.sh local exec app composer update
# Run tests in the local environment
./docker-compose.sh local exec app vendor/bin/phpunit
Rebuild:
./docker-compose.sh local stop
./docker-compose.sh local up -d --build
Prepare code style:
docker compose -f ./docker-compose.base.yml -f ./environments/local/docker-compose.yml exec app ./vendor/bin/phpcs --config-set installed_paths /var/www/html/.phpcs
docker compose -f ./docker-compose.base.yml -f ./environments/local/docker-compose.yml exec app ./vendor/bin/phpcs -i
The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend and Festi
./docker-compose.sh local exec app bash -c "cd /var/www/html && ./vendor/bin/phpcs --standard=Festi -d memory_limit=1024M --extensions=php --ignore='public/**,**/themes/**,.phan/**,vendor/**' ./"
Prepare a push request:
./docker-compose.sh local exec app bash -c "cd /var/www/html && ./vendor/bin/phpcs --standard=Festi -d memory_limit=1024M --extensions=php --ignore='public/**,**/themes/**,.phan/**,vendor/**' ./"
./docker-compose.sh local exec app ./vendor/bin/phan
./docker-compose.sh local exec -it app bash -c "cd /var/www/html/tests && DB_TYPE=mysql DB_HOST=mysql ../vendor/bin/phpunit"
Coverage:
docker compose -f ./docker-compose.base.yml -f ./environments/local/docker-compose.yml exec -it app bash -c "cd /var/www/html/tests && XDEBUG_MODE=coverage DB_TYPE=mysql DB_HOST=mysql ../vendor/bin/phpunit --coverage-html ./coverage"