From 0253b61926ab81a435cc6b222fc9c2e25c08bbdf Mon Sep 17 00:00:00 2001 From: crecket Date: Wed, 14 Dec 2016 18:03:31 +0100 Subject: [PATCH] removed csscrush as it was causing timeouts for some cases --- composer.json | 7 +++---- src/Response.php | 14 ++++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index adf1369..1c0637a 100644 --- a/composer.json +++ b/composer.json @@ -11,12 +11,11 @@ ], "require": { "matthiasmullie/minify": "^1.3", - "doctrine/cache": "1.*", - "leafo/scssphp": "*", + "doctrine/cache": "^1.6", + "leafo/scssphp": "^0.6", "tedivm/jshrink": "^1.1", "twig/twig": "^1.23", - "oyejorge/less.php": "v1.7.0.10", - "css-crush/css-crush": "*" + "oyejorge/less.php": "v1.7.0.10" }, "require-dev": { "phpunit/phpunit": "*" diff --git a/src/Response.php b/src/Response.php index 41c8939..80e4cbf 100644 --- a/src/Response.php +++ b/src/Response.php @@ -3,6 +3,7 @@ Namespace Crecket\DependencyManager; use JShrink\Minifier; +use MatthiasMullie\Minify\CSS; final class Response { @@ -219,10 +220,15 @@ public function getCollection() } // if result is css, run the file through a auto prefixer - if (isset($this->response_type['css'])) { - $contents = csscrush_string($contents, array( - 'minify' => $this->minify - )); + if (isset($this->response_type['css']) && $this->minify) { + //create new minifier + $minifier = new CSS(); + + // add contents to the minfier + $minifier->add($contents); + + // get results + $contents = $minifier->minify(); } else if (isset($this->response_type['js'])) { if ($this->minify) { // minify js