- Implemented the main module class with essential properties and methods. - Added translation support for various user interface strings. - Created XML configuration file for module versioning. - Ensured compatibility with different PHP versions and PrestaShop versions.
2.1 KiB
Development
Setting up the environment.
First, clone the repository:
cd whatever/folder/you/want
git clone https://github.com/rosell-dk/webp-convert.git
Then install the dev tools with composer:
composer install
If you don't have composer yet:
- Get it (download phar and move it to /usr/local/bin/composer)
- PS: PHPUnit requires php-xml, php-mbstring and php-curl. To install:
sudo apt install php-xml php-mbstring curl php-curl
Unit Testing
To run all the unit tests do this:
composer test
This also runs tests on the builds.
Individual test files can be executed like this:
composer phpunit tests/Convert/Converters/WPCTest
composer phpunit tests/Serve/ServeConvertedTest
Coding styles
WebPConvert complies with the PSR-2 coding standard.
To validate coding style of all files, do this:
composer phpcs src
To automatically fix the coding style of all files, using PHP_CodeSniffer, do this:
composer phpcbf src
Or, alternatively, you can fix with the use the PHP-CS-FIXER library instead:
composer cs-fix
Running all tests in one command
The following script runs the unit tests, checks the coding styles, validates composer.json and runs the builds.
Run this before pushing anything to github. "ci" btw stands for continuous integration.
composer ci
Generating api docs
Install phpdox and run it in the project root:
phpdox
Committing
Before committing, first make sure to:
- run
composer ci
Releasing
Before releasing:
- Update the version number in
Converters/AbstractConverter.php(search for "WebP Convert") - Make sure that ci build is successful
When releasing:
- update the webp-convert-concat library
- consider updating the require in the composer file in libraries that uses webp-convert (ie
webp-convert-cloud-serviceandwebp-express)