diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..019bb8a --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,36 @@ +name: HTMLMinTests +on: [push, pull_request] +jobs: + htmlmin: + name: PHP ${{ matrix.php-versions }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup PHP with Composer and extensions + with: + php-version: ${{ matrix.php-versions }} + uses: shivammathur/setup-php@v2 + - name: Get Composer cache directory + id: composercache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache Composer dependencies + uses: actions/cache@v2 + with: + php-version: ${{ matrix.php-versions }} + path: ${{ steps.composercache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + - name: Install Composer dependencies + env: + PHP_VERSION: ${{ matrix.php-versions }} + run: composer config --no-plugins allow-plugins.kylekatarnls/update-helper true && composer install --no-progress --prefer-dist --optimize-autoloader $(if [ "$PHP_VERSION" == "8.0" || "$PHP_VERSION" == "8.1" ]; then echo "--ignore-platform-reqs"; fi;) + - name: Run tests with code coverage + env: + PHP_VERSION: ${{ matrix.php-versions }} + run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml + continue-on-error: true diff --git a/.travis.yml b/.travis.yml index 69e7c44..0a2ee7b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,6 @@ matrix: env: LARAVEL_VERSION=5.1.* - php: 5.5.9 env: LARAVEL_VERSION=5.2.* - - php: 5.5 - env: LARAVEL_VERSION=5.1.* - - php: 5.5 - env: LARAVEL_VERSION=5.2.* - php: 5.6 env: LARAVEL_VERSION=5.1.* - php: 5.6 @@ -40,16 +36,54 @@ matrix: env: LARAVEL_VERSION=5.4.* - php: 7.1 env: LARAVEL_VERSION=5.5.* - - php: hhvm + - php: 7.1 + env: LARAVEL_VERSION=5.6.* + - php: 7.1 + env: LARAVEL_VERSION=5.7.* + - php: 7.1 + env: LARAVEL_VERSION=5.8.* + - php: 7.2 + env: LARAVEL_VERSION=5.1.* + - php: 7.2 + env: LARAVEL_VERSION=5.2.* + - php: 7.2 + env: LARAVEL_VERSION=5.3.* + - php: 7.2 + env: LARAVEL_VERSION=5.4.* + - php: 7.2 + env: LARAVEL_VERSION=5.5.* + - php: 7.2 + env: LARAVEL_VERSION=5.6.* + - php: 7.2 + env: LARAVEL_VERSION=5.7.* + - php: 7.2 + env: LARAVEL_VERSION=5.8.* + - php: 7.3 + env: LARAVEL_VERSION=5.1.* + - php: 7.3 + env: LARAVEL_VERSION=5.2.* + - php: 7.3 + env: LARAVEL_VERSION=5.3.* + - php: 7.3 + env: LARAVEL_VERSION=5.4.* + - php: 7.3 + env: LARAVEL_VERSION=5.5.* + - php: 7.3 + env: LARAVEL_VERSION=5.6.* + - php: 7.3 + env: LARAVEL_VERSION=5.7.* + - php: 7.3 + env: LARAVEL_VERSION=5.8.* + - php: hhvm-3.18 env: LARAVEL_VERSION=5.1.* dist: trusty - - php: hhvm + - php: hhvm-3.18 env: LARAVEL_VERSION=5.2.* dist: trusty - - php: hhvm + - php: hhvm-3.18 env: LARAVEL_VERSION=5.3.* dist: trusty - - php: hhvm + - php: hhvm-3.18 env: LARAVEL_VERSION=5.4.* dist: trusty @@ -61,4 +95,7 @@ before_install: install: - travis_retry composer install --no-suggest --prefer-dist -n -o -script: vendor/bin/phpunit \ No newline at end of file +before_script: + - if [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; then curl -sSfL -o ~/.phpenv/versions/hhvm/bin/phpunit https://phar.phpunit.de/phpunit-5.7.phar ; fi + +script: vendor/bin/phpunit diff --git a/CHANGELOG.md b/CHANGELOG.md index c2343d5..35dc827 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ CHANGE LOG ========== +## V5.0 (25/08/2017) + +* Added laravel 5.5 support + + ## V4.5 (01/01/2017) * Added laravel 5.4 support diff --git a/README.md b/README.md index 8b6230d..7194a4c 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ Laravel HTMLMin =============== -Laravel HTMLMin is currently maintained by [Raza Mehdi](https://github.com/srmklive), and is a simple HTML minifier for [Laravel 5](http://laravel.com). It utilises Mr Clay's [Minify](https://github.com/mrclay/minify) package to minify entire responses, but can also minify blade at compile time. Feel free to check out the [change log](CHANGELOG.md), [releases](https://github.com/HTMLMin/Laravel-HTMLMin/releases), [license](LICENSE), and [contribution guidelines](CONTRIBUTING.md). +Laravel HTMLMin is currently maintained by [Raza Mehdi](https://github.com/srmklive), and is a simple HTML minifier for [Laravel](http://laravel.com). It utilises Mr Clay's [Minify](https://github.com/mrclay/minify) package to minify entire responses, but can also minify blade at compile time. Feel free to check out the [change log](CHANGELOG.md), [releases](https://github.com/HTMLMin/Laravel-HTMLMin/releases), [license](LICENSE), and [contribution guidelines](CONTRIBUTING.md).
@@ -13,7 +12,7 @@ Laravel HTMLMin is currently maintained by [Raza Mehdi](https://github.com/srmkl ## Installation -Laravel HTMLMin requires [PHP](https://php.net) 5.5+. This particular version supports Laravel 5.1, 5.2, 5.3, or 5.4 only. +Laravel HTMLMin requires [PHP](https://php.net) 5.5+. This particular version supports Laravel 5.1-5.8, 6.x, 7.x and 8.x. To get the latest version, simply require the project using [Composer](https://getcomposer.org): @@ -21,12 +20,21 @@ To get the latest version, simply require the project using [Composer](https://g $ composer require htmlmin/htmlmin ``` -Once installed, you need to register the `HTMLMin\HTMLMin\HTMLMinServiceProvider` service provider in your `config/app.php`, and optionally alias our facade: +Once installed, register the service provider in your `config/app.php` ```php - 'HTMLMin' => HTMLMin\HTMLMin\Facades\HTMLMin::class, +'providers' => [ + HTMLMin\HTMLMin\HTMLMinServiceProvider::class +] ``` +If you want, a facade is available to alias + +```php +'aliases' => [ + 'HTMLMin' => HTMLMin\HTMLMin\Facades\HTMLMin::class +] +``` ## Configuration @@ -99,6 +107,11 @@ This class contains no public methods of interest. This class should be added to There are other classes in this package that are not documented here (such as the compiler class). This is because they are not intended for public use and are used internally by this package. +**Please note to clear view cache to see changes.** + +``` +php artisan view:clear +``` ## Security diff --git a/composer.json b/composer.json index 86a93e2..a686cac 100644 --- a/composer.json +++ b/composer.json @@ -15,18 +15,18 @@ ], "require": { "php": ">=5.5.9", - "illuminate/contracts": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*", - "illuminate/filesystem": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*", - "illuminate/http": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*", - "illuminate/routing": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*", - "illuminate/support": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*", - "illuminate/view": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*", - "mrclay/minify": "^2.2" + "illuminate/contracts": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0|^9.0|^10.0", + "illuminate/filesystem": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0|^9.0|^10.0", + "illuminate/http": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0|^9.0|^10.0", + "illuminate/routing": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0|^9.0|^10.0", + "illuminate/support": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0|^9.0|^10.0", + "illuminate/view": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0|^9.0|^10.0", + "mrclay/minify": "^2.2|^3.0" }, "require-dev": { - "graham-campbell/testbench": "^3.1|^4.0", - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.8|^5.0|^6.0" + "graham-campbell/testbench": "^3.1|^4.0|^5.0", + "mockery/mockery": "^0.9.4|^1.0", + "phpunit/phpunit": "^4.8|^5.0|^6.0|^7.0|^8.0|^9.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 986bc30..bd51815 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,7 @@ -