1. Go to this page and download the library: Download donatorsky/vendor-compress library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
declare(strict_types=1);
use Donatorsky\VendorCompress\Config;
use Donatorsky\VendorCompress\FileFilters\BasenameFilter;
use Donatorsky\VendorCompress\FileFilters\BasenameRegexFilter;
use Donatorsky\VendorCompress\FileFilters\ExtensionFilter;
use Donatorsky\VendorCompress\FileFilters\IsDirectoryFilter;
use Donatorsky\VendorCompress\FileFilters\IsFileFilter;
use Donatorsky\VendorCompress\FileFilters\VendorPackageFilter;
use Donatorsky\VendorCompress\FileProcessors\MinifyJsonFileProcessor;
use Donatorsky\VendorCompress\FileProcessors\StripWhitespacesPhpFileProcessor;
return Config::create()
->setFilesCompressionMethod(Phar::NONE) // It is also default
->setArchiveCompressionMethod(Phar::NONE) // It is also default
->setExcluded([
new VendorPackageFilter('donatorsky', 'vendor-compress'),
new IsDirectoryFilter(new BasenameFilter('docs')),
new IsDirectoryFilter(new BasenameFilter('tests')),
new IsFileFilter(new BasenameFilter('composer.json')),
new IsFileFilter(new BasenameFilter('composer.lock')),
new IsFileFilter(new BasenameFilter('.gitignore')),
new IsFileFilter(new BasenameRegexFilter('/^(?:README|CHANGELOG|phpunit.*\.xml.*$)/i')),
])
->addFileProcessor(new MinifyJsonFileProcessor(), new ExtensionFilter('json'))
->addFileProcessor(new StripWhitespacesPhpFileProcessor(), new ExtensionFilter('php'));
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.