### Installing YetiForce Portal Files via Bash Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/8-portal/2-installation-manual/README.md This script automates the download, extraction, and file permission setup for YetiForcePortal2 on a Linux server. It uses `wget` to download the complete zip, `unzip` to extract, and `chown` to set ownership, preparing the files for the web-based installation wizard. Ensure the `yfprod` user and group exist and have appropriate permissions for the target directory. ```bash cd /home/yfprod/html/ wget -O YetiForcePortal2.zip https://github.com/YetiForceCompany/YetiForcePortal2/releases/download/6.4/YetiForcePortal2-6.4-complete.zip unzip YetiForcePortal2.zip rm YetiForcePortal2.zip chown -R yfprod:yfprod /home/yfprod/html/ ``` -------------------------------- ### Installing Chromium on Linux Using a Bash Script Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/3-administrator-guides/17-system-tools/04-pdf/README.md This bash script automates the download and setup of the latest Chromium/Chrome browser on a Linux server. It fetches the most recent revision number, downloads the corresponding `chrome-linux.zip` file from Google APIs, unzips it, and creates a symbolic link named `latest` pointing to the extracted `chrome-linux` directory, making it ready for use. ```Bash #! /bin/bash cd $(dirname $0) LASTCHANGE_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2FLAST_CHANGE?alt=media" REVISION=$(curl -s -S $LASTCHANGE_URL) echo "latest revision is $REVISION" if [ -d $REVISION ] ; then echo "already have latest version" exit fi ZIP_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2F$REVISION%2Fchrome-linux.zip?alt=media" ZIP_FILE="${REVISION}-chrome-linux.zip" echo "fetching $ZIP_URL" rm -rf $REVISION mkdir $REVISION pushd $REVISION curl -# $ZIP_URL > $ZIP_FILE echo "unzipping.." unzip $ZIP_FILE popd rm -f ./latest find chromium/* -type d -ctime +1 -exec rm -rf {} \; ln -s $REVISION/chrome-linux/ ./latest ``` -------------------------------- ### Installing Chromium Dependencies on Debian/Ubuntu using apt-get Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.4.0/3-administrator-guides/17-system-tools/04-pdf/README.md This bash command installs essential libraries and packages required for Chromium to run correctly in a headless environment on Debian-based Linux distributions like Ubuntu. It uses `apt-get` with `--no-install-recommends` to install only the core dependencies, ensuring a minimal setup for the PDF generation engine. ```bash apt-get install -y --no-install-recommends libnss3-tools libatk1.0-0 libatk-bridge2.0-0 libdrm-dev libxkbcommon-dev libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm-dev libasound2 ``` -------------------------------- ### Downloading and Extracting YetiForce Portal Files (Bash) Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.5.0/8-portal/2-installation-manual/README.md This bash script automates the process of downloading the complete YetiForce Portal 2 installation package, extracting its contents, removing the downloaded archive, and setting the correct file ownership. It prepares the server directory for the subsequent web-based installation wizard, ensuring all necessary files are in place and have appropriate permissions. ```bash cd /home/yfprod/html/ wget -O YetiForcePortal2.zip https://github.com/YetiForceCompany/YetiForcePortal2/releases/download/6.4/YetiForcePortal2-6.4-complete.zip unzip YetiForcePortal2.zip rm YetiForcePortal2.zip chown -R yfprod:yfprod /home/yfprod/html/ ``` -------------------------------- ### Connecting to Database Instances - PHP Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/versioned_docs/version-6.5.0/4-developer-guides/3-system-components/3-databases.md This snippet demonstrates how to obtain different database connection instances using `\App\Db::getInstance()`. It shows examples for getting the default connection and specific named connections like 'base', 'log', or 'admin', allowing interaction with various parts of the application's database. ```PHP $db = \App\Db::getInstance(); $db = \App\Db::getInstance('base'); $db = \App\Db::getInstance('log'); $db = \App\Db::getInstance('admin'); ``` -------------------------------- ### Installing Chromium Dependencies on Debian/Ubuntu Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/versioned_docs/version-6.4.0/3-administrator-guides/17-system-tools/04-pdf/README.md This command installs essential libraries and dependencies required for Chromium to run headless on Debian-based systems like Ubuntu. It uses `apt-get` to install packages without recommended additional packages, ensuring a minimal installation. ```bash apt-get install -y --no-install-recommends libnss3-tools libatk1.0-0 libatk-bridge2.0-0 libdrm-dev libxkbcommon-dev libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm-dev libasound2 ``` -------------------------------- ### Installing YetiForce Portal 2 via Bash Console Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.4.0/8-portal/2-installation-manual/README.md This bash script automates the download, extraction, and cleanup of YetiForce Portal 2 installation files. It downloads the complete zip archive, unzips it into the specified directory, removes the downloaded archive, and sets the correct ownership for the extracted files, preparing the directory for the subsequent web-based installation wizard. ```bash cd /home/yfprod/html/ wget -O YetiForcePortal2.zip https://github.com/YetiForceCompany/YetiForcePortal2/releases/download/6.4/YetiForcePortal2-6.4-complete.zip unzip YetiForcePortal2.zip rm YetiForcePortal2.zip chown -R yfprod:yfprod /home/yfprod/html/ ``` -------------------------------- ### Creating Test User and Directory Structure (Optional) Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.5.0/4-developer-guides/5-environments/1-debian-10.md Optionally creates a `yftest` user and group for a separate test environment, mirroring the production setup. This isolates the test instance and prompts for the test user's password. ```bash groupadd yftest useradd -g yftest yftest usermod --shell /bin/bash yftest mkdir -p /home/yftest/html/public_html chown -R yftest:yftest /home/yftest/ passwd yftest ``` -------------------------------- ### Securing MariaDB with `mysql_secure_installation` Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.4.0/4-developer-guides/5-environments/1-debian-10.md This snippet demonstrates the interactive process of securing a MariaDB installation using the `mysql_secure_installation` script. It guides the user through setting a root password, removing anonymous users, disallowing remote root login, and deleting the test database. ```bash mysql_secure_installation Enter current password for root (enter for none):OK, successfully used password, moving on... You already have a root password set, so you can safely answer 'n'. Change the root password? [Y/n] y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! Remove anonymous users? [Y/n] y ... Success! Disallow root login remotely? [Y/n] y ... Success! Remove test database and access to it? [Y/n] y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reload privilege tables now? [Y/n] y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB! ``` -------------------------------- ### Installing Core System Utilities on Debian 10 Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/4-developer-guides/5-environments/1-debian-10.md This command installs essential utilities and packages required for system management and subsequent installations, including curl, wget, zip, unzip, cron, and htop. ```bash apt-get install -y --no-install-recommends apt-utils curl openssl wget ca-certificates apt-transport-https lsb-release gnupg zip unzip cron mc htop p7zip-full ``` -------------------------------- ### Installing Core System Packages on Debian 10 Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.5.0/4-developer-guides/5-environments/1-debian-10.md Installs essential system utilities and libraries required for YetiForce and general server operation on Debian 10. The `--no-install-recommends` flag prevents installation of recommended but not strictly necessary packages. ```bash apt-get install -y --no-install-recommends apt-utils curl openssl wget ca-certificates apt-transport-https lsb-release gnupg zip unzip cron mc htop p7zip-full ``` -------------------------------- ### Downloading and Preparing YetiForce Files via Bash Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.4.0/1-introduction/3-installation-manual.md This bash script automates the process of downloading, unzipping, and setting file ownership for YetiForce CRM installation files on a Linux server. It's an alternative to manual file preparation, ensuring the correct permissions are set for the web server to access the application files. ```bash cd /home/yfprod/html/ wget -O YetiForceCRM.zip https://github.com/YetiForceCompany/YetiForceCRM/releases/download/6.2.0/YetiForceCRM-6.2.0-complete.zip unzip YetiForceCRM.zip chown -R yfprod:yfprod /home/yfprod/html/ ``` -------------------------------- ### Installing MariaDB Server and Client Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.4.0/4-developer-guides/5-environments/1-debian-10.md This command installs the MariaDB database server and client components. These are crucial for storing and managing YetiForce's data, providing the necessary database infrastructure. ```bash apt-get install -y --no-install-recommends mariadb-server mariadb-client ``` -------------------------------- ### Creating YetiForce Test User and Directory Structure Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/4-developer-guides/5-environments/1-debian-10.md This optional snippet creates a separate yftest user and group, similar to the production setup, to establish an isolated test environment for YetiForce, including its dedicated home directory. ```bash groupadd yftest useradd -g yftest yftest usermod --shell /bin/bash yftest mkdir -p /home/yftest/html/public_html chown -R yftest:yftest /home/yftest/ passwd yftest ``` -------------------------------- ### Installing Chromium Dependencies on Debian/Ubuntu Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/versioned_docs/version-6.5.0/3-administrator-guides/17-system-tools/04-pdf/README.md This `apt-get` command installs essential libraries and packages required for Chromium to run headless on Debian-based systems like Ubuntu. These dependencies ensure the proper functioning of the browser for PDF generation, addressing common issues like the browser not launching. ```bash apt-get install -y --no-install-recommends libnss3-tools libatk1.0-0 libatk-bridge2.0-0 libdrm-dev libxkbcommon-dev libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm-dev libasound2 ``` -------------------------------- ### Securing MariaDB with `mysql_secure_installation` Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/4-developer-guides/5-environments/1-debian-10.md This snippet demonstrates the interactive `mysql_secure_installation` utility. It guides the user through setting a root password, removing anonymous users, disallowing remote root login, and removing the test database, enhancing MariaDB security. ```bash mysql_secure_installation Enter current password for root (enter for none):OK, successfully used password, moving on... You already have a root password set, so you can safely answer 'n'. Change the root password? [Y/n] y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! Remove anonymous users? [Y/n] y ... Success! Disallow root login remotely? [Y/n] y ... Success! Remove test database and access to it? [Y/n] y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reload privilege tables now? [Y/n] y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB! ``` -------------------------------- ### Installing MariaDB Server and Client on Debian 10 Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.5.0/4-developer-guides/5-environments/1-debian-10.md Installs the MariaDB database server and client components on Debian 10. The `--no-install-recommends` flag is used to install only essential packages. ```bash apt-get install -y --no-install-recommends mariadb-server mariadb-client ``` -------------------------------- ### Securing MariaDB Installation (Interactive) Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.5.0/4-developer-guides/5-environments/1-debian-10.md Initiates the interactive `mysql_secure_installation` script to improve MariaDB security. This script guides the user through setting a root password, removing anonymous users, disallowing remote root login, and removing the test database. ```bash mysql_secure_installation ``` -------------------------------- ### Automated Chromium Download and Setup Script (Bash) Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.5.0/3-administrator-guides/17-system-tools/04-pdf/README.md This Bash script automates the download and setup of the latest Chromium browser for Linux x64. It fetches the latest revision number, checks if it's already downloaded, then downloads and unzips the corresponding `chrome-linux.zip` file. Finally, it creates a symbolic link `latest` pointing to the newly downloaded Chromium directory, simplifying updates and path management. ```Bash #! /bin/bash cd $(dirname $0) LASTCHANGE_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2FLAST_CHANGE?alt=media" REVISION=$(curl -s -S $LASTCHANGE_URL) echo "latest revision is $REVISION" if [ -d $REVISION ] ; then echo "already have latest version" exit fi ZIP_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2F$REVISION%2Fchrome-linux.zip?alt=media" ZIP_FILE="${REVISION}-chrome-linux.zip" echo "fetching $ZIP_URL" rm -rf $REVISION mkdir $REVISION pushd $REVISION curl -# $ZIP_URL > $ZIP_FILE echo "unzipping.." unzip $ZIP_FILE popd rm -f ./latest find chromium/* -type d -ctime +1 -exec rm -rf {} \; ln -s $REVISION/chrome-linux/ ./latest ``` -------------------------------- ### Installing MariaDB Server and Client on Debian 10 Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/4-developer-guides/5-environments/1-debian-10.md This snippet installs the MariaDB database server and client packages. It sets up the core database system required for YetiForce CRM. ```bash apt-get install -y --no-install-recommends mariadb-server mariadb-client ``` -------------------------------- ### Downloading and Extracting YetiForce Files using Bash Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/1-introduction/3-installation-manual.md This bash script demonstrates how to download the complete YetiForce CRM package, unzip it, and set appropriate file ownership on a Linux server. It's typically used for server-side preparation before initiating the web-based installation wizard. Ensure the target directory exists and the user has necessary permissions. ```bash cd /home/yfprod/html/ wget -O YetiForceCRM.zip https://api.yetiforce.eu/download/crm/doc/7.0.4-complete unzip YetiForceCRM.zip chown -R yfprod:yfprod /home/yfprod/html/ ``` -------------------------------- ### Launching YetiForce CLI Commands (Bash) Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.5.0/4-developer-guides/4-cli/README.md This snippet provides examples of how to launch the YetiForce CLI from the command line. It includes a basic `php` command, a specific `php74` path example, and a `sudo -u` command for launching as a specific user, emphasizing that the CLI should be run by the file owner from the main YetiForce system directory. ```bash php cli.php /usr/local/php74/bin/php74 cli.php sudo -u yfprod php cli.php ``` -------------------------------- ### Creating Test Environment User and Directory Structure (Optional) Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.4.0/4-developer-guides/5-environments/1-debian-10.md This optional snippet creates a separate `yftest` user and group, along with their respective home directory and web root. This setup is useful for isolating a test environment from the production system. ```bash groupadd yftest useradd -g yftest yftest usermod --shell /bin/bash yftest mkdir -p /home/yftest/html/public_html chown -R yftest:yftest /home/yftest/ passwd yftest ``` -------------------------------- ### Launching YetiForce CLI Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/4-developer-guides/4-cli/README.md Demonstrates various ways to launch the YetiForce Command Line Interface (CLI) from the main system directory. It emphasizes launching as the file owner and provides examples for different PHP paths or user contexts. ```bash php cli.php /usr/local/php74/bin/php74 cli.php sudo -u yfprod php cli.php ``` -------------------------------- ### Downloading and Unzipping YetiForce Files using Bash Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.5.0/1-introduction/3-installation-manual.md This bash script automates the process of downloading the complete YetiForce CRM package, unzipping it, and setting the correct ownership for the extracted files within a specified web server directory. It's an alternative to manual download and FTP upload, streamlining the preparation of installation files on a Linux server. ```bash cd /home/yfprod/html/ wget -O YetiForceCRM.zip https://github.com/YetiForceCompany/YetiForceCRM/releases/download/6.2.0/YetiForceCRM-6.2.0-complete.zip unzip YetiForceCRM.zip chown -R yfprod:yfprod /home/yfprod/html/ ``` -------------------------------- ### Autoloader Class Naming Example B - PHP Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.5.0/4-developer-guides/3-system-components/6-loader-autoloader-of-files.md Illustrates another Autoloader mapping where 'MyModules_helper_ComponentName_Lib' resolves to 'modules/myModule/helper/libs/ComponentName.php'. This shows how 'helper' and 'Lib' in the class name guide the Autoloader to the correct subdirectory structure. ```PHP class name: MyModules_helper_ComponentName_Lib loaded file: modules/myModule/helper/libs/ComponentName.php ``` -------------------------------- ### Automated Chromium Download and Setup Script for Linux Bash Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.4.0/3-administrator-guides/17-system-tools/04-pdf/README.md This bash script automates the process of downloading the latest Chromium browser for Linux x64 from Google's snapshots. It checks for the latest revision, downloads the corresponding zip file, unzips it, and creates a symbolic link named 'latest' pointing to the newly downloaded Chromium directory. This simplifies the setup of a local Chromium instance for PDF generation. ```bash #! /bin/bash cd $(dirname $0) LASTCHANGE_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2FLAST_CHANGE?alt=media" REVISION=$(curl -s -S $LASTCHANGE_URL) echo "latest revision is $REVISION" if [ -d $REVISION ] ; then echo "already have latest version" exit fi ZIP_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2F$REVISION%2Fchrome-linux.zip?alt=media" ZIP_FILE="${REVISION}-chrome-linux.zip" echo "fetching $ZIP_URL" rm -rf $REVISION mkdir $REVISION pushd $REVISION curl -# $ZIP_URL > $ZIP_FILE echo "unzipping.." unzip $ZIP_FILE popd rm -f ./latest find chromium/* -type d -ctime +1 -exec rm -rf {} \; ln -s $REVISION/chrome-linux/ ./latest ``` -------------------------------- ### Installing Core System Utilities on Debian Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.4.0/4-developer-guides/5-environments/1-debian-10.md This command installs a comprehensive set of essential utilities and libraries required for system management and the proper functioning of YetiForce on Debian, including tools for archives, networking, and process monitoring. ```bash apt-get install -y --no-install-recommends apt-utils curl openssl wget ca-certificates apt-transport-https lsb-release gnupg zip unzip cron mc htop p7zip-full ``` -------------------------------- ### Connecting to Database Instances (PHP) Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/versioned_docs/version-6.4.0/4-developer-guides/3-system-components/3-databases.md This snippet demonstrates how to obtain a database connection instance using `\App\Db::getInstance()`. It shows examples for connecting to the default database and specific named database configurations like 'base', 'log', and 'admin'. This is crucial for interacting with different parts of the YetiForce database. ```PHP $db = \App\Db::getInstance(); $db = \App\Db::getInstance('base'); $db = \App\Db::getInstance('log'); $db = \App\Db::getInstance('admin'); ``` -------------------------------- ### Connecting to Database in PHP Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/docs/4-developer-guides/3-system-components/3-databases.md This snippet demonstrates how to obtain a database connection instance using `\App\Db::getInstance()`. It shows examples for connecting to the default database, and specific 'base', 'log', and 'admin' database instances, allowing interaction with different parts of the application's data. ```PHP $db = \App\Db::getInstance(); $db = \App\Db::getInstance('base'); $db = \App\Db::getInstance('log'); $db = \App\Db::getInstance('admin'); ``` -------------------------------- ### Autoloader Class Name to File Path Mapping - Example B (PHP) Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/versioned_docs/version-6.5.0/4-developer-guides/3-system-components/6-loader-autoloader-of-files.md Shows another Autoloader mapping example, where 'MyModules_helper_ComponentName_Lib' resolves to 'modules/myModule/helper/libs/ComponentName.php', highlighting the 'Lib' suffix convention. ```Text class name: MyModules_helper_ComponentName_Lib loaded file: modules/myModule/helper/libs/ComponentName.php ``` -------------------------------- ### Launching YetiForce CLI - Bash Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.4.0/4-developer-guides/4-cli/README.md This snippet provides examples of how to launch the YetiForce CLI from the command line. It shows standard execution, specifying a PHP version, and running as a specific user, emphasizing that the CLI must be launched from the main YetiForce system directory by the file owner. ```bash php cli.php /usr/local/php74/bin/php74 cli.php sudo -u yfprod php cli.php ``` -------------------------------- ### Installing NGINX and PHP-FPM 7.4 with Extensions Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.4.0/4-developer-guides/5-environments/1-debian-10.md This command installs the NGINX web server, PHP-FPM 7.4, and all required PHP extensions for YetiForce, such as `php7.4-mysql`, `php7.4-curl`, and `php7.4-gd`. It also performs an `autoclean` to remove unnecessary packages. ```bash apt-get install -y --no-install-recommends nginx nginx-extras php7.4-fpm php7.4-mysql php7.4-curl php7.4-intl php7.4-gd php7.4-fpm php7.4-bcmath php7.4-soap php7.4-ldap php7.4-imap php7.4-xml php7.4-cli php7.4-zip php7.4-json php7.4-opcache php7.4-mbstring php7.4-imagick php7.4-apcu apt-get -y autoclean ``` -------------------------------- ### PHP-FPM Configuration Example Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.5.0/8-portal/1-requirements/README.md An example configuration for PHP-FPM, setting error logging, environment clearing, request termination timeouts, process idle timeouts, max requests per child, and worker output catching for improved performance and error handling in a production environment. ```INI php_admin_value[error_log] = /var/log/php_fpm_errors.log clear_env = no request_terminate_timeout = 600 pm.process_idle_timeout = 600s; pm.max_requests = 5000 catch_workers_output = yes ``` -------------------------------- ### Installing NGINX and PHP 7.4 FPM on Debian 10 Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.5.0/4-developer-guides/5-environments/1-debian-10.md Installs the NGINX web server, NGINX extras, and PHP 7.4 FPM along with various PHP extensions required for YetiForce. After installation, `apt-get autoclean` removes downloaded package archives. ```bash apt-get install -y --no-install-recommends nginx nginx-extras php7.4-fpm php7.4-mysql php7.4-curl php7.4-intl php7.4-gd php7.4-fpm php7.4-bcmath php7.4-soap php7.4-ldap php7.4-imap php7.4-xml php7.4-cli php7.4-zip php7.4-json php7.4-opcache php7.4-mbstring php7.4-imagick php7.4-apcu apt-get -y autoclean ``` -------------------------------- ### Installing NGINX and PHP-FPM 7.4 on Debian 10 Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/4-developer-guides/5-environments/1-debian-10.md This command installs the NGINX web server, PHP-FPM 7.4, and all necessary PHP extensions for YetiForce. It also performs an autoclean to remove unnecessary packages. ```bash apt-get install -y --no-install-recommends nginx nginx-extras php7.4-fpm php7.4-mysql php7.4-curl php7.4-intl php7.4-gd php7.4-fpm php7.4-bcmath php7.4-soap php7.4-ldap php7.4-imap php7.4-xml php7.4-cli php7.4-zip php7.4-json php7.4-opcache php7.4-mbstring php7.4-imagick php7.4-apcu apt-get -y autoclean ``` -------------------------------- ### Adding MariaDB Repository for Debian 10 Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/4-developer-guides/5-environments/1-debian-10.md This optional snippet adds the official MariaDB repository for version 10.6. It fetches the signing key and adds the repository to APT sources, enabling installation of the latest MariaDB server. ```bash apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc' echo "deb [arch=amd64,arm64,ppc64el] https://ftp.osuosl.org/pub/mariadb/repo/10.6/debian $(lsb_release -sc) main" > /etc/apt/sources.list.d/mariadb.list ``` -------------------------------- ### Autoloader Naming Convention - Directory and Class Examples - PHP Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/docs/4-developer-guides/3-system-components/6-loader-autoloader-of-files.md Provides multiple examples of how directory names (e.g., 'actions', 'models', 'uitypes', 'helper/libs') must end with 's' and correspond to specific class name suffixes for the Autoloader to correctly load files. ```PHP modules/ModuleName/actions/ComponentName.php - ModuleName_ComponentName_Action modules/ModuleName/models/ComponentName.php - ModuleName_ComponentName_Model modules/ModuleName/uitypes/ComponentName.php - ModuleName_ComponentName_Uitype modules/Contacts/helper/libs/ComponentName.php - Contacts_helper_ComponentName_Lib ``` -------------------------------- ### Connecting to Database in PHP Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/4-developer-guides/3-system-components/3-databases.md This snippet demonstrates how to obtain a database connection instance using \App\Db::getInstance() in PHP. It shows examples of connecting to the default database, and specific 'base', 'log', and 'admin' database instances, allowing interaction with different database contexts. ```PHP $db = \App\Db::getInstance(); $db = \App\Db::getInstance('base'); $db = \App\Db::getInstance('log'); $db = \App\Db::getInstance('admin'); ``` -------------------------------- ### Autoloader Naming Convention - Class to File Mapping (Example B) - PHP Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/docs/4-developer-guides/3-system-components/6-loader-autoloader-of-files.md Illustrates a more complex Autoloader mapping, resolving `MyModules_helper_ComponentName_Lib` to `modules/myModule/helper/libs/ComponentName.php`, showcasing the 'helper' and 'Lib' conventions for library components. ```PHP class name: MyModules_helper_ComponentName_Lib loaded file: modules/myModule/helper/libs/ComponentName.php ``` -------------------------------- ### Adding PHP Repository for Debian 10 Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/4-developer-guides/5-environments/1-debian-10.md This snippet adds the deb.sury.org repository for PHP packages. It first downloads the GPG key for authentication and then adds the repository URL to the APT sources list, allowing installation of newer PHP versions. ```bash wget -q -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list ``` -------------------------------- ### Creating System Backup with Tar (Bash) Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.5.0/1-introduction/4-system-migration-or-recovery.md This Bash command creates a compressed tar.gz archive of the `/var/www/html/` directory, which typically contains the YetiForce installation. The archive is named with a timestamp (`YYYYMMDD_HHMM.tar.gz`) and stored in the same directory. ```Bash tar -zcvf /var/www/html/`date +"%Y%m%d_%H%M"`.tar.gz /var/www/html/ ``` -------------------------------- ### Creating Production User and Directory Structure Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.4.0/4-developer-guides/5-environments/1-debian-10.md This sequence of commands creates a dedicated `yfprod` user and group for the YetiForce application, sets up its home directory and web root, assigns proper ownership, and creates a PHP log directory, enhancing security by limiting application permissions. ```bash groupadd yfprod useradd -g yfprod yfprod usermod --shell /bin/bash yfprod mkdir -p /home/yfprod/html/public_html chown -R yfprod:yfprod /home/yfprod/ mkdir -p /var/log/php/ passwd yfprod ``` -------------------------------- ### PHP-FPM Configuration Example Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/8-portal/1-requirements/README.md An example configuration for PHP-FPM, including settings for error logging, environment clearing, request termination timeout, process idle timeout, maximum requests per child, and worker output capturing. These settings are crucial for managing PHP processes efficiently. ```INI php_admin_value[error_log] = /var/log/php_fpm_errors.log clear_env = no request_terminate_timeout = 600 pm.process_idle_timeout = 600s; pm.max_requests = 5000 catch_workers_output = yes ``` -------------------------------- ### Creating Production User and Directory Structure for YetiForce Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.5.0/4-developer-guides/5-environments/1-debian-10.md Creates a dedicated `yfprod` user and group for the YetiForce application to enhance security by limiting permissions. It sets up the home directory, web root, and PHP log directory, then prompts for the user's password. ```bash groupadd yfprod useradd -g yfprod yfprod usermod --shell /bin/bash yfprod mkdir -p /home/yfprod/html/public_html chown -R yfprod:yfprod /home/yfprod/ mkdir -p /var/log/php/ passwd yfprod ``` -------------------------------- ### Creating YetiForce Production User and Directory Structure Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/4-developer-guides/5-environments/1-debian-10.md This snippet creates a dedicated yfprod user and group for security, sets its shell, and establishes the necessary directory structure /home/yfprod/html/public_html for the YetiForce application, along with a PHP log directory. ```bash groupadd yfprod useradd -g yfprod yfprod usermod --shell /bin/bash yfprod mkdir -p /home/yfprod/html/public_html chown -R yfprod:yfprod /home/yfprod/ mkdir -p /var/log/php/ passwd yfprod ``` -------------------------------- ### Installing Chromium Dependencies on Debian/Ubuntu (Bash) Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.5.0/3-administrator-guides/17-system-tools/04-pdf/README.md This Bash command installs essential libraries required for Chromium to run headless on Debian-based systems like Ubuntu. These dependencies ensure proper functioning of the PDF generation process by providing necessary graphical and system libraries. ```Bash apt-get install -y --no-install-recommends libnss3-tools libatk1.0-0 libatk-bridge2.0-0 libdrm-dev libxkbcommon-dev libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm-dev libasound2 ``` -------------------------------- ### Adding PHP Sury Repository for Debian 10 Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.5.0/4-developer-guides/5-environments/1-debian-10.md Adds the deb.sury.org PHP repository to Debian 10, allowing installation of newer PHP versions. It first downloads the GPG key for repository authentication and then adds the repository URL to the sources list. ```bash wget -q -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list ``` -------------------------------- ### Adding MariaDB Repository on Debian (Optional) Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.4.0/4-developer-guides/5-environments/1-debian-10.md This optional step adds the official MariaDB 10.6 repository to Debian. It fetches the MariaDB release signing key and then adds the repository entry, allowing the installation of the latest MariaDB database engine. ```bash apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc' echo "deb [arch=amd64,arm64,ppc64el] https://ftp.osuosl.org/pub/mariadb/repo/10.6/debian $(lsb_release -sc) main" > /etc/apt/sources.list.d/mariadb.list ``` -------------------------------- ### Query Execution Shortcuts in PHP Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/4-developer-guides/3-system-components/3-databases.md This PHP snippet demonstrates various shortcuts for executing queries and retrieving data efficiently. It shows how to fetch all results (all()), get a single row (one()), retrieve a scalar value (scalar()), and efficiently get a column of values (column()) compared to a full data reader loop, streamlining common data access patterns. ```PHP $query->all(); $query->createCommand()->queryOne() => $query->one() // get first line $id = (new \App\Db\Query())->from($tableName)->scalar(); // get value from first line first column // Full version: $dataReader = $query->createCommand()->query(); $values = []; while ($shownerid = $dataReader->readColumn(0)) { $values[] = $shownerid; } // Short version: $values = $query->column(); ``` -------------------------------- ### Automating Chromium Download and Setup on Linux Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/versioned_docs/version-6.5.0/3-administrator-guides/17-system-tools/04-pdf/README.md This bash script automates the process of downloading and setting up the latest Chromium browser snapshot for Linux (x64). It fetches the latest revision number, downloads the corresponding zip file, extracts it, and creates a symbolic link to the `chrome-linux` directory, ensuring the `latest` directory always points to the most recent version. ```bash #! /bin/bash cd $(dirname $0) LASTCHANGE_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2FLAST_CHANGE?alt=media" REVISION=$(curl -s -S $LASTCHANGE_URL) echo "latest revision is $REVISION" if [ -d $REVISION ] ; then echo "already have latest version" exit fi ZIP_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2F$REVISION%2Fchrome-linux.zip?alt=media" ZIP_FILE="${REVISION}-chrome-linux.zip" echo "fetching $ZIP_URL" rm -rf $REVISION mkdir $REVISION pushd $REVISION curl -# $ZIP_URL > $ZIP_FILE echo "unzipping.." unzip $ZIP_FILE popd rm -f ./latest find chromium/* -type d -ctime +1 -exec rm -rf {} \; ln -s $REVISION/chrome-linux/ ./latest ``` -------------------------------- ### Configuring NGINX for YetiForce Production Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.5.0/4-developer-guides/5-environments/1-debian-10.md Configures NGINX by removing default configurations and downloading YetiForce-specific NGINX configuration files from GitHub. It sets up the main NGINX configuration and creates a symlink for the production site. ```bash rm /etc/nginx/sites-available/default rm /etc/nginx/sites-enabled/default rm /var/www/html/index.nginx-debian.html wget -O /etc/nginx/yetiforce.conf "https://raw.githubusercontent.com/YetiForceCompany/YetiForceCRM/developer/tests/setup/nginx/yetiforce.conf" wget -O /etc/nginx/sites-available/yfprod.conf "https://raw.githubusercontent.com/YetiForceCompany/YetiForceCRM/developer/tests/setup/nginx/www.conf" ln -s /etc/nginx/sites-available/yfprod.conf /etc/nginx/sites-enabled/ rm /etc/nginx/nginx.conf wget -O /etc/nginx/nginx.conf "https://raw.githubusercontent.com/YetiForceCompany/YetiForceCRM/developer/tests/setup/nginx/nginx.conf" ``` -------------------------------- ### Creating MariaDB Database and User for YetiForce Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.5.0/4-developer-guides/5-environments/1-debian-10.md Creates a new MariaDB database and a dedicated user for the YetiForce application. It grants all necessary privileges to the user on the newly created database and then flushes the privileges to apply changes. ```bash echo "CREATE DATABASE $DB_AND_USER1_NAME CHARACTER SET utf8 COLLATE utf8_general_ci;" | mysql --user=root -p$DB_ROOT_PASS; echo "CREATE USER '$DB_AND_USER1_NAME'@'localhost' IDENTIFIED BY '$DB_USER1_PASS';" | mysql --user=root -p$DB_ROOT_PASS; echo "GRANT ALL PRIVILEGES ON $DB_AND_USER1_NAME.* TO '$DB_AND_USER1_NAME'@'localhost';" | mysql --user=root -p$DB_ROOT_PASS; echo "FLUSH PRIVILEGES;" | mysql --user=root -p$DB ``` -------------------------------- ### Configuring MariaDB Server for YetiForce Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.5.0/4-developer-guides/5-environments/1-debian-10.md Configures MariaDB by removing the default server configuration and downloading a YetiForce-optimized `50-server.cnf` file from GitHub. This ensures MariaDB settings are suitable for the application. ```bash rm /etc/mysql/mariadb.conf.d/50-server.cnf wget -O /etc/mysql/mariadb.conf.d/50-server.cnf "https://raw.githubusercontent.com/YetiForceCompany/YetiForceCRM/developer/tests/setup/db/mysql.cnf" ``` -------------------------------- ### Authenticating with Basic Authorization (HTTP) Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/3-administrator-guides/15-integration/07-webservice-apps/README.md This HTTP example demonstrates how to include the username and password in the Authorization: Basic header for initial API communication with the YetiForce Web service. The credentials must be base64 encoded. ```http POST /webservice/WebservicePremium/Users/Login HTTP/1.1 Authorization: Basic cGFydG5lcjpwYXJ0bmVy ``` -------------------------------- ### Building a Select Query in PHP Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/docs/4-developer-guides/3-system-components/3-databases.md This example illustrates how to construct a database query using the `\App\Db\Query()` builder. It shows how to select specific columns, specify the table, apply 'where' conditions for filtering, limit the number of results, and add 'between' conditions for date ranges. ```PHP $query = (new \App\Db\Query()) ->select(['id', 'user_name']) ->from('vtiger_users') ->where(['status' => 'Active']) ->limit(10) ->andWhere(['between', 'holidaydate', $date[0], $date[1]]); ``` -------------------------------- ### Autoloader Directory and Class Naming Conventions (PHP) Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/versioned_docs/version-6.5.0/4-developer-guides/3-system-components/6-loader-autoloader-of-files.md Provides multiple examples of class names and their corresponding file paths, illustrating the 's' suffix rule for directory names (actions, models, uitypes, helper/libs) and the structure for different component types within a module. ```Text modules/ModuleName/actions/ComponentName.php - ModuleName_ComponentName_Action modules/ModuleName/models/ComponentName.php - ModuleName_ComponentName_Model modules/ModuleName/uitypes/ComponentName.php - ModuleName_ComponentName_Uitype modules/Contacts/helper/libs/ComponentName.php - Contacts_helper_ComponentName_Lib ``` -------------------------------- ### Configuring NGINX for YetiForce Test Environment Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/4-developer-guides/5-environments/1-debian-10.md This optional snippet creates a separate NGINX site configuration for a test environment by copying the production configuration and symlinking it. This allows running a test instance alongside the production one. ```bash cp /etc/nginx/sites-available/yfprod.conf /etc/nginx/sites-available/yftest.conf ln -s /etc/nginx/sites-available/yftest.conf /etc/nginx/sites-enabled/ ``` -------------------------------- ### Configuring NGINX for YetiForce Test Environment (Optional) Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.4.0/4-developer-guides/5-environments/1-debian-10.md This optional snippet configures NGINX for a test environment. It copies the production NGINX site configuration and creates a symbolic link to enable the test site, allowing for separate domain or subdomain testing. ```bash cp /etc/nginx/sites-available/yfprod.conf /etc/nginx/sites-available/yftest.conf ln -s /etc/nginx/sites-available/yftest.conf /etc/nginx/sites-enabled/ ``` -------------------------------- ### Authenticating with API Key and Basic Auth (HTTP) Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/3-administrator-guides/15-integration/07-webservice-apps/README.md This HTTP example illustrates how to include both the X-API-KEY header and the Authorization: Basic header in an API request. The API key is a security measure generated after application creation and is required for all API communication. ```http POST /webservice/WebservicePremium/Users/Login HTTP/1.1 X-API-KEY: VMUwRByXHSq1bLW485ikfvcC97P6gJs2 Authorization: Basic cGFydG5lcjpwYXJ0bmVy ``` -------------------------------- ### Configuring MariaDB Server Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.4.0/4-developer-guides/5-environments/1-debian-10.md This snippet configures the MariaDB server by replacing the default configuration file with a YetiForce-optimized version downloaded from GitHub. This ensures the database server is tuned for the application's requirements. ```bash rm /etc/mysql/mariadb.conf.d/50-server.cnf wget -O /etc/mysql/mariadb.conf.d/50-server.cnf "https://raw.githubusercontent.com/YetiForceCompany/YetiForceCRM/developer/tests/setup/db/mysql.cnf" ``` -------------------------------- ### Creating MariaDB Database and User for YetiForce Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.4.0/4-developer-guides/5-environments/1-debian-10.md This snippet creates a new MariaDB database and a dedicated user for YetiForce. It sets the database character set and collation, creates a local user with a strong password, and grants all necessary privileges to this user on the newly created database. ```bash echo "CREATE DATABASE $DB_AND_USER1_NAME CHARACTER SET utf8 COLLATE utf8_general_ci;" | mysql ``` -------------------------------- ### PHP Configuration Reference (Stable) Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.5.0/8-portal/1-requirements/README.md References the recommended PHP production configuration file for the latest stable version of YetiForceCRM, providing a baseline for server setup and ensuring optimal performance. ```INI https://github.com/YetiForceCompany/YetiForceCRM/blob/stable/tests/setup/php/prod.ini ``` -------------------------------- ### Configuring NGINX for YetiForce Test Environment (Optional) Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.5.0/4-developer-guides/5-environments/1-debian-10.md Optionally sets up NGINX for a test environment by copying the production site configuration and creating a symlink for the test site. Requires manual adjustment of domain names within the copied configuration file. ```bash cp /etc/nginx/sites-available/yfprod.conf /etc/nginx/sites-available/yftest.conf ln -s /etc/nginx/sites-available/yftest.conf /etc/nginx/sites-enabled/ ``` -------------------------------- ### Autoloader Naming Convention - Class to File Mapping (Example A) - PHP Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/docs/4-developer-guides/3-system-components/6-loader-autoloader-of-files.md Demonstrates how the YetiForce Autoloader maps the class name `MyModule_xyz_Model` to its corresponding file path `modules/MyModule/models/xyz.php`, illustrating the basic naming convention for models. ```PHP class name: MyModule_xyz_Model loaded file: modules/MyModule/models/xyz.php ``` -------------------------------- ### Configuring NGINX for YetiForce Production Environment Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/4-developer-guides/5-environments/1-debian-10.md This snippet configures NGINX by removing default configurations and downloading YetiForce-specific configuration files from GitHub. It sets up the main NGINX configuration and enables the production site configuration. ```bash rm /etc/nginx/sites-available/default rm /etc/nginx/sites-enabled/default rm /var/www/html/index.nginx-debian.html wget -O /etc/nginx/yetiforce.conf "https://raw.githubusercontent.com/YetiForceCompany/YetiForceCRM/developer/tests/setup/nginx/yetiforce.conf" wget -O /etc/nginx/sites-available/yfprod.conf "https://raw.githubusercontent.com/YetiForceCompany/YetiForceCRM/developer/tests/setup/nginx/www.conf" ln -s /etc/nginx/sites-available/yfprod.conf /etc/nginx/sites-enabled/ rm /etc/nginx/nginx.conf wget -O /etc/nginx/nginx.conf "https://raw.githubusercontent.com/YetiForceCompany/YetiForceCRM/developer/tests/setup/nginx/nginx.conf" ``` -------------------------------- ### Updating System Packages on Debian Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.4.0/4-developer-guides/5-environments/1-debian-10.md This snippet updates the local package index and upgrades all installed packages to their latest available versions on Debian, ensuring the system is up-to-date before further installations. ```bash apt-get update -y apt-get upgrade -y ``` -------------------------------- ### Adding PHP Sury Repository on Debian Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.4.0/4-developer-guides/5-environments/1-debian-10.md This snippet adds the `deb.sury.org` PHP repository to the system's package sources. It first downloads and imports the GPG key for authentication, then adds the repository URL to ensure access to the latest PHP versions and updates. ```bash wget -q -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list ``` -------------------------------- ### Displaying Active Products - YetiForce CLI (Bash) Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/4-developer-guides/4-cli/System.md This command lists all active products associated with the YetiForce system. It provides an overview of currently enabled features or modules. ```bash php cli.php -m System -a showProducts ``` -------------------------------- ### Updating System Packages on Debian 10 Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/current/4-developer-guides/5-environments/1-debian-10.md This snippet updates the package lists and upgrades all installed packages to their latest versions on Debian 10. It ensures the system is up-to-date before further installations. ```bash apt-get update -y apt-get upgrade -y ``` -------------------------------- ### Configuring Test Environment Alerts in Main.php (PHP) Source: https://github.com/yetiforcecompany/yetiforcedoc/blob/main/i18n/en/docusaurus-plugin-content-docs/version-6.4.0/1-introduction/4-system-migration-or-recovery.md This PHP snippet from `config/Main.php` allows configuring custom alert messages and styles for the system's header and login page. This is particularly useful for distinguishing a test environment from a production one by displaying visual cues. ```php /** Header alert message */ public static $headerAlertMessage = ''; /** Header alert type, ex. alert-primary, alert-danger, alert-warning, alert-info */ public static $headerAlertType = ''; /** Header alert icon, ex. fas fa-exclamation-triangle, fas fa-exclamation-circle, fas fa-exclamation, far fa-question-circle, fas fa-info-circle */ public static $headerAlertIcon = ''; /** Login page alert message */ public static $loginPageAlertMessage = ''; /** Login page alert type, ex. alert-primary, alert-danger, alert-warning, alert-info */ public static $loginPageAlertType = ''; /** Login page alert icon, ex. fas fa-exclamation-triangle, fas fa-exclamation-circle, fas fa-exclamation, far fa-question-circle, fas fa-info-circle */ public static $loginPageAlertIcon = ''; ```