Imported from ali-translator/translator (
AGENTS.md). Install upstream withnpx skills add ali-translator/translator. Copyright stays with the author.
Instructions for Codex Agents
Environment Setup
- Install PHP 7.4 and PHP 8.4 (or the closest available 8.x release) along with common extensions:
The PHP binaries will be available asadd-apt-repository ppa:ondrej/php -y apt-get update apt-get install -y php7.4-cli php7.4-xml php7.4-mbstring php7.4-mysql apt-get install -y php8.4-cli php8.4-xml php8.4-mbstring php8.4-mysql || apt-get install -y php8.3-cli php8.3-xml php8.3-mbstring php8.3-mysqlphp7.4andphp8.4(orphp8.3). - Install Composer:
apt-get install -y composer - Install MariaDB and start the service:
apt-get install -y mariadb-server service mariadb start mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'root'; FLUSH PRIVILEGES;" mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test;" echo "127.0.0.1 mysql" >> /etc/hosts - Install PHP dependencies for the project:
composer install --ignore-platform-reqs
Testing
Run the unit tests on both PHP versions:
php8.4 vendor/bin/phpunit --configuration phpunit.xml.dist # or php8.3 if 8.4 not available
php7.4 vendor/bin/phpunit --configuration phpunit.xml.dist
Rules of design:
- The language of the project is English, so all comments, branch names, and documentation are written in English
Package Notes
- The project uses PHPUnit 9.x and requires the
dom,json,libxml,mbstring,tokenizer, andxmlwriterextensions. - Database tests expect a MySQL server reachable via the DSN
mysql:dbname=test;host=mysqlwith credentialsroot/root.