Festi CLI
Festi CLI is the name of the command-line interface included with Festi Framework. It provides a number of helpful commands for your use while developing your application.
To use CLI tools, you need to install the festi-team/festi-framework-cli package:
{
"require": {
"festi-team/festi-framework-cli": "dev-develop"
}
}
- Installer
- DSG Converter
- Plugin Manager
- Database Migration
- Database Migration Creator
- React Manager
- Locale Manager
Getting Help
Every command answers --help (or -h) with its usage, options and examples, and ends with the list of all
festi-* commands. Help works from any directory: it never prompts, reads config.php or connects to a database.
./vendor/bin/festi-migrate --help
./vendor/bin/festi-plugin -h
For a command with modes (festi-plugin, festi-react, festi-locale), add --mode to see that mode's options:
./vendor/bin/festi-plugin --help --mode exec
Verbose Output
Every command also accepts --verbose (or -v). A normal run shows only the progress messages; a verbose run adds
debug lines: the shell commands run and their output, each SQL statement a migration executes, the project config
and database driver used, the files written, the migrations skipped as already applied, and the stack trace when the
command fails. Credentials are never printed -- they reach database clients through the environment, not the command.
./vendor/bin/festi-migrate --path ./src/admin/ -v
./vendor/bin/festi-install --verbose
--verbose=n (also false, 0, no) keeps it off, which is how the installer's --verbose y|n keeps working.
Installer
The Installer tool enables you to install the framework automatically.
If you use a passphrase, you must first add your password to the keychain using
/usr/bin/ssh-add -K.
Installation using Composer.
Follow these steps to install the framework:
- Create a
composer.jsonfile:
{
"name": "your_company/project_name",
"description": "Description",
"repositories": [
{
"type": "composer",
"url": "https://packages.festi.io/"
}
],
"require": {
"php": ">=8.1",
"festi-team/festi-framework-core": "dev-develop",
"festi-team/festi-framework-database": "dev-develop",
"festi-team/festi-framework-cli": "dev-develop"
},
"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.*"
}
}
- Run the following command to install dependencies:
composer install
- Remove composer.lock
- Run the following command to install the essential components for your project:
php ./vendor/bin/festi-install
Installation Types
You can choose from several installation types:
| Type | Description |
|---|---|
dashboard |
installs the Jimbo system plugin, which is mainly for the administration panel (default). |
site |
installs the Jimbo system plugin and the Contents plugin. |
api |
installs the RESTful system plugin and sets up the framework to work as a RESTful API |
rpc |
installs the Rpc system plugin and sets up the framework to work as a RPC API. |
async |
installs the Festi Async Framework for creating asynchronous services for IoT, Game, Data Streaming, etc. |
During installation, you will be prompted to install demo content. If you agree, basic settings and routing for login/registration will be created. In most projects, this is required, so it is recommended to agree.
Writing your own installation type
InstallerTool resolves a type by looking for ucfirst($installType)."Installer"
in the global namespace, so class MyThingInstaller extends Installer plus
--install_type mything is a supported way to add one.
Only these hooks are part of the contract. Override what you need and leave the rest alone:
| Hook | Purpose |
|---|---|
getDefaultThemeName() |
Theme to check out, or null for none. |
getSystemPluginScm() |
Repository of the system plugin. |
getExternalPlugins() |
Extra plugins, as name => repository. |
getDatabaseSchemeFiles() |
Schema dumps to build the migration from. |
getExternalInstallDatabaseSchemePath() |
An extra dump outside the plugin. |
getInstallFilesPaths() |
Directories to copy into the project. |
hasDemoContent() / getDemoPath() |
Whether there is demo content, and where. |
migration() |
How the database is migrated at the end. |
onPrepareOptions() / onStart() |
The options asked for, and the flow itself. |
Everything else protected on Installer is internal. The install mechanics live
in collaborators — InstallPaths, ProjectDirectory, SubmoduleRepository,
ComposerRunner, MigrationScriptWriter and DatabaseCredentials — and are
reached through the installer rather than inherited from it.
Methods that used to be on Installer and moved into those collaborators are
still available through the DeprecatedInstallerApi trait, so an existing custom
installer keeps working. They are deprecated and will be removed in 8.0.
Two are already gone rather than deprecated: createConnection() and
applyDatabaseScheme(), which had no callers anywhere and were the only reason
the installer referenced PDO.
Host Configuration
To properly configure the domain, it should either:
- Point directly to
[PROJECT_NAME]/src/[dashboard|api|site|service|rpc], or - Be set as a symbolic link to the appropriate directory.
Creating a Symbolic Link
Use the following command to create a symbolic link for the domain:
ln -s /path/to/your_project/src/dashboard /home/[USER_NAME]/my-domain.siter.festi.dev
or in the home directory:
ln -s your_project/src/dashboard my-domain.siter.festi.dev
Example Directory Structure
If your virtual host is configured to point to /home/[USER_NAME]/my-domain.siter.festi.dev, the directory structure should look like this:
/home/[USER_NAME]/
│── your_project/
│ ├── dumps/
│ ├── src/
│ │ ├── dashboard/
│ │ ├── api/
│ │ ├── site/
│ │ ├── service/
│ │ ├── rpc/
│ ├── ...
│── my-domain.siter.festi.dev -> your_project/src/dashboard
Install via console with options
Use the following command to install the framework via the console with options:
php vendor/bin/festi-install --db_username [USERNAME] --db_password [PASSWORD] --db_name [NAME] --install_path [PATH]
Here are some available options:
| Option | Description |
|---|---|
--db_username |
the database username. |
--docker |
set to y to install with generate docker files. |
--force |
y to reinstall over an existing project (see Reinstalling with --force). |
--install_path |
path to folder where you do want to install a project. |
--install_type |
this option determines the type of installation to perform. |
--db_host |
the hostname of the database server. |
--db_username |
the username to use when connecting to the database. |
--db_password |
the password to use when connecting to the database. |
--db_name |
the name of the database to use. |
--db_type |
the type of database to use, such as mysql or pgsql. |
--db_port |
the port number to use when connecting to the database. |
--timezone |
the timezone to use for the PHP installation. |
--is_install_demo |
set to y to install basic settings and routing for login/registration . |
--site_host |
the hostname of the site. |
--dashboard_base_http |
the base URL of the dashboard. |
--scm_host |
the hostname of the SCM repository. |
--verbose, -v |
print every command the installer runs and its output (see Verbose Output). |
--docker_php_version |
the version of PHP to use when installing with Docker. |
--docker_server |
the server to use when installing with Docker. |
--docker_swoole_version |
the version of Swoole to use when installing with Docker. |
--docker_service_host |
the service host for async type of project when installing with Docker. |
--docker_service_port |
the service port for async type of project when installing with Docker. |
Reinstalling with --force
Without --force the installer refuses a folder that already holds a project (Instance have installed already.).
With --force y (or true; n keeps it off) it first removes the previous installation, then installs from scratch:
- Removed from the folder: only what the installer creates --
.git,vendor,src,plugins,docker,dumps,composer.json,composer.lock,.gitmodules,.gitignore. Anything else you keep there survives. - Dropped from the database: every table (and, on PostgreSQL and MSSQL, the views, enum types and constraints)
of the configured database, before the migrations run. This cannot be undone; point
--db_nameat the right database. A Docker install is not affected, since its database container starts empty. - Refused: a folder that does not exist,
/, and your home directory -- nothing is removed there.
Add -v to see each removed item and the tables dropped.
Docker files
With --docker y the project gets a docker/ folder; start it with docker compose up --build from there. The PHP
container runs as www-data, not root. So that the mounted project stays writable on a Linux host, www-data takes
your user's UID and GID when the image is built, 1000 by default. If yours differ, export them first:
export UID GID=$(id -g)
docker compose up --build
Apache listens on port 8080 inside the container, and the site is served on http://localhost:8000.
Override parameters vie environment variables
You can override parameters using environment variables. For example, you can set:
MYSQL_PATH - path to mysql client
export MYSQL_PATH=/usr/local/opt/mysql-client/bin/mysql
DSG Converter
Enables conversion of a database table to DGS (XML/Array (JSON)) and vice versa.
Usage
./vendor/bin/festi-dgs
Just answer the questions and get the result.
If you need to run with a different version of PHP:
/opt/php80/bin/php ./vendor/bin/festi-dgs
You can also launch it by specifying options:
./vendor/bin/festi-dgs --name users --path [PATH_TO_PROJECT] --definition-path [PATH_TO_DEFINITION_DIR] --type dgs --format xml
This will give you a dgs file [PATH_TO_DEFINITION_DIR]/users.xml created from the table with the name users.
./vendor/bin/festi-dgs --name active_users --definition-path [PATH_TO_DEFINITION_DIR] --type table
This will create a table with the name specified in the name option, using the DGS definition file [PATH_TO_DEFINITION_DIR]/active_users.xml to obtain the schema of the table.
Options Summary
| Option | Description |
|---|---|
name |
table name |
definition-path |
path to create or retrieve DGS definition file |
path |
path to the project root (optional parameter, if not specified, the file will be searched for in the project root). |
config |
path to the project config.php (optional parameter, if not specified, the file will be searched for in the project root). |
type |
what to generate:
|
format |
output file format (xml/array) (optional parameter, defaults to xml). Only works when using dgs type. |
primary-key |
column name for default primary key. Default value is id. |
You can specify either an absolute path (e.g., /home/user/project) or a path relative to the project root (e.g., path/to/project).
DGS Action Executor
Executes a DGS action (insert, edit, remove, list, or any custom action) from the command line against a live Festi project.
Usage
./vendor/bin/festi-dgs-exec
Just answer the questions and get the result as JSON.
You can also launch it by specifying options:
./vendor/bin/festi-dgs-exec --plugin Pages --dgs pages --action list --path [PATH_TO_PROJECT]
Insert a row:
./vendor/bin/festi-dgs-exec --plugin Pages --dgs pages --action insert --values '{"title":"Home","url":"/"}' --path [PATH_TO_PROJECT]
Use a custom system plugin (e.g. when the DGS preamble calls Core::getSystemPlugin()):
./vendor/bin/festi-dgs-exec --plugin Pages --dgs pages --action list --system-plugin MySystemPlugin --path [PATH_TO_PROJECT]
Options Summary
| Option | Description |
|---|---|
plugin |
Plugin name that owns the DGS (required) |
dgs |
DGS identifier — XML filename without .xml inside the plugin's tblDefs/ directory (required) |
action |
Action to execute: insert, edit, remove, list, info, or any custom action defined in XML (required) |
values |
JSON object of field values, e.g. '{"name":"Example"}' (optional, defaults to {}) |
format |
Output format: json (default) or html |
system-plugin |
Plugin to register as the system plugin (optional, defaults to Jimbo). Required when the DGS has PHP preambles that call Core::getSystemPlugin(). |
path |
Path to the project root (optional, defaults to current working directory) |
config |
Path to the project config.php (optional, defaults to [path]/config.php) |
Plugin Manager
The Plugin Manager allows creating plugins and their methods (including routing).
Modes
| Mode | Description |
|---|---|
create |
Creates a folder for the plugin and everything necessary for it. |
url |
Adds a method to the plugin and entries in the festi_url_rules and festi_url_rules2areas tables. |
dgs |
Creates DGS, adds a method for displaying DGS to the plugin and entries in the festi_url_rules and festi_url_rules2areas tables. |
exec |
Invokes a public method on a plugin instance from the command line, with optional JSON-encoded arguments. |
Options Summary
| Option | Description |
|---|---|
mode |
mode |
name |
method's name or table/XML name |
plugin |
plugin's name |
config |
path to the project config.php (optional parameter, if not specified, the file will be searched for in the project root). |
pattern |
RegExp expression for URL |
type |
method type (default, json, ajax) |
area |
the name of the route work area (pulled from festi_url_areas) |
method |
(exec mode) public method on the target plugin to invoke |
args |
(exec mode) JSON list or object of arguments; list spreads positionally, object binds as named arguments |
create mode
In this mode, a folder will be created for the plugin and everything necessary for it:
plugins/[PLUGIN_NAME]/[PLUGIN_NAME]Plugin.phpplugins/[PLUGIN_NAME]/[PLUGIN_NAME]Object.phpplugins/[PLUGIN_NAME]/init.phpplugins/[PLUGIN_NAME]/templates/plugins/[PLUGIN_NAME]/tblDefs/
Examples
./vendor/bin/festi-plugin
- Enter the mode name - create
- Enter the desired plugin name - Expenses
As a result, the following files will be obtained:
plugins/Expenses/ExpensesPlugin.phpplugins/Expenses/ExpensesObject.phpplugins/Expenses/init.phpplugins/Expenses/templates/plugins/Expenses/tblDefs/
Settings can also be specified in launch parameters:
./vendor/bin/festi-plugin --mode create --name Expenses
In addition, the corresponding entry will be added to the festi_plugins table.
url mode
In this mode, will be created DGS, a method will be added to the plugin and entries in the festi_url_rules and festi_url_rules2areas tables.
Method types:
- default - onDisplay[Name]
- ajax - onAjax[Name]
- json - onJson[Name]
Examples
./vendor/bin/festi-plugin
- Enter the mode name - url
- Enter the plugin name - Incomes
- Enter the URL rule - ~^/income/([0-9]+)/$~
- Enter the desired method name - Income
- Enter the route work area - backend
- Enter the method type - default
As a result, the plugin will receive a method:
/**
* @urlRule ~^/income/([0-9]+)/$~
* @section none
* @area backend
* @userType user
*/
public function onDisplayIncome(Response &$response)
{
// code ...
return true;
}
Parameters can also be specified in the launch arguments:
./vendor/bin/festi-plugin --mode url --plugin Incomes --pattern "~^/income/([0-9]+)/$~" --name Income --area backend --type default
dgs mode
In this mode, a method for displaying DGS will be added to the plugin and entries in the festi_url_rules and festi_url_rules2areas tables.
If the XML file is not available, it will be automatically generated from the database table using the DSG Converter.
Examples
./vendor/bin/festi-plugin
- Enter the mode name - dgs
- Enter the table (DGS) name - users
- Enter the plugin name - Users
- Enter the desired URL - ~/admin/users/~
As a result, we will get a file:
- plugins/Users/tblDefs/user.xml
And in the plugin, we will have a method:
/**
* @urlRule ~/admin/users/~
* @section none
* @area backend
* @userType user
*/
public function onDisplayUsers(Response &$response)
{
$store = $this->createStoreInstance("users");
$store->onRequest($response);
return true;
}
exec mode
Invokes a single public method on a plugin instance from the command line. Use this whenever you'd otherwise add a one-off bin script just to call $plugin->doSomething(...) — for example, batch jobs, ad-hoc maintenance, or driving plugin features from CI without writing per-task scaffolding. The mode bootstraps the full Festi runtime, resolves the plugin via Core::getPluginInstance(), runs the method, and prints the return value.
The dispatch guard uses is_callable([$plugin, $method]), which respects calling-scope visibility — only the plugin's genuine public API is reachable. Private, protected, and inherited framework lifecycle methods (e.g. onInitRequest, signinByToken) are rejected with a precise error.
Output marshaling
nullreturn → no output (silent success).- Scalar return (string, int, bool, float) → printed raw.
- Array or object return → printed JSON-encoded with
JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE.
Argument forms (--args)
--args accepts a JSON value:
- Omitted or
[]→ no-argument call:$plugin->method(). - JSON list (e.g.
[2, 5]) → spread positionally:$plugin->method(2, 5). - JSON object (e.g.
{"format":"webp","quality":85}) → spread as PHP 8.1+ named arguments, bound by parameter name (order-independent):$plugin->method(format: 'webp', quality: 85).
Examples
Run a no-arg method:
./vendor/bin/festi-plugin --mode exec --plugin Contents --method bundleAssets
Pass positional arguments:
./vendor/bin/festi-plugin --mode exec --plugin Reports --method generate --args '[2026,3]'
Pass named arguments — order-independent:
./vendor/bin/festi-plugin --mode exec --plugin Images --method optimize --args '{"quality":85,"format":"webp"}'
Options
| Option | Description |
|---|---|
mode |
exec |
plugin |
Plugin name (e.g. Contents, Reports). Resolved via Core::getPluginInstance(). Required (prompted if missing). |
method |
Public method on the plugin. Required (prompted if missing). |
args |
JSON list or object of arguments. Optional; defaults to no arguments. |
path |
Project path. Defaults to the current working directory. |
config |
Path to a custom config.php. Defaults to [path]/config.php. |
Connecting to the database
By default, the config.php file located in the project root is used to establish a database connection.
If you need to use a different file, you need to run the script with the config parameter:
./vendor/bin/festi-plugin --config="cron/config.php"
Database Migration
To migrate the database, follow these steps:
- Create a folder for dumps in the root of the project, for example,
dump:
/dump/init.sql
/dump/updates1.sql
/dump/updates2.sql
/dump/updatesN.sql
- Use the
./vendor/bin/festi-migratecommand:
./vendor/bin/festi-migrate
If the config.php file is not located in the root directory of the repository:
./vendor/bin/festi-migrate --path ./src/admin/
./vendor/bin/festi-migrate --path ./src/admin/ --dump ./dump/
./vendor/bin/festi-migrate --path ./src/admin/ --dump ./dump/ --backup ./backups/
If you need to update the crontab, create a file in the following format:
# CRONTAB
*/5 * * * * %PHP% %PROJECT_PATH%/crons/email_worker.php --id 2
*/5 * * * * %PHP% %PROJECT_PATH%/plugins/Queues/queues.php --id 3 --name Balance
*/5 * * * * %PHP% %PROJECT_PATH%/plugins/Queues/queues.php --id 4 --name Tasks
Then, run the migration with parameters for the crontab:
./vendor/bin/festi-migrate --crontab ./dump/crontab.txt --crontab-user user
You can also update the version of the project's static content (festi_settings->js_version) during the migration by using the --up-static-version option.
See Database Migrations for the full guide to authoring migration files.
Using PHP Scripts for Database Migration
Sometimes pure SQL is insufficient for writing migration queries, especially when data needs to be corrected in production. For such cases, you can create an updatesN.php file containing a class named UpdatesN inherited from core\util\MigrationUpdates:
use core\util\MigrationUpdates;
class Updates2 extends MigrationUpdates
{
protected function onStart(): void
{
$core = Core::getInstance();
$search = array(
'type' => 'catalog'
);
$sql = "SELECT * FROM contents";
$catalogs = $core->db->select($sql, $search);
$removeIDs = array();
foreach ($catalogs as $row) {
if (!empty($row['path']) && !file_exists($row['path'])) {
$removeIDs[] = $row['id'];
}
}
if ($removeIDs) {
$search = array(
'id&IN' => $removeIDs
);
$core->db->delete("contents", $removeIDs);
}
}
}
Docker
If you use database in docker, you should specify the container name:
./vendor/bin/festi-migrate --path ./src/admin/ --dump ./dump/ --backup ./backups/ --docker db_postgres
Also, you need add dumps folder as volume to container:
postgres:
container_name: db_postgres
image: postgres:16.0-alpine
restart: unless-stopped
environment:
POSTGRES_DB: ${DB_DATABASE}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
volumes:
- db_data:/var/lib/postgresql/data:delegated
- ./dumps:/var/www/app/dumps:cached # <-- here
Database Migration Creator
To create a new database migration, use the command:
./vendor/bin/festi-make-migration
The file is created in the project's dumps/ folder and named
updates<unix timestamp>.sql, for example updates1789628617.sql. If the
dumps/ folder does not exist yet, it is created.
Do not rename the file: festi-migrate looks for migrations matching
updates<number>.<sql|php>, and a file with any other name is skipped without
a warning.
If the config.php file is not located in the root directory of the
repository:
./vendor/bin/festi-make-migration --path ./src/admin/
./vendor/bin/festi-make-migration --path ./src/admin/ --dump ./dumps/
An explicitly given --dump must already exist. Unlike the default path it is
not created, because a path that does not exist is almost always a typo, and a
migration written where festi-migrate never looks for it is worse than a
failed command.
The --php option is also available, to create a PHP migration:
./vendor/bin/festi-make-migration --dump ../../dumps/ --php
For convenience you can add a shortcut to composer.json:
{
"scripts": {
"make-migration": "./vendor/bin/festi-make-migration --dump ../../dumps"
}
}
composer make-migration
The migration number is a Unix timestamp rather than a readable date because it
is stored in the schema_migration.version column, which is declared as a
32-bit int in all three supported databases. Ten digits fit there; the fourteen
of YmdHis do not. This stops working on 19 January 2038, and the fix then is
to widen the column to bigint in the three src/migrate/*MigrateAdapter.php
adapters.
Merge Migrations Files
The festi-merge tool simplifies the process of combining multiple migration files into fewer, larger files. This is particularly helpful for improving the speed of database migrations during CI/CD deployments and unit testing.
Usage
To merge migration files, use the following command:
./vendor/bin/festi-merge --path ../../dumps
Options
--path: (Required) The path to the folder containing migration files.--output: (Optional) The path where the merged files will be stored. If not specified, amergedfolder will be created in the input folder.
By merging migration files: - Faster CI/CD Deployments: Consolidated files reduce execution time for database migrations. - Optimized Testing: Accelerates database setup during unit tests. - Improved Development Workflow: Reduces overhead in managing large numbers of migration files.
Utils
CliUtils
Helper class that supports printing messages to the console with a color scheme.
Usage
$tableName = CliUtils::cin("Table Name:");
CliUtils::i("Information");
$type = CliUtils::cin("What do you want to create?", array("a", "b"), "b");
Sometimes you need to mock output/input for unit tests:
CliUtils::$outputCallback = function ($message) {
};
CliUtils::$inputCallback = function (string $label, ?array $enum = null, string $default = '') {
return 'test';
};
CliUtils::d() prints a debug line that is shown only in verbose mode. AbstractTool switches the mode on when a tool
is started with --verbose or -v; a test can do the same with CliUtils::setVerbose(true), and should switch it
back off in tearDown() because the mode is process-wide.
CliUtils::d('SQL: '.$sql); // shown only with --verbose
CliUtils::exception($exp); // message always, stack trace only with --verbose
FAQ
PHP Version Error
If you encounter PHP version errors such as:
PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 5.4.16. in ...
There are two ways to resolve this:
- Update the PHP version on your server to meet the requirements.
- Use an environment variable to specify the path to the required PHP version:
export PHP_PATH="/php_path"
Unit Tests
Local
export DB_HOST=127.0.0.1
cd tests/
../vendor/bin/phpunit Tools/DgsConverterTest.php
Docker
cd tests/docker
make start
docker compose run -e DB_HOST=festi-mysql-db php-cli /var/www/vendor/bin/phpunit -c /var/www/tests/phpunit.xml
The tests install a whole Festi project, thousands of files. The compose file
sets FESTI_TEST_INSTALL_DIR=/tmp/festi-cli-install so that project lives on
the container's own filesystem rather than the macOS bind mount, where writing
and deleting it took tens of seconds per test. Without the variable it goes to
tests/Resources/install/, as it does in CI.
Access to private Festi packages
The Festi packages on packages.festi.io are published without dist archives,
so Composer clones them from gitlab.varteq.com. The test container reaches
them over HTTPS with a read-only token. No credential is built into the image.
- Create a GitLab personal access token with the
read_repositoryscope only (https://gitlab.varteq.com/-/user_settings/personal_access_tokens). - Store it in the macOS login Keychain, which survives a re-clone of the
checkout.
-wwith no value prompts for the token without echoing it:
The Makefile looks it up by both account and service, so the entry has to belong tosecurity add-generic-password -U -a "$USER" -s GITLAB_PAT -w$USERas written above. Three sources are consulted, in this order:
| Order | Source |
|---|---|
| 1 | the environment — GITLAB_PAT=... make start overrides for one run |
| 2 | tests/docker/.env, if you prefer a file |
| 3 | the macOS login Keychain |
Without any of the three, make start stops with an error naming the
chain rather than building an image that cannot clone.
3. Start the stack as usual:
make start
.env is optional: the database values default to the ones in
.env.example, so only the token has to be supplied.
The container entrypoint rewrites the [email protected]: remotes to
HTTPS using that token, so Composer and the installer can clone private
packages. To revoke access, delete the token in GitLab; nothing needs
rebuilding. If you would rather use your own SSH key, forward your agent into
the container instead and leave GITLAB_PAT unset.
5. Run test:
docker compose run -e DB_HOST=festi-mysql-db php-cli /var/www/vendor/bin/phpunit -c /var/www/tests/phpunit.xml /var/www/tests/Tools/DgsConverterTest.php
React Manager
React Manager is a utility that simplifies project creation and deployment workflows. It provides a set of commands that you can use to quickly create new projects from scratch, customize project settings, and deploy your code.
Modes
React Manager has two modes:
| Mode | Description |
|---|---|
create |
This mode creates everything that is necessary for a new project, such as project directories, configuration files, and initial code. |
deploy |
This mode deploys the project to target environment. |
Options Summary
React Manager has several options that you can use to customize its behavior. Here is a summary of the available options:
| Option | Description |
|---|---|
mode |
The mode that React Manager should run in (create or deploy). |
path |
Specifies the path to the root of the project that React Manager should operate on. This is an optional parameter; if not specified, React Manager will search for the project in the current working directory. |
name |
Specifies the name of the project. |
config |
Specifies the path to the project's config.php file. This is an optional parameter; if not specified, React Manager will search for the file in the project root. |
plugin |
Specifies the name of the plugin where necessary code will be appended. |
Example
./vendor/bin/festi-react --mode deploy --name app --path [PATH_TO_PROJECT_DIR]
create mode
This mode creates everything necessary for the project and allows you to append the necessary data to the plugin and database to run the project in the browser.
Examples
To use this mode, run the following command:
./vendor/bin/festi-react
This will prompt you for the following information:
- Enter the mode name -
create - Enter the full project path. If you don't specify a path, the utility will use the current directory -
/path/where/create/project/ - Enter the project name -
app - Enter
yto initialize the project in the plugin and database -y - Enter the path to the config.php file -
../../../config.php - Enter the plugin name -
Services - Enter the method name -
Deafult - Enter the pattern URL -
~/services/~ - Enter the area URL -
backend - Enter the type of method -
json
After you enter all the necessary information, run the following command to install the project dependencies:
npm install
Now you're ready to start working on your project!
deploy mode
This mode deploys the project. Your project should be builded.
Examples
To use this mode, run the following command:
./vendor/bin/festi-react
This will prompt you for the following information:
- Enter the mode name -
deploy - Enter the project path. If you don't specify a path, the utility will use the current directory -
/path/where/create/project/ - Enter the project name -
app
If you created the project using the create mode, you can build the project by running the following command:
npm build
Locale Manager
Locale Manager is a command-line utility that simplifies the process of managing localization files for a project. It allows you to easily initiate a new po file and generate a mo file from it.
Modes
Locale Manager has two modes:
| Mode | Description |
|---|---|
init |
Use this mode to create a new po file for your project. The utility will scan your project files and create a new po file with all the translatable strings it finds. |
generate |
Use this mode to generate a mo file based on an existing po file. The utility will compile the po file into a mo file that can be used in your project. |
Options Summary
| Option | Description |
|---|---|
mode |
Specifies the mode that Locale Manager should run in (init or generate). |
path |
Specifies the path to the root of the project that Locale Manager should operate on. This is an optional parameter; if not specified, Locale Manager will search for the project in the current working directory. |
lang |
Specifies the language you want to create a mo file for. You can specify the language using its ISO 639-1 language code (e.g., en for English, fr for French). |
init mode
This mode creates a new po file for your project.
The utility will scan your project files with extention php, phtml, xml and create a new po file with all the translatable strings it finds.
Also it gets caption from festi_menues and append to po file.
Examples
To use this mode, run the following command:
./vendor/bin/festi-locale --mode=init --path=/path/where/create/project/
This command will initiate a new po file for your project at the specified path at locale folder.
Or you can run the following command:
./vendor/bin/festi-locale
This will prompt you for the following information:
- Enter the mode name -
init - Enter the full project path. If you don't specify a path, the utility will use the current directory -
/path/where/create/project/
generate mode
This mode generates a mo file based on an existing po file. The utility will compile the po file into a mo file that can be used in your project.
Examples
To use this mode, run the following command:
./vendor/bin/festi-locale --mode=generate --path=/path/where/create/project/ --lang=en
This command will generate a mo file for the English language in your project at the specified path at locale folder.
Or you can run the following command:
./vendor/bin/festi-locale
This will prompt you for the following information:
- Enter the mode name -
generate - Enter the full project path. If you don't specify a path, the utility will use the current directory -
/path/where/create/project/ - Enter the language -
en