├── .editorconfig ├── .gitignore ├── .scrutinizer.yml ├── .travis.yml ├── CHANGELOG.md ├── Exception.php ├── HtmlCompressor.php ├── LICENSE ├── README.md ├── View.php ├── components ├── CSS.php ├── JS.php └── MinifyComponent.php ├── composer.json ├── composer.lock ├── phpunit.xml.dist └── tests └── unit ├── .gitignore ├── TestCase.php ├── bootstrap.php ├── config ├── .gitignore └── main.php ├── data ├── CommentsAssetBundle.php ├── DependAssetBundle.php ├── EmptyAssetBundle.php ├── ExcludedAssetBundle.php ├── JQueryAssetBundle.php ├── PrintAssetBundle.php ├── TestAssetBundle.php └── source │ ├── comments.css │ ├── comments.js │ ├── depend.css │ ├── depend.js │ ├── excluded.css │ ├── excluded.js │ ├── for_import.css │ ├── image.png │ ├── print.css │ ├── test.css │ └── test.js ├── runtime └── .gitignore └── view ├── HtmlCompressorTest.php └── ViewTest.php /.editorconfig: -------------------------------------------------------------------------------- 1 | # 2 | # @see http://editorconfig.org/ 3 | # 4 | 5 | root = true 6 | 7 | [*.{php,py,yml}] 8 | charset = utf-8 9 | end_of_line = lf 10 | indent_size = 4 11 | indent_style = space 12 | insert_final_newline = true 13 | trim_trailing_whitespace = true 14 | 15 | [*.{ts,js,json}] 16 | charset = utf-8 17 | end_of_line = lf 18 | indent_style = space 19 | indent_size = 2 20 | insert_final_newline = true 21 | trim_trailing_whitespace = true 22 | 23 | [*.{css,scss,less}] 24 | charset = utf-8 25 | end_of_line = lf 26 | indent_style = space 27 | indent_size = 2 28 | insert_final_newline = true 29 | trim_trailing_whitespace = true 30 | 31 | [*.{html,rb,tpl,twig,xml}] 32 | charset = utf-8 33 | end_of_line = lf 34 | indent_size = 2 35 | indent_style = space 36 | insert_final_newline = true 37 | trim_trailing_whitespace = true 38 | 39 | [*.md] 40 | end_of_line = lf 41 | max_line_length = off 42 | trim_trailing_whitespace = false 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /coverage 3 | /vendor 4 | -------------------------------------------------------------------------------- /.scrutinizer.yml: -------------------------------------------------------------------------------- 1 | build: 2 | environment: 3 | php: 4 | version: 7.1 5 | dependencies: 6 | before: 7 | - sudo composer self-update && composer --version 8 | tests: 9 | override: 10 | - phpunit 11 | imports: 12 | - php 13 | 14 | checks: 15 | php: 16 | code_rating: true 17 | duplication: true 18 | 19 | tools: 20 | php_sim: false 21 | php_cpd: false 22 | php_pdepend: true 23 | php_analyzer: true 24 | php_changetracking: true 25 | external_code_coverage: 26 | timeout: 2100 # Timeout in seconds. 27 | 28 | filter: 29 | excluded_paths: 30 | - tests/* 31 | - vendor/* 32 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 7.1 5 | - 7.2 6 | - 7.3 7 | 8 | matrix: 9 | fast_finish: true 10 | 11 | sudo: false 12 | 13 | cache: 14 | directories: 15 | - vendor 16 | 17 | install: 18 | - export PATH="$HOME/.composer/vendor/bin:$PATH" 19 | - travis_retry composer self-update && composer --version 20 | - travis_retry composer install --prefer-dist --no-interaction 21 | 22 | script: 23 | - ./vendor/bin/phpunit --verbose --coverage-clover=coverage/coverage.clover 24 | 25 | after_script: 26 | - travis_retry wget https://scrutinizer-ci.com/ocular.phar 27 | - php ocular.phar code-coverage:upload --format=php-clover coverage/coverage.clover 28 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2017-06-09 - 1.15.1 2 | ------------------- 3 | * Update cssmin package to version 4 4 | 5 | 2017-05-31 - 1.15.0 6 | ------------------- 7 | * Update minify package to version 3 8 | 9 | 2017-01-19 - 1.14.4 10 | ------------------- 11 | * Changed the regular expression when checking the excluded files. 12 | 13 | 2017-01-19 - 1.14.3 14 | ------------------- 15 | * Disable ssl verification in expand css imports. 16 | 17 | 2017-01-19 - 1.14.2 18 | ------------------- 19 | * Add `jsOptions` option. 20 | 21 | 2016-12-23 - 1.14.1 22 | ------------------- 23 | * Improved mechanism exclude files from minification. 24 | * Update readme. 25 | 26 | 2016-12-23 - 1.14.0 27 | ------------------- 28 | * Improved mechanism exclude files from minification. 29 | * Refactoring. 30 | * Update readme. 31 | 32 | 2016-10-26 - 1.13.0 33 | ------------------- 34 | * Property `rmrevin\yii\minify\View::$compress_output` is now deprecated. User `rmrevin\yii\minify\View::$minifyOutput`. 35 | * Enhancement #44: property `rmrevin\yii\minify\View::$enableMinify` now affects the output minify. 36 | * Update readme. 37 | 38 | 2016-08-21 - 1.12.2 39 | ------------------- 40 | * Added missed asset manager `appendTimestamp` param. 41 | 42 | 2016-08-03 - 1.12.0 43 | ------------------- 44 | * Enhancement #38 (add `excludeBundles` param). 45 | * Bugfix #39. 46 | 47 | 2016-06-22 - 1.11.0 48 | ------------------- 49 | * Enhancement #35. 50 | * Bugfix #36. 51 | 52 | 2016-06-06 - 1.10.2 53 | ------------------- 54 | * Bugfix #32. 55 | 56 | 2016-05-23 - 1.10.1 57 | ------------------- 58 | * Bugfix. 59 | * Refactoring. 60 | 61 | 2016-05-22 - 1.10.0 62 | ------------------- 63 | * Add `fileCheckAlgorithm` property. 64 | 65 | 2015-08-20 - 1.9.4 66 | ------------------ 67 | * Content are no longer compressed inside textarea. 68 | * In `View` added new property `compress_options`. 69 | 70 | 2015-08-20 - 1.9.3 71 | ------------------ 72 | * Refactoring. 73 | 74 | 2015-08-20 - 1.9.2 75 | ------------------ 76 | * Refactoring. 77 | 78 | 2015-08-20 - 1.9.1 79 | ------------------ 80 | * Added deleting comments in css. 81 | * Refactoring. 82 | 83 | 2015-07-22 - 1.9.0 84 | ------------------ 85 | * Improved handling of conditional comments. 86 | * Improved the order dependency in the case file inclusion through cdn. 87 | * Refactoring. 88 | 89 | 2015-06-19 - 1.8.6 90 | ------------------ 91 | * Refactoring. 92 | -------------------------------------------------------------------------------- /Exception.php: -------------------------------------------------------------------------------- 1 | [ 50 | // ... 51 | 'view' => [ 52 | 'class' => '\rmrevin\yii\minify\View', 53 | 'enableMinify' => !YII_DEBUG, 54 | 'concatCss' => true, // concatenate css 55 | 'minifyCss' => true, // minificate css 56 | 'concatJs' => true, // concatenate js 57 | 'minifyJs' => true, // minificate js 58 | 'minifyOutput' => true, // minificate result html page 59 | 'webPath' => '@web', // path alias to web base 60 | 'basePath' => '@webroot', // path alias to web base 61 | 'minifyPath' => '@webroot/minify', // path alias to save minify result 62 | 'jsPosition' => [ \yii\web\View::POS_END ], // positions of js files to be minified 63 | 'forceCharset' => 'UTF-8', // charset forcibly assign, otherwise will use all of the files found charset 64 | 'expandImports' => true, // whether to change @import on content 65 | 'compressOptions' => ['extra' => true], // options for compress 66 | 'excludeFiles' => [ 67 | 'jquery.js', // exclude this file from minification 68 | 'app-[^.].js', // you may use regexp 69 | ], 70 | 'excludeBundles' => [ 71 | \app\helloworld\AssetBundle::class, // exclude this bundle from minification 72 | ], 73 | ] 74 | ] 75 | ]; 76 | ``` 77 | -------------------------------------------------------------------------------- /View.php: -------------------------------------------------------------------------------- 1 | basePath = \Yii::getAlias($this->basePath); 157 | $this->webPath = \Yii::getAlias($this->webPath); 158 | $this->minifyPath = \Yii::getAlias($this->minifyPath); 159 | 160 | if (null !== $this->cache && is_string($this->cache)) { 161 | $this->cache = \Yii::$app->get($this->cache); 162 | } 163 | 164 | foreach ($this->excludeBundles as $bundleClass) { 165 | if (!class_exists($bundleClass)) { 166 | continue; 167 | } 168 | 169 | /** @var AssetBundle $Bundle */ 170 | $Bundle = new $bundleClass; 171 | 172 | if (!empty($Bundle->css)) { 173 | $this->excludeFiles = array_merge($this->excludeFiles, $Bundle->css); 174 | } 175 | 176 | if (!empty($Bundle->js)) { 177 | $this->excludeFiles = array_merge($this->excludeFiles, $Bundle->js); 178 | } 179 | } 180 | 181 | $hashAlgos = hash_algos(); 182 | 183 | foreach ($this->hashAlgos as $alog) { 184 | if (!in_array($alog, $hashAlgos, true)) { 185 | continue; 186 | } 187 | 188 | $this->currentHashAlgo = $alog; 189 | break; 190 | } 191 | 192 | if (null === $this->currentHashAlgo) { 193 | throw new Exception('Unable to determine the hash algorithm.'); 194 | } 195 | 196 | $minifyPath = $this->minifyPath; 197 | 198 | if (!file_exists($minifyPath)) { 199 | FileHelper::createDirectory($minifyPath); 200 | } 201 | 202 | if (!is_readable($minifyPath)) { 203 | throw new Exception('Directory for compressed assets is not readable.'); 204 | } 205 | 206 | if (!is_writable($minifyPath)) { 207 | throw new Exception('Directory for compressed assets is not writable.'); 208 | } 209 | 210 | if (true === $this->enableMinify && true === $this->minifyOutput) { 211 | \Yii::$app->response->on(Response::EVENT_BEFORE_SEND, [$this, 'compressOutput']); 212 | } 213 | } 214 | 215 | /** 216 | * @param \yii\base\Event $event 217 | * @codeCoverageIgnore 218 | */ 219 | public function compressOutput(Event $event) 220 | { 221 | /** @var Response $Response */ 222 | $Response = $event->sender; 223 | 224 | if (Response::FORMAT_HTML !== $Response->format) { 225 | return; 226 | } 227 | 228 | if (!empty($Response->data)) { 229 | $Response->data = \Minify_HTML::minify($Response->data, $this->compressOptions); 230 | } 231 | 232 | if (!empty($Response->content)) { 233 | $Response->content = \Minify_HTML::minify($Response->content, $this->compressOptions); 234 | } 235 | } 236 | 237 | /** 238 | * @inheritdoc 239 | */ 240 | public function endBody() 241 | { 242 | $this->trigger(self::EVENT_END_BODY); 243 | 244 | echo self::PH_BODY_END; 245 | 246 | foreach (array_keys($this->assetBundles) as $bundle) { 247 | $this->registerAssetFiles($bundle); 248 | } 249 | 250 | if (true === $this->enableMinify) { 251 | (new components\CSS($this))->export(); 252 | (new components\JS($this))->export(); 253 | } 254 | } 255 | } 256 | -------------------------------------------------------------------------------- /components/CSS.php: -------------------------------------------------------------------------------- 1 | view->cssFiles; 23 | 24 | $this->view->cssFiles = []; 25 | 26 | $toMinify = []; 27 | 28 | foreach ($cssFiles as $file => $html) { 29 | if ($this->thisFileNeedMinify($file, $html)) { 30 | if ($this->view->concatCss) { 31 | $toMinify[$file] = $html; 32 | } else { 33 | $this->process([$file => $html]); 34 | } 35 | } else { 36 | if (!empty($toMinify)) { 37 | $this->process($toMinify); 38 | 39 | $toMinify = []; 40 | } 41 | 42 | $this->view->cssFiles[$file] = $html; 43 | } 44 | } 45 | 46 | if (!empty($toMinify)) { 47 | $this->process($toMinify); 48 | } 49 | 50 | unset($toMinify); 51 | } 52 | 53 | /** 54 | * @param array $files 55 | */ 56 | protected function process(array $files) 57 | { 58 | $minifyPath = $this->view->minifyPath; 59 | $hash = $this->_getSummaryFilesHash($files); 60 | 61 | $resultFile = $minifyPath . DIRECTORY_SEPARATOR . $hash . '.css'; 62 | 63 | if (!file_exists($resultFile)) { 64 | $css = ''; 65 | 66 | foreach ($files as $file => $html) { 67 | $cacheKey = $this->buildCacheKey($file); 68 | 69 | $content = $this->getFromCache($cacheKey); 70 | 71 | if (false !== $content) { 72 | $css .= $content; 73 | continue; 74 | } 75 | 76 | $path = dirname($file); 77 | $file = $this->getAbsoluteFilePath($file); 78 | 79 | $content = ''; 80 | 81 | if (!file_exists($file)) { 82 | \Yii::warning(sprintf('Asset file not found `%s`', $file), __METHOD__); 83 | } elseif (!is_readable($file)) { 84 | \Yii::warning(sprintf('Asset file not readable `%s`', $file), __METHOD__); 85 | } else { 86 | $content = file_get_contents($file); 87 | } 88 | 89 | $result = []; 90 | 91 | preg_match_all('|url\(([^)]+)\)|i', $content, $m); 92 | 93 | if (isset($m[0])) { 94 | foreach ((array)$m[0] as $k => $v) { 95 | if (in_array(strpos($m[1][$k], 'data:'), [0, 1], true)) { 96 | continue; 97 | } 98 | 99 | $url = str_replace(['\'', '"'], '', $m[1][$k]); 100 | 101 | if ($this->isUrl($url)) { 102 | $result[$m[1][$k]] = $url; 103 | } else { 104 | $result[$m[1][$k]] = $path . '/' . $url; 105 | } 106 | } 107 | 108 | $content = strtr($content, $result); 109 | } 110 | 111 | $this->expandImports($content); 112 | 113 | $this->convertMediaTypeAttributeToMediaQuery($html, $content); 114 | 115 | if ($this->view->minifyCss) { 116 | $content = \Minify_CSSmin::minify($content); 117 | } 118 | 119 | $this->saveToCache($cacheKey, $content); 120 | 121 | $css .= $content; 122 | } 123 | 124 | $charsets = $this->collectCharsets($css); 125 | $imports = $this->collectImports($css); 126 | $fonts = $this->collectFonts($css); 127 | 128 | if (false !== $this->view->forceCharset) { 129 | $charsets = '@charset "' . (string)$this->view->forceCharset . '";' . "\n"; 130 | } 131 | 132 | file_put_contents($resultFile, $charsets . $imports . $fonts . $css); 133 | 134 | if (false !== $this->view->fileMode) { 135 | @chmod($resultFile, $this->view->fileMode); 136 | } 137 | } 138 | 139 | $file = $this->prepareResultFile($resultFile); 140 | 141 | $this->view->cssFiles[$file] = self::cssFile($file, $this->view->cssOptions); 142 | } 143 | 144 | /** 145 | * @param $url 146 | * @param array $options 147 | * @return string 148 | */ 149 | public static function cssFile($url, $options = []) 150 | { 151 | if (!isset($options['rel'])) { 152 | $options['rel'] = 'stylesheet'; 153 | } 154 | $options['href'] = Url::to($url); 155 | 156 | if (isset($options['condition'])) { 157 | $condition = $options['condition']; 158 | unset($options['condition']); 159 | return self::wrapIntoCondition(Html::tag('link', '', $options), $condition); 160 | } elseif (isset($options['noscript']) && $options['noscript'] === true) { 161 | unset($options['noscript']); 162 | return ''; 163 | } elseif (isset($options['preload']) && $options['preload'] === true) { 164 | unset($options['preload']); 165 | $preloadOptions = [ 166 | "as" => "style", 167 | "rel" => "preload", 168 | "href" => $options["href"] 169 | ]; 170 | $preload = Html::tag('link', '', $preloadOptions); 171 | $preload .= Html::tag('link', '', $options); 172 | 173 | return $preload; 174 | } 175 | 176 | return Html::tag('link', '', $options); 177 | } 178 | 179 | /** 180 | * @param $content 181 | * @param $condition 182 | * @return string 183 | */ 184 | private static function wrapIntoCondition($content, $condition) 185 | { 186 | if (strpos($condition, '!IE') !== false) { 187 | return "\n" . $content . "\n"; 188 | } 189 | 190 | return ""; 191 | } 192 | 193 | /** 194 | * @param string $code 195 | */ 196 | protected function expandImports(&$code) 197 | { 198 | if (true !== $this->view->expandImports) { 199 | return; 200 | } 201 | 202 | preg_match_all('|\@import\s([^;]+);|i', str_replace('&', '&', $code), $m); 203 | 204 | if (!isset($m[0])) { 205 | return; 206 | } 207 | 208 | foreach ((array)$m[0] as $k => $v) { 209 | $importUrl = $m[1][$k]; 210 | 211 | if (empty($importUrl)) { 212 | continue; 213 | } 214 | 215 | $importContent = $this->_getImportContent($importUrl); 216 | 217 | if (null === $importContent) { 218 | continue; 219 | } 220 | 221 | $code = str_replace($m[0][$k], $importContent, $code); 222 | } 223 | } 224 | 225 | /** 226 | * @param string $code 227 | * @return string 228 | */ 229 | protected function collectCharsets(&$code) 230 | { 231 | return $this->_collect($code, '|\@charset[^;]+|is', function ($string) { 232 | return $string . ';'; 233 | }); 234 | } 235 | 236 | /** 237 | * @param string $code 238 | * @return string 239 | */ 240 | protected function collectImports(&$code) 241 | { 242 | return $this->_collect($code, '|\@import[^;]+|is', function ($string) { 243 | return $string . ';'; 244 | }); 245 | } 246 | 247 | /** 248 | * @param string $code 249 | * @return string 250 | */ 251 | protected function collectFonts(&$code) 252 | { 253 | return $this->_collect($code, '|\@font-face\{[^}]+\}|is', function ($string) { 254 | return $string; 255 | }); 256 | } 257 | 258 | /** 259 | * @param string $code 260 | * @param string $pattern 261 | * @param callable $handler 262 | * @return string 263 | */ 264 | protected function _collect(&$code, $pattern, $handler) 265 | { 266 | $result = ''; 267 | 268 | preg_match_all($pattern, $code, $m); 269 | 270 | foreach ((array)$m[0] as $string) { 271 | $string = $handler($string); 272 | $code = str_replace($string, '', $code); 273 | 274 | $result .= $string . PHP_EOL; 275 | } 276 | 277 | return $result; 278 | } 279 | 280 | /** 281 | * @param string|null $url 282 | * @return null|string 283 | */ 284 | protected function _getImportContent($url) 285 | { 286 | if (null === $url || '' === $url) { 287 | return null; 288 | } 289 | 290 | if (0 !== mb_strpos($url, 'url(')) { 291 | return null; 292 | } 293 | 294 | $currentUrl = str_replace(['url(\'', 'url("', 'url(', '\')', '")', ')'], '', $url); 295 | 296 | if (0 === mb_strpos($currentUrl, '//')) { 297 | $currentUrl = preg_replace('|^//|', 'http://', $currentUrl, 1); 298 | } 299 | 300 | if (null === $currentUrl || '' === $currentUrl) { 301 | return null; 302 | } 303 | 304 | if (!in_array(mb_substr($currentUrl, 0, 4), ['http', 'ftp:'], true)) { 305 | /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ 306 | $currentUrl = $this->view->basePath . $currentUrl; 307 | } 308 | 309 | if (false === $currentUrl) { 310 | return null; 311 | } 312 | 313 | return $this->_fetchImportFileContent($currentUrl); 314 | } 315 | 316 | /** 317 | * @param string $url 318 | * @return bool|string 319 | */ 320 | protected function _fetchImportFileContent($url) 321 | { 322 | $context = [ 323 | 'ssl' => [ 324 | 'verify_peer' => false, 325 | 'verify_peer_name' => false, 326 | ], 327 | ]; 328 | 329 | return file_get_contents($url, null, stream_context_create($context)); 330 | } 331 | 332 | /** 333 | * If the tag has a media="type" attribute, wrap the content in an equivalent media query 334 | * @param string $html HTML of the link tag 335 | * @param string $content CSS content 336 | * @return string $content CSS content wrapped with media query, if applicable 337 | */ 338 | protected function convertMediaTypeAttributeToMediaQuery($html, &$content) 339 | { 340 | if (preg_match('/\bmedia=(["\'])([^"\']+)\1/i', $html, $m) && isset($m[2]) && $m[2] !== 'all') { 341 | $content = '@media ' . $m[2] . ' {' . $content . '}'; 342 | } 343 | } 344 | } 345 | -------------------------------------------------------------------------------- /components/JS.php: -------------------------------------------------------------------------------- 1 | view->jsFiles; 23 | 24 | $jsPosition = $this->view->jsPosition; 25 | $jsOptions = $this->view->jsOptions; 26 | 27 | if (!empty($jsFiles)) { 28 | foreach ($jsFiles as $position => $files) { 29 | if (false === in_array($position, $jsPosition, true)) { 30 | $this->view->jsFiles[$position] = []; 31 | 32 | foreach ($files as $file => $html) { 33 | $this->view->jsFiles[$position][$file] = $html; 34 | } 35 | } else { 36 | $this->view->jsFiles[$position] = []; 37 | 38 | $toMinify = []; 39 | 40 | foreach ($files as $file => $html) { 41 | if ($this->thisFileNeedMinify($file, $html)) { 42 | if ($this->view->concatJs) { 43 | $toMinify[$file] = $html; 44 | } else { 45 | $this->process($position, $jsOptions, [$file => $html]); 46 | } 47 | } else { 48 | if (!empty($toMinify)) { 49 | $this->process($position, $jsOptions, $toMinify); 50 | 51 | $toMinify = []; 52 | } 53 | 54 | $this->view->jsFiles[$position][$file] = $html; 55 | } 56 | } 57 | 58 | if (!empty($toMinify)) { 59 | $this->process($position, $jsOptions, $toMinify); 60 | } 61 | 62 | unset($toMinify); 63 | } 64 | } 65 | } 66 | } 67 | 68 | /** 69 | * @param integer $position 70 | * @param array $options 71 | * @param array $files 72 | */ 73 | protected function process($position, $options, $files) 74 | { 75 | $minifyPath = $this->view->minifyPath; 76 | $hash = $this->_getSummaryFilesHash($files); 77 | 78 | $resultFile = $minifyPath . DIRECTORY_SEPARATOR . $hash . '.js'; 79 | 80 | if (!file_exists($resultFile)) { 81 | $js = ''; 82 | 83 | foreach ($files as $file => $html) { 84 | $cacheKey = $this->buildCacheKey($file); 85 | 86 | $content = $this->getFromCache($cacheKey); 87 | 88 | if (false !== $content) { 89 | $js .= $content; 90 | continue; 91 | } 92 | 93 | $file = $this->getAbsoluteFilePath($file); 94 | 95 | $content = ''; 96 | 97 | if (!file_exists($file)) { 98 | \Yii::warning(sprintf('Asset file not found `%s`', $file), __METHOD__); 99 | } elseif (!is_readable($file)) { 100 | \Yii::warning(sprintf('Asset file not readable `%s`', $file), __METHOD__); 101 | } else { 102 | $content .= file_get_contents($file) . ';' . "\n"; 103 | } 104 | 105 | if ($this->view->minifyJs) { 106 | $content = JSMin::minify($content); 107 | } 108 | 109 | $this->saveToCache($cacheKey, $content); 110 | 111 | $js .= $content; 112 | } 113 | 114 | file_put_contents($resultFile, $js); 115 | 116 | if (false !== $this->view->fileMode) { 117 | @chmod($resultFile, $this->view->fileMode); 118 | } 119 | } 120 | 121 | $file = $this->prepareResultFile($resultFile); 122 | 123 | $this->view->jsFiles[$position][$file] = Html::jsFile($file, $options); 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /components/MinifyComponent.php: -------------------------------------------------------------------------------- 1 | view = $view; 35 | } 36 | 37 | abstract public function export(); 38 | 39 | /** 40 | * @param string $file 41 | * @return string 42 | */ 43 | protected function getAbsoluteFilePath($file) 44 | { 45 | $basePath = $this->view->basePath; 46 | $webPath = $this->view->webPath; 47 | 48 | return $basePath . str_replace($webPath, '', $this->cleanFileName($file)); 49 | } 50 | 51 | /** 52 | * @param string $file 53 | * @return string 54 | */ 55 | protected function cleanFileName($file) 56 | { 57 | return false !== mb_strpos($file, '?') 58 | ? parse_url($file, PHP_URL_PATH) 59 | : $file; 60 | } 61 | 62 | /** 63 | * @param string $file 64 | * @param string $html 65 | * @return bool 66 | */ 67 | protected function thisFileNeedMinify($file, $html) 68 | { 69 | return !$this->isUrl($file, false) 70 | && !$this->isContainsConditionalComment($html) 71 | && !$this->isExcludedFile($file); 72 | } 73 | 74 | /** 75 | * @param string $url 76 | * @param boolean $checkSlash 77 | * @return bool 78 | */ 79 | protected function isUrl($url, $checkSlash = true) 80 | { 81 | $schemas = array_map(function ($val) { 82 | return str_replace('/', '\/', $val); 83 | }, $this->view->schemas); 84 | 85 | $regexp = '#^(' . implode('|', $schemas) . ')#i'; 86 | 87 | if ($checkSlash) { 88 | $regexp = '#^(/|\\\\|' . implode('|', $schemas) . ')#i'; 89 | } 90 | 91 | return (bool)preg_match($regexp, $url); 92 | } 93 | 94 | /** 95 | * @param string $string 96 | * @return bool 97 | */ 98 | protected function isContainsConditionalComment($string) 99 | { 100 | return mb_strpos($string, '') !== false; 101 | } 102 | 103 | /** 104 | * @param string $file 105 | * @return bool 106 | */ 107 | protected function isExcludedFile($file) 108 | { 109 | $result = false; 110 | 111 | foreach ((array)$this->view->excludeFiles as $excludedFile) { 112 | if (!preg_match('!' . $excludedFile . '!i', $file)) { 113 | continue; 114 | } 115 | 116 | $result = true; 117 | break; 118 | } 119 | 120 | return $result; 121 | } 122 | 123 | /** 124 | * @param string $resultFile 125 | * @return string 126 | */ 127 | protected function prepareResultFile($resultFile) 128 | { 129 | $basePath = $this->view->basePath; 130 | $webPath = $this->view->webPath; 131 | 132 | $file = sprintf('%s%s', $webPath, str_replace($basePath, '', $resultFile)); 133 | 134 | $AssetManager = $this->view->getAssetManager(); 135 | 136 | if ($AssetManager->appendTimestamp && ($timestamp = @filemtime($resultFile)) > 0) { 137 | $file .= '?v=' . $timestamp; 138 | } 139 | 140 | return $file; 141 | } 142 | 143 | /** 144 | * @param array $files 145 | * @return string 146 | */ 147 | protected function _getSummaryFilesHash($files) 148 | { 149 | $result = ''; 150 | 151 | foreach ($files as $file => $html) { 152 | $path = $this->getAbsoluteFilePath($file); 153 | 154 | if (!$this->thisFileNeedMinify($file, $html) || !file_exists($path)) { 155 | continue; 156 | } 157 | 158 | switch ($this->view->fileCheckAlgorithm) { 159 | default: 160 | case 'filemtime': 161 | $result .= filemtime($path) . $file; 162 | break; 163 | case 'sha1': // deprecated 164 | case 'hash': 165 | $result .= hash_file($this->view->currentHashAlgo, $path); 166 | break; 167 | } 168 | } 169 | 170 | return hash($this->view->currentHashAlgo, $result); 171 | } 172 | 173 | /** 174 | * @param string $file 175 | * @return string 176 | */ 177 | protected function buildCacheKey($file) 178 | { 179 | return hash('sha1', __CLASS__ . '/' . $file); 180 | } 181 | 182 | /** 183 | * @param string $key 184 | * @return string|false 185 | */ 186 | protected function getFromCache($key) 187 | { 188 | if ($this->view->cache instanceof Cache) { 189 | return $this->view->cache->get($key); 190 | } 191 | 192 | return false; 193 | } 194 | 195 | /** 196 | * @param string $key 197 | * @param string $content 198 | * @return bool 199 | */ 200 | protected function saveToCache($key, $content) 201 | { 202 | if ($this->view->cache instanceof Cache) { 203 | return $this->view->cache->set($key, $content, null, new TagDependency(['tags' => static::CACHE_TAG])); 204 | } 205 | 206 | return false; 207 | } 208 | } 209 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rmrevin/yii2-minify-view", 3 | "description": "Yii2 View component with auto minification css & js in runtime", 4 | "keywords": [ 5 | "yii2", 6 | "minify", 7 | "view", 8 | "js", 9 | "css" 10 | ], 11 | "type": "yii2-extension", 12 | "license": "MIT", 13 | "minimum-stability": "stable", 14 | "support": { 15 | "issues": "https://github.com/rmrevin/yii2-minify-view/issues?state=open", 16 | "wiki": "https://github.com/rmrevin/yii2-minify-view/wiki", 17 | "source": "https://github.com/rmrevin/yii2-minify-view" 18 | }, 19 | "authors": [ 20 | { 21 | "name": "Revin Roman", 22 | "email": "roman@rmrevin.com", 23 | "homepage": "https://rmrevin.com/" 24 | } 25 | ], 26 | "require": { 27 | "yiisoft/yii2": "^2.0", 28 | "mrclay/minify": "3.0.7", 29 | "pimple/pimple": "~3.2.0" 30 | }, 31 | "require-dev": { 32 | "phpdocumentor/reflection-docblock": "~3.1.0", 33 | "phpunit/phpunit": "^6.0", 34 | "monolog/monolog": "^1.1" 35 | }, 36 | "autoload": { 37 | "psr-4": { 38 | "rmrevin\\yii\\minify\\": "" 39 | } 40 | }, 41 | "repositories": [ 42 | { 43 | "type": "composer", 44 | "url": "https://asset-packagist.org" 45 | } 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "2ebd7759aece28843b9e5c3c6850a202", 8 | "packages": [ 9 | { 10 | "name": "bower-asset/inputmask", 11 | "version": "3.3.11", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/RobinHerbots/Inputmask.git", 15 | "reference": "5e670ad62f50c738388d4dcec78d2888505ad77b" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/RobinHerbots/Inputmask/zipball/5e670ad62f50c738388d4dcec78d2888505ad77b", 20 | "reference": "5e670ad62f50c738388d4dcec78d2888505ad77b" 21 | }, 22 | "require": { 23 | "bower-asset/jquery": ">=1.7" 24 | }, 25 | "type": "bower-asset", 26 | "license": [ 27 | "http://opensource.org/licenses/mit-license.php" 28 | ] 29 | }, 30 | { 31 | "name": "bower-asset/jquery", 32 | "version": "3.4.1", 33 | "source": { 34 | "type": "git", 35 | "url": "https://github.com/jquery/jquery-dist.git", 36 | "reference": "15bc73803f76bc53b654b9fdbbbc096f56d7c03d" 37 | }, 38 | "dist": { 39 | "type": "zip", 40 | "url": "https://api.github.com/repos/jquery/jquery-dist/zipball/15bc73803f76bc53b654b9fdbbbc096f56d7c03d", 41 | "reference": "15bc73803f76bc53b654b9fdbbbc096f56d7c03d" 42 | }, 43 | "type": "bower-asset", 44 | "license": [ 45 | "MIT" 46 | ] 47 | }, 48 | { 49 | "name": "bower-asset/punycode", 50 | "version": "v1.3.2", 51 | "source": { 52 | "type": "git", 53 | "url": "https://github.com/bestiejs/punycode.js.git", 54 | "reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3" 55 | }, 56 | "dist": { 57 | "type": "zip", 58 | "url": "https://api.github.com/repos/bestiejs/punycode.js/zipball/38c8d3131a82567bfef18da09f7f4db68c84f8a3", 59 | "reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3" 60 | }, 61 | "type": "bower-asset" 62 | }, 63 | { 64 | "name": "bower-asset/yii2-pjax", 65 | "version": "2.0.7.1", 66 | "source": { 67 | "type": "git", 68 | "url": "https://github.com/yiisoft/jquery-pjax.git", 69 | "reference": "aef7b953107264f00234902a3880eb50dafc48be" 70 | }, 71 | "dist": { 72 | "type": "zip", 73 | "url": "https://api.github.com/repos/yiisoft/jquery-pjax/zipball/aef7b953107264f00234902a3880eb50dafc48be", 74 | "reference": "aef7b953107264f00234902a3880eb50dafc48be" 75 | }, 76 | "require": { 77 | "bower-asset/jquery": ">=1.8" 78 | }, 79 | "type": "bower-asset", 80 | "license": [ 81 | "MIT" 82 | ] 83 | }, 84 | { 85 | "name": "cebe/markdown", 86 | "version": "1.2.1", 87 | "source": { 88 | "type": "git", 89 | "url": "https://github.com/cebe/markdown.git", 90 | "reference": "9bac5e971dd391e2802dca5400bbeacbaea9eb86" 91 | }, 92 | "dist": { 93 | "type": "zip", 94 | "url": "https://api.github.com/repos/cebe/markdown/zipball/9bac5e971dd391e2802dca5400bbeacbaea9eb86", 95 | "reference": "9bac5e971dd391e2802dca5400bbeacbaea9eb86", 96 | "shasum": "" 97 | }, 98 | "require": { 99 | "lib-pcre": "*", 100 | "php": ">=5.4.0" 101 | }, 102 | "require-dev": { 103 | "cebe/indent": "*", 104 | "facebook/xhprof": "*@dev", 105 | "phpunit/phpunit": "4.1.*" 106 | }, 107 | "bin": [ 108 | "bin/markdown" 109 | ], 110 | "type": "library", 111 | "extra": { 112 | "branch-alias": { 113 | "dev-master": "1.2.x-dev" 114 | } 115 | }, 116 | "autoload": { 117 | "psr-4": { 118 | "cebe\\markdown\\": "" 119 | } 120 | }, 121 | "notification-url": "https://packagist.org/downloads/", 122 | "license": [ 123 | "MIT" 124 | ], 125 | "authors": [ 126 | { 127 | "name": "Carsten Brandt", 128 | "email": "mail@cebe.cc", 129 | "homepage": "http://cebe.cc/", 130 | "role": "Creator" 131 | } 132 | ], 133 | "description": "A super fast, highly extensible markdown parser for PHP", 134 | "homepage": "https://github.com/cebe/markdown#readme", 135 | "keywords": [ 136 | "extensible", 137 | "fast", 138 | "gfm", 139 | "markdown", 140 | "markdown-extra" 141 | ], 142 | "time": "2018-03-26T11:24:36+00:00" 143 | }, 144 | { 145 | "name": "ezyang/htmlpurifier", 146 | "version": "v4.12.0", 147 | "source": { 148 | "type": "git", 149 | "url": "https://github.com/ezyang/htmlpurifier.git", 150 | "reference": "a617e55bc62a87eec73bd456d146d134ad716f03" 151 | }, 152 | "dist": { 153 | "type": "zip", 154 | "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/a617e55bc62a87eec73bd456d146d134ad716f03", 155 | "reference": "a617e55bc62a87eec73bd456d146d134ad716f03", 156 | "shasum": "" 157 | }, 158 | "require": { 159 | "php": ">=5.2" 160 | }, 161 | "require-dev": { 162 | "simpletest/simpletest": "dev-master#72de02a7b80c6bb8864ef9bf66d41d2f58f826bd" 163 | }, 164 | "type": "library", 165 | "autoload": { 166 | "psr-0": { 167 | "HTMLPurifier": "library/" 168 | }, 169 | "files": [ 170 | "library/HTMLPurifier.composer.php" 171 | ] 172 | }, 173 | "notification-url": "https://packagist.org/downloads/", 174 | "license": [ 175 | "LGPL-2.1-or-later" 176 | ], 177 | "authors": [ 178 | { 179 | "name": "Edward Z. Yang", 180 | "email": "admin@htmlpurifier.org", 181 | "homepage": "http://ezyang.com" 182 | } 183 | ], 184 | "description": "Standards compliant HTML filter written in PHP", 185 | "homepage": "http://htmlpurifier.org/", 186 | "keywords": [ 187 | "html" 188 | ], 189 | "time": "2019-10-28T03:44:26+00:00" 190 | }, 191 | { 192 | "name": "intervention/httpauth", 193 | "version": "2.1.0", 194 | "source": { 195 | "type": "git", 196 | "url": "https://github.com/Intervention/httpauth.git", 197 | "reference": "3d67894b28b9ff3887fb9e4474c6b81ca5614543" 198 | }, 199 | "dist": { 200 | "type": "zip", 201 | "url": "https://api.github.com/repos/Intervention/httpauth/zipball/3d67894b28b9ff3887fb9e4474c6b81ca5614543", 202 | "reference": "3d67894b28b9ff3887fb9e4474c6b81ca5614543", 203 | "shasum": "" 204 | }, 205 | "require": { 206 | "php": ">=5.3.0" 207 | }, 208 | "require-dev": { 209 | "phpunit/phpunit": "~4.0" 210 | }, 211 | "type": "library", 212 | "extra": { 213 | "laravel": { 214 | "providers": [ 215 | "Intervention\\Httpauth\\HttpauthServiceProvider" 216 | ], 217 | "aliases": { 218 | "Httpauth": "Intervention\\Httpauth\\Facades\\Httpauth" 219 | } 220 | } 221 | }, 222 | "autoload": { 223 | "psr-4": { 224 | "Intervention\\Httpauth\\": "src/Intervention/Httpauth" 225 | } 226 | }, 227 | "notification-url": "https://packagist.org/downloads/", 228 | "license": [ 229 | "MIT" 230 | ], 231 | "authors": [ 232 | { 233 | "name": "Oliver Vogel", 234 | "email": "oliver@olivervogel.com", 235 | "homepage": "http://olivervogel.com/" 236 | } 237 | ], 238 | "description": "HTTP authentication (Basic & Digest) including ServiceProviders for easy Laravel integration", 239 | "homepage": "https://github.com/Intervention/httpauth", 240 | "keywords": [ 241 | "Authentication", 242 | "http", 243 | "laravel" 244 | ], 245 | "time": "2019-09-09T11:59:51+00:00" 246 | }, 247 | { 248 | "name": "marcusschwarz/lesserphp", 249 | "version": "v0.5.4", 250 | "source": { 251 | "type": "git", 252 | "url": "https://github.com/MarcusSchwarz/lesserphp.git", 253 | "reference": "3a0f5ae0d63cbb661b5f4afd2f96875e73b3ad7e" 254 | }, 255 | "dist": { 256 | "type": "zip", 257 | "url": "https://api.github.com/repos/MarcusSchwarz/lesserphp/zipball/3a0f5ae0d63cbb661b5f4afd2f96875e73b3ad7e", 258 | "reference": "3a0f5ae0d63cbb661b5f4afd2f96875e73b3ad7e", 259 | "shasum": "" 260 | }, 261 | "require-dev": { 262 | "phpunit/phpunit": "~4.3" 263 | }, 264 | "bin": [ 265 | "plessc" 266 | ], 267 | "type": "library", 268 | "extra": { 269 | "branch-alias": { 270 | "dev-master": "0.5.1-dev" 271 | } 272 | }, 273 | "autoload": { 274 | "classmap": [ 275 | "lessc.inc.php" 276 | ] 277 | }, 278 | "notification-url": "https://packagist.org/downloads/", 279 | "license": [ 280 | "MIT", 281 | "GPL-3.0" 282 | ], 283 | "authors": [ 284 | { 285 | "name": "Leaf Corcoran", 286 | "email": "leafot@gmail.com", 287 | "homepage": "http://leafo.net" 288 | }, 289 | { 290 | "name": "Marcus Schwarz", 291 | "email": "github@maswaba.de", 292 | "homepage": "https://www.maswaba.de" 293 | } 294 | ], 295 | "description": "lesserphp is a compiler for LESS written in PHP based on leafo's lessphp.", 296 | "homepage": "http://leafo.net/lessphp/", 297 | "time": "2020-01-19T19:18:49+00:00" 298 | }, 299 | { 300 | "name": "monolog/monolog", 301 | "version": "1.25.4", 302 | "source": { 303 | "type": "git", 304 | "url": "https://github.com/Seldaek/monolog.git", 305 | "reference": "3022efff205e2448b560c833c6fbbf91c3139168" 306 | }, 307 | "dist": { 308 | "type": "zip", 309 | "url": "https://api.github.com/repos/Seldaek/monolog/zipball/3022efff205e2448b560c833c6fbbf91c3139168", 310 | "reference": "3022efff205e2448b560c833c6fbbf91c3139168", 311 | "shasum": "" 312 | }, 313 | "require": { 314 | "php": ">=5.3.0", 315 | "psr/log": "~1.0" 316 | }, 317 | "provide": { 318 | "psr/log-implementation": "1.0.0" 319 | }, 320 | "require-dev": { 321 | "aws/aws-sdk-php": "^2.4.9 || ^3.0", 322 | "doctrine/couchdb": "~1.0@dev", 323 | "graylog2/gelf-php": "~1.0", 324 | "php-amqplib/php-amqplib": "~2.4", 325 | "php-console/php-console": "^3.1.3", 326 | "php-parallel-lint/php-parallel-lint": "^1.0", 327 | "phpunit/phpunit": "~4.5", 328 | "ruflin/elastica": ">=0.90 <3.0", 329 | "sentry/sentry": "^0.13", 330 | "swiftmailer/swiftmailer": "^5.3|^6.0" 331 | }, 332 | "suggest": { 333 | "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", 334 | "doctrine/couchdb": "Allow sending log messages to a CouchDB server", 335 | "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", 336 | "ext-mongo": "Allow sending log messages to a MongoDB server", 337 | "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", 338 | "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", 339 | "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", 340 | "php-console/php-console": "Allow sending log messages to Google Chrome", 341 | "rollbar/rollbar": "Allow sending log messages to Rollbar", 342 | "ruflin/elastica": "Allow sending log messages to an Elastic Search server", 343 | "sentry/sentry": "Allow sending log messages to a Sentry server" 344 | }, 345 | "type": "library", 346 | "extra": { 347 | "branch-alias": { 348 | "dev-master": "2.0.x-dev" 349 | } 350 | }, 351 | "autoload": { 352 | "psr-4": { 353 | "Monolog\\": "src/Monolog" 354 | } 355 | }, 356 | "notification-url": "https://packagist.org/downloads/", 357 | "license": [ 358 | "MIT" 359 | ], 360 | "authors": [ 361 | { 362 | "name": "Jordi Boggiano", 363 | "email": "j.boggiano@seld.be", 364 | "homepage": "http://seld.be" 365 | } 366 | ], 367 | "description": "Sends your logs to files, sockets, inboxes, databases and various web services", 368 | "homepage": "http://github.com/Seldaek/monolog", 369 | "keywords": [ 370 | "log", 371 | "logging", 372 | "psr-3" 373 | ], 374 | "funding": [ 375 | { 376 | "url": "https://github.com/Seldaek", 377 | "type": "github" 378 | }, 379 | { 380 | "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", 381 | "type": "tidelift" 382 | } 383 | ], 384 | "time": "2020-05-22T07:31:27+00:00" 385 | }, 386 | { 387 | "name": "mrclay/jsmin-php", 388 | "version": "2.4.0", 389 | "source": { 390 | "type": "git", 391 | "url": "https://github.com/mrclay/jsmin-php.git", 392 | "reference": "bb05febc9440852d39899255afd5569b7f21a72c" 393 | }, 394 | "dist": { 395 | "type": "zip", 396 | "url": "https://api.github.com/repos/mrclay/jsmin-php/zipball/bb05febc9440852d39899255afd5569b7f21a72c", 397 | "reference": "bb05febc9440852d39899255afd5569b7f21a72c", 398 | "shasum": "" 399 | }, 400 | "require": { 401 | "ext-pcre": "*", 402 | "php": ">=5.3.0" 403 | }, 404 | "require-dev": { 405 | "phpunit/phpunit": "4.2" 406 | }, 407 | "type": "library", 408 | "autoload": { 409 | "psr-0": { 410 | "JSMin\\": "src/" 411 | } 412 | }, 413 | "notification-url": "https://packagist.org/downloads/", 414 | "license": [ 415 | "MIT" 416 | ], 417 | "authors": [ 418 | { 419 | "name": "Stephen Clay", 420 | "email": "steve@mrclay.org", 421 | "role": "Developer" 422 | }, 423 | { 424 | "name": "Ryan Grove", 425 | "email": "ryan@wonko.com", 426 | "role": "Developer" 427 | } 428 | ], 429 | "description": "Provides a modified port of Douglas Crockford's jsmin.c, which removes unnecessary whitespace from JavaScript files.", 430 | "homepage": "https://github.com/mrclay/jsmin-php/", 431 | "keywords": [ 432 | "compress", 433 | "jsmin", 434 | "minify" 435 | ], 436 | "time": "2018-12-06T15:03:38+00:00" 437 | }, 438 | { 439 | "name": "mrclay/minify", 440 | "version": "3.0.7", 441 | "source": { 442 | "type": "git", 443 | "url": "https://github.com/mrclay/minify.git", 444 | "reference": "7378a0efe8e54d9950088422973423846bda5404" 445 | }, 446 | "dist": { 447 | "type": "zip", 448 | "url": "https://api.github.com/repos/mrclay/minify/zipball/7378a0efe8e54d9950088422973423846bda5404", 449 | "reference": "7378a0efe8e54d9950088422973423846bda5404", 450 | "shasum": "" 451 | }, 452 | "require": { 453 | "ext-pcre": "*", 454 | "intervention/httpauth": "~2.0", 455 | "marcusschwarz/lesserphp": "~0.5.1", 456 | "monolog/monolog": "~1.1|~2.0", 457 | "mrclay/jsmin-php": "~2", 458 | "mrclay/props-dic": "^2.2|^3.0", 459 | "php": "^5.3.0 || ^7.0", 460 | "tubalmartin/cssmin": "~4" 461 | }, 462 | "require-dev": { 463 | "firephp/firephp-core": "~0.4.0", 464 | "leafo/scssphp": "^0.3 || ^0.6 || ^0.7", 465 | "meenie/javascript-packer": "~1.1", 466 | "phpunit/phpunit": "^4.8.36", 467 | "tedivm/jshrink": "~1.1.0" 468 | }, 469 | "suggest": { 470 | "firephp/firephp-core": "Use FirePHP for Log messages", 471 | "meenie/javascript-packer": "Keep track of the Packer PHP port using Composer" 472 | }, 473 | "type": "library", 474 | "extra": { 475 | "branch-alias": { 476 | "dev-master": "3.0.x-dev" 477 | } 478 | }, 479 | "autoload": { 480 | "classmap": [ 481 | "lib/" 482 | ] 483 | }, 484 | "notification-url": "https://packagist.org/downloads/", 485 | "license": [ 486 | "BSD-3-Clause" 487 | ], 488 | "authors": [ 489 | { 490 | "name": "Stephen Clay", 491 | "email": "steve@mrclay.org", 492 | "role": "Developer" 493 | } 494 | ], 495 | "description": "Minify is a PHP app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers", 496 | "homepage": "https://github.com/mrclay/minify", 497 | "time": "2019-12-10T06:31:58+00:00" 498 | }, 499 | { 500 | "name": "mrclay/props-dic", 501 | "version": "3.0.0", 502 | "source": { 503 | "type": "git", 504 | "url": "https://github.com/mrclay/Props.git", 505 | "reference": "0b0fd254e33e2d60bc2bcd7867f2ab3cdd05a843" 506 | }, 507 | "dist": { 508 | "type": "zip", 509 | "url": "https://api.github.com/repos/mrclay/Props/zipball/0b0fd254e33e2d60bc2bcd7867f2ab3cdd05a843", 510 | "reference": "0b0fd254e33e2d60bc2bcd7867f2ab3cdd05a843", 511 | "shasum": "" 512 | }, 513 | "require": { 514 | "php": ">=5.3.3", 515 | "pimple/pimple": "~3.0", 516 | "psr/container": "^1.0" 517 | }, 518 | "require-dev": { 519 | "phpunit/phpunit": "~4.8" 520 | }, 521 | "type": "library", 522 | "autoload": { 523 | "psr-0": { 524 | "Props\\": [ 525 | "src/" 526 | ] 527 | } 528 | }, 529 | "notification-url": "https://packagist.org/downloads/", 530 | "license": [ 531 | "MIT" 532 | ], 533 | "authors": [ 534 | { 535 | "name": "Steve Clay", 536 | "email": "steve@mrclay.org", 537 | "homepage": "http://www.mrclay.org/" 538 | } 539 | ], 540 | "description": "Props is a simple DI container that allows retrieving values via custom property and method names", 541 | "keywords": [ 542 | "container", 543 | "dependency injection", 544 | "dependency injection container", 545 | "di", 546 | "di container" 547 | ], 548 | "time": "2019-11-26T17:56:10+00:00" 549 | }, 550 | { 551 | "name": "pimple/pimple", 552 | "version": "v3.2.3", 553 | "source": { 554 | "type": "git", 555 | "url": "https://github.com/silexphp/Pimple.git", 556 | "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32" 557 | }, 558 | "dist": { 559 | "type": "zip", 560 | "url": "https://api.github.com/repos/silexphp/Pimple/zipball/9e403941ef9d65d20cba7d54e29fe906db42cf32", 561 | "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32", 562 | "shasum": "" 563 | }, 564 | "require": { 565 | "php": ">=5.3.0", 566 | "psr/container": "^1.0" 567 | }, 568 | "require-dev": { 569 | "symfony/phpunit-bridge": "^3.2" 570 | }, 571 | "type": "library", 572 | "extra": { 573 | "branch-alias": { 574 | "dev-master": "3.2.x-dev" 575 | } 576 | }, 577 | "autoload": { 578 | "psr-0": { 579 | "Pimple": "src/" 580 | } 581 | }, 582 | "notification-url": "https://packagist.org/downloads/", 583 | "license": [ 584 | "MIT" 585 | ], 586 | "authors": [ 587 | { 588 | "name": "Fabien Potencier", 589 | "email": "fabien@symfony.com" 590 | } 591 | ], 592 | "description": "Pimple, a simple Dependency Injection Container", 593 | "homepage": "http://pimple.sensiolabs.org", 594 | "keywords": [ 595 | "container", 596 | "dependency injection" 597 | ], 598 | "time": "2018-01-21T07:42:36+00:00" 599 | }, 600 | { 601 | "name": "psr/container", 602 | "version": "1.0.0", 603 | "source": { 604 | "type": "git", 605 | "url": "https://github.com/php-fig/container.git", 606 | "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" 607 | }, 608 | "dist": { 609 | "type": "zip", 610 | "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", 611 | "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", 612 | "shasum": "" 613 | }, 614 | "require": { 615 | "php": ">=5.3.0" 616 | }, 617 | "type": "library", 618 | "extra": { 619 | "branch-alias": { 620 | "dev-master": "1.0.x-dev" 621 | } 622 | }, 623 | "autoload": { 624 | "psr-4": { 625 | "Psr\\Container\\": "src/" 626 | } 627 | }, 628 | "notification-url": "https://packagist.org/downloads/", 629 | "license": [ 630 | "MIT" 631 | ], 632 | "authors": [ 633 | { 634 | "name": "PHP-FIG", 635 | "homepage": "http://www.php-fig.org/" 636 | } 637 | ], 638 | "description": "Common Container Interface (PHP FIG PSR-11)", 639 | "homepage": "https://github.com/php-fig/container", 640 | "keywords": [ 641 | "PSR-11", 642 | "container", 643 | "container-interface", 644 | "container-interop", 645 | "psr" 646 | ], 647 | "time": "2017-02-14T16:28:37+00:00" 648 | }, 649 | { 650 | "name": "psr/log", 651 | "version": "1.1.3", 652 | "source": { 653 | "type": "git", 654 | "url": "https://github.com/php-fig/log.git", 655 | "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" 656 | }, 657 | "dist": { 658 | "type": "zip", 659 | "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", 660 | "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", 661 | "shasum": "" 662 | }, 663 | "require": { 664 | "php": ">=5.3.0" 665 | }, 666 | "type": "library", 667 | "extra": { 668 | "branch-alias": { 669 | "dev-master": "1.1.x-dev" 670 | } 671 | }, 672 | "autoload": { 673 | "psr-4": { 674 | "Psr\\Log\\": "Psr/Log/" 675 | } 676 | }, 677 | "notification-url": "https://packagist.org/downloads/", 678 | "license": [ 679 | "MIT" 680 | ], 681 | "authors": [ 682 | { 683 | "name": "PHP-FIG", 684 | "homepage": "http://www.php-fig.org/" 685 | } 686 | ], 687 | "description": "Common interface for logging libraries", 688 | "homepage": "https://github.com/php-fig/log", 689 | "keywords": [ 690 | "log", 691 | "psr", 692 | "psr-3" 693 | ], 694 | "time": "2020-03-23T09:12:05+00:00" 695 | }, 696 | { 697 | "name": "tubalmartin/cssmin", 698 | "version": "v4.1.1", 699 | "source": { 700 | "type": "git", 701 | "url": "https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port.git", 702 | "reference": "3cbf557f4079d83a06f9c3ff9b957c022d7805cf" 703 | }, 704 | "dist": { 705 | "type": "zip", 706 | "url": "https://api.github.com/repos/tubalmartin/YUI-CSS-compressor-PHP-port/zipball/3cbf557f4079d83a06f9c3ff9b957c022d7805cf", 707 | "reference": "3cbf557f4079d83a06f9c3ff9b957c022d7805cf", 708 | "shasum": "" 709 | }, 710 | "require": { 711 | "ext-pcre": "*", 712 | "php": ">=5.3.2" 713 | }, 714 | "require-dev": { 715 | "cogpowered/finediff": "0.3.*", 716 | "phpunit/phpunit": "4.8.*" 717 | }, 718 | "bin": [ 719 | "cssmin" 720 | ], 721 | "type": "library", 722 | "autoload": { 723 | "psr-4": { 724 | "tubalmartin\\CssMin\\": "src" 725 | } 726 | }, 727 | "notification-url": "https://packagist.org/downloads/", 728 | "license": [ 729 | "BSD-3-Clause" 730 | ], 731 | "authors": [ 732 | { 733 | "name": "Túbal Martín", 734 | "homepage": "http://tubalmartin.me/" 735 | } 736 | ], 737 | "description": "A PHP port of the YUI CSS compressor", 738 | "homepage": "https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port", 739 | "keywords": [ 740 | "compress", 741 | "compressor", 742 | "css", 743 | "cssmin", 744 | "minify", 745 | "yui" 746 | ], 747 | "time": "2018-01-15T15:26:51+00:00" 748 | }, 749 | { 750 | "name": "yiisoft/yii2", 751 | "version": "2.0.35", 752 | "source": { 753 | "type": "git", 754 | "url": "https://github.com/yiisoft/yii2-framework.git", 755 | "reference": "d42809e4969cdc0adb97197ba32774b3e4cd9e8e" 756 | }, 757 | "dist": { 758 | "type": "zip", 759 | "url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/d42809e4969cdc0adb97197ba32774b3e4cd9e8e", 760 | "reference": "d42809e4969cdc0adb97197ba32774b3e4cd9e8e", 761 | "shasum": "" 762 | }, 763 | "require": { 764 | "bower-asset/inputmask": "~3.2.2 | ~3.3.5", 765 | "bower-asset/jquery": "3.4.*@stable | 3.3.*@stable | 3.2.*@stable | 3.1.*@stable | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable", 766 | "bower-asset/punycode": "1.3.*", 767 | "bower-asset/yii2-pjax": "~2.0.1", 768 | "cebe/markdown": "~1.0.0 | ~1.1.0 | ~1.2.0", 769 | "ext-ctype": "*", 770 | "ext-mbstring": "*", 771 | "ezyang/htmlpurifier": "~4.6", 772 | "lib-pcre": "*", 773 | "php": ">=5.4.0", 774 | "yiisoft/yii2-composer": "~2.0.4" 775 | }, 776 | "bin": [ 777 | "yii" 778 | ], 779 | "type": "library", 780 | "extra": { 781 | "branch-alias": { 782 | "dev-master": "2.0.x-dev" 783 | } 784 | }, 785 | "autoload": { 786 | "psr-4": { 787 | "yii\\": "" 788 | } 789 | }, 790 | "notification-url": "https://packagist.org/downloads/", 791 | "license": [ 792 | "BSD-3-Clause" 793 | ], 794 | "authors": [ 795 | { 796 | "name": "Qiang Xue", 797 | "email": "qiang.xue@gmail.com", 798 | "homepage": "http://www.yiiframework.com/", 799 | "role": "Founder and project lead" 800 | }, 801 | { 802 | "name": "Alexander Makarov", 803 | "email": "sam@rmcreative.ru", 804 | "homepage": "http://rmcreative.ru/", 805 | "role": "Core framework development" 806 | }, 807 | { 808 | "name": "Maurizio Domba", 809 | "homepage": "http://mdomba.info/", 810 | "role": "Core framework development" 811 | }, 812 | { 813 | "name": "Carsten Brandt", 814 | "email": "mail@cebe.cc", 815 | "homepage": "http://cebe.cc/", 816 | "role": "Core framework development" 817 | }, 818 | { 819 | "name": "Timur Ruziev", 820 | "email": "resurtm@gmail.com", 821 | "homepage": "http://resurtm.com/", 822 | "role": "Core framework development" 823 | }, 824 | { 825 | "name": "Paul Klimov", 826 | "email": "klimov.paul@gmail.com", 827 | "role": "Core framework development" 828 | }, 829 | { 830 | "name": "Dmitry Naumenko", 831 | "email": "d.naumenko.a@gmail.com", 832 | "role": "Core framework development" 833 | }, 834 | { 835 | "name": "Boudewijn Vahrmeijer", 836 | "email": "info@dynasource.eu", 837 | "homepage": "http://dynasource.eu", 838 | "role": "Core framework development" 839 | } 840 | ], 841 | "description": "Yii PHP Framework Version 2", 842 | "homepage": "http://www.yiiframework.com/", 843 | "keywords": [ 844 | "framework", 845 | "yii2" 846 | ], 847 | "funding": [ 848 | { 849 | "url": "https://github.com/yiisoft", 850 | "type": "github" 851 | }, 852 | { 853 | "url": "https://opencollective.com/yiisoft", 854 | "type": "open_collective" 855 | }, 856 | { 857 | "url": "https://tidelift.com/funding/github/packagist/yiisoft/yii2", 858 | "type": "tidelift" 859 | } 860 | ], 861 | "time": "2020-05-02T11:11:31+00:00" 862 | }, 863 | { 864 | "name": "yiisoft/yii2-composer", 865 | "version": "2.0.10", 866 | "source": { 867 | "type": "git", 868 | "url": "https://github.com/yiisoft/yii2-composer.git", 869 | "reference": "94bb3f66e779e2774f8776d6e1bdeab402940510" 870 | }, 871 | "dist": { 872 | "type": "zip", 873 | "url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/94bb3f66e779e2774f8776d6e1bdeab402940510", 874 | "reference": "94bb3f66e779e2774f8776d6e1bdeab402940510", 875 | "shasum": "" 876 | }, 877 | "require": { 878 | "composer-plugin-api": "^1.0 | ^2.0" 879 | }, 880 | "require-dev": { 881 | "composer/composer": "^1.0 | ^2.0@dev", 882 | "phpunit/phpunit": "<7" 883 | }, 884 | "type": "composer-plugin", 885 | "extra": { 886 | "class": "yii\\composer\\Plugin", 887 | "branch-alias": { 888 | "dev-master": "2.0.x-dev" 889 | } 890 | }, 891 | "autoload": { 892 | "psr-4": { 893 | "yii\\composer\\": "" 894 | } 895 | }, 896 | "notification-url": "https://packagist.org/downloads/", 897 | "license": [ 898 | "BSD-3-Clause" 899 | ], 900 | "authors": [ 901 | { 902 | "name": "Qiang Xue", 903 | "email": "qiang.xue@gmail.com" 904 | }, 905 | { 906 | "name": "Carsten Brandt", 907 | "email": "mail@cebe.cc" 908 | } 909 | ], 910 | "description": "The composer plugin for Yii extension installer", 911 | "keywords": [ 912 | "composer", 913 | "extension installer", 914 | "yii2" 915 | ], 916 | "funding": [ 917 | { 918 | "url": "https://github.com/yiisoft", 919 | "type": "github" 920 | }, 921 | { 922 | "url": "https://opencollective.com/yiisoft", 923 | "type": "open_collective" 924 | }, 925 | { 926 | "url": "https://tidelift.com/funding/github/packagist/yiisoft/yii2-composer", 927 | "type": "tidelift" 928 | } 929 | ], 930 | "time": "2020-06-24T00:04:01+00:00" 931 | } 932 | ], 933 | "packages-dev": [ 934 | { 935 | "name": "doctrine/instantiator", 936 | "version": "1.3.1", 937 | "source": { 938 | "type": "git", 939 | "url": "https://github.com/doctrine/instantiator.git", 940 | "reference": "f350df0268e904597e3bd9c4685c53e0e333feea" 941 | }, 942 | "dist": { 943 | "type": "zip", 944 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea", 945 | "reference": "f350df0268e904597e3bd9c4685c53e0e333feea", 946 | "shasum": "" 947 | }, 948 | "require": { 949 | "php": "^7.1 || ^8.0" 950 | }, 951 | "require-dev": { 952 | "doctrine/coding-standard": "^6.0", 953 | "ext-pdo": "*", 954 | "ext-phar": "*", 955 | "phpbench/phpbench": "^0.13", 956 | "phpstan/phpstan-phpunit": "^0.11", 957 | "phpstan/phpstan-shim": "^0.11", 958 | "phpunit/phpunit": "^7.0" 959 | }, 960 | "type": "library", 961 | "extra": { 962 | "branch-alias": { 963 | "dev-master": "1.2.x-dev" 964 | } 965 | }, 966 | "autoload": { 967 | "psr-4": { 968 | "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" 969 | } 970 | }, 971 | "notification-url": "https://packagist.org/downloads/", 972 | "license": [ 973 | "MIT" 974 | ], 975 | "authors": [ 976 | { 977 | "name": "Marco Pivetta", 978 | "email": "ocramius@gmail.com", 979 | "homepage": "http://ocramius.github.com/" 980 | } 981 | ], 982 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", 983 | "homepage": "https://www.doctrine-project.org/projects/instantiator.html", 984 | "keywords": [ 985 | "constructor", 986 | "instantiate" 987 | ], 988 | "funding": [ 989 | { 990 | "url": "https://www.doctrine-project.org/sponsorship.html", 991 | "type": "custom" 992 | }, 993 | { 994 | "url": "https://www.patreon.com/phpdoctrine", 995 | "type": "patreon" 996 | }, 997 | { 998 | "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", 999 | "type": "tidelift" 1000 | } 1001 | ], 1002 | "time": "2020-05-29T17:27:14+00:00" 1003 | }, 1004 | { 1005 | "name": "myclabs/deep-copy", 1006 | "version": "1.9.5", 1007 | "source": { 1008 | "type": "git", 1009 | "url": "https://github.com/myclabs/DeepCopy.git", 1010 | "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" 1011 | }, 1012 | "dist": { 1013 | "type": "zip", 1014 | "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", 1015 | "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", 1016 | "shasum": "" 1017 | }, 1018 | "require": { 1019 | "php": "^7.1" 1020 | }, 1021 | "replace": { 1022 | "myclabs/deep-copy": "self.version" 1023 | }, 1024 | "require-dev": { 1025 | "doctrine/collections": "^1.0", 1026 | "doctrine/common": "^2.6", 1027 | "phpunit/phpunit": "^7.1" 1028 | }, 1029 | "type": "library", 1030 | "autoload": { 1031 | "psr-4": { 1032 | "DeepCopy\\": "src/DeepCopy/" 1033 | }, 1034 | "files": [ 1035 | "src/DeepCopy/deep_copy.php" 1036 | ] 1037 | }, 1038 | "notification-url": "https://packagist.org/downloads/", 1039 | "license": [ 1040 | "MIT" 1041 | ], 1042 | "description": "Create deep copies (clones) of your objects", 1043 | "keywords": [ 1044 | "clone", 1045 | "copy", 1046 | "duplicate", 1047 | "object", 1048 | "object graph" 1049 | ], 1050 | "time": "2020-01-17T21:11:47+00:00" 1051 | }, 1052 | { 1053 | "name": "phar-io/manifest", 1054 | "version": "1.0.1", 1055 | "source": { 1056 | "type": "git", 1057 | "url": "https://github.com/phar-io/manifest.git", 1058 | "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" 1059 | }, 1060 | "dist": { 1061 | "type": "zip", 1062 | "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", 1063 | "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", 1064 | "shasum": "" 1065 | }, 1066 | "require": { 1067 | "ext-dom": "*", 1068 | "ext-phar": "*", 1069 | "phar-io/version": "^1.0.1", 1070 | "php": "^5.6 || ^7.0" 1071 | }, 1072 | "type": "library", 1073 | "extra": { 1074 | "branch-alias": { 1075 | "dev-master": "1.0.x-dev" 1076 | } 1077 | }, 1078 | "autoload": { 1079 | "classmap": [ 1080 | "src/" 1081 | ] 1082 | }, 1083 | "notification-url": "https://packagist.org/downloads/", 1084 | "license": [ 1085 | "BSD-3-Clause" 1086 | ], 1087 | "authors": [ 1088 | { 1089 | "name": "Arne Blankerts", 1090 | "email": "arne@blankerts.de", 1091 | "role": "Developer" 1092 | }, 1093 | { 1094 | "name": "Sebastian Heuer", 1095 | "email": "sebastian@phpeople.de", 1096 | "role": "Developer" 1097 | }, 1098 | { 1099 | "name": "Sebastian Bergmann", 1100 | "email": "sebastian@phpunit.de", 1101 | "role": "Developer" 1102 | } 1103 | ], 1104 | "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", 1105 | "time": "2017-03-05T18:14:27+00:00" 1106 | }, 1107 | { 1108 | "name": "phar-io/version", 1109 | "version": "1.0.1", 1110 | "source": { 1111 | "type": "git", 1112 | "url": "https://github.com/phar-io/version.git", 1113 | "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" 1114 | }, 1115 | "dist": { 1116 | "type": "zip", 1117 | "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", 1118 | "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", 1119 | "shasum": "" 1120 | }, 1121 | "require": { 1122 | "php": "^5.6 || ^7.0" 1123 | }, 1124 | "type": "library", 1125 | "autoload": { 1126 | "classmap": [ 1127 | "src/" 1128 | ] 1129 | }, 1130 | "notification-url": "https://packagist.org/downloads/", 1131 | "license": [ 1132 | "BSD-3-Clause" 1133 | ], 1134 | "authors": [ 1135 | { 1136 | "name": "Arne Blankerts", 1137 | "email": "arne@blankerts.de", 1138 | "role": "Developer" 1139 | }, 1140 | { 1141 | "name": "Sebastian Heuer", 1142 | "email": "sebastian@phpeople.de", 1143 | "role": "Developer" 1144 | }, 1145 | { 1146 | "name": "Sebastian Bergmann", 1147 | "email": "sebastian@phpunit.de", 1148 | "role": "Developer" 1149 | } 1150 | ], 1151 | "description": "Library for handling version information and constraints", 1152 | "time": "2017-03-05T17:38:23+00:00" 1153 | }, 1154 | { 1155 | "name": "phpdocumentor/reflection-common", 1156 | "version": "1.0.1", 1157 | "source": { 1158 | "type": "git", 1159 | "url": "https://github.com/phpDocumentor/ReflectionCommon.git", 1160 | "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" 1161 | }, 1162 | "dist": { 1163 | "type": "zip", 1164 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", 1165 | "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", 1166 | "shasum": "" 1167 | }, 1168 | "require": { 1169 | "php": ">=5.5" 1170 | }, 1171 | "require-dev": { 1172 | "phpunit/phpunit": "^4.6" 1173 | }, 1174 | "type": "library", 1175 | "extra": { 1176 | "branch-alias": { 1177 | "dev-master": "1.0.x-dev" 1178 | } 1179 | }, 1180 | "autoload": { 1181 | "psr-4": { 1182 | "phpDocumentor\\Reflection\\": [ 1183 | "src" 1184 | ] 1185 | } 1186 | }, 1187 | "notification-url": "https://packagist.org/downloads/", 1188 | "license": [ 1189 | "MIT" 1190 | ], 1191 | "authors": [ 1192 | { 1193 | "name": "Jaap van Otterdijk", 1194 | "email": "opensource@ijaap.nl" 1195 | } 1196 | ], 1197 | "description": "Common reflection classes used by phpdocumentor to reflect the code structure", 1198 | "homepage": "http://www.phpdoc.org", 1199 | "keywords": [ 1200 | "FQSEN", 1201 | "phpDocumentor", 1202 | "phpdoc", 1203 | "reflection", 1204 | "static analysis" 1205 | ], 1206 | "time": "2017-09-11T18:02:19+00:00" 1207 | }, 1208 | { 1209 | "name": "phpdocumentor/reflection-docblock", 1210 | "version": "3.1.1", 1211 | "source": { 1212 | "type": "git", 1213 | "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", 1214 | "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" 1215 | }, 1216 | "dist": { 1217 | "type": "zip", 1218 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", 1219 | "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", 1220 | "shasum": "" 1221 | }, 1222 | "require": { 1223 | "php": ">=5.5", 1224 | "phpdocumentor/reflection-common": "^1.0@dev", 1225 | "phpdocumentor/type-resolver": "^0.2.0", 1226 | "webmozart/assert": "^1.0" 1227 | }, 1228 | "require-dev": { 1229 | "mockery/mockery": "^0.9.4", 1230 | "phpunit/phpunit": "^4.4" 1231 | }, 1232 | "type": "library", 1233 | "autoload": { 1234 | "psr-4": { 1235 | "phpDocumentor\\Reflection\\": [ 1236 | "src/" 1237 | ] 1238 | } 1239 | }, 1240 | "notification-url": "https://packagist.org/downloads/", 1241 | "license": [ 1242 | "MIT" 1243 | ], 1244 | "authors": [ 1245 | { 1246 | "name": "Mike van Riel", 1247 | "email": "me@mikevanriel.com" 1248 | } 1249 | ], 1250 | "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", 1251 | "time": "2016-09-30T07:12:33+00:00" 1252 | }, 1253 | { 1254 | "name": "phpdocumentor/type-resolver", 1255 | "version": "0.2.1", 1256 | "source": { 1257 | "type": "git", 1258 | "url": "https://github.com/phpDocumentor/TypeResolver.git", 1259 | "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" 1260 | }, 1261 | "dist": { 1262 | "type": "zip", 1263 | "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", 1264 | "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", 1265 | "shasum": "" 1266 | }, 1267 | "require": { 1268 | "php": ">=5.5", 1269 | "phpdocumentor/reflection-common": "^1.0" 1270 | }, 1271 | "require-dev": { 1272 | "mockery/mockery": "^0.9.4", 1273 | "phpunit/phpunit": "^5.2||^4.8.24" 1274 | }, 1275 | "type": "library", 1276 | "extra": { 1277 | "branch-alias": { 1278 | "dev-master": "1.0.x-dev" 1279 | } 1280 | }, 1281 | "autoload": { 1282 | "psr-4": { 1283 | "phpDocumentor\\Reflection\\": [ 1284 | "src/" 1285 | ] 1286 | } 1287 | }, 1288 | "notification-url": "https://packagist.org/downloads/", 1289 | "license": [ 1290 | "MIT" 1291 | ], 1292 | "authors": [ 1293 | { 1294 | "name": "Mike van Riel", 1295 | "email": "me@mikevanriel.com" 1296 | } 1297 | ], 1298 | "time": "2016-11-25T06:54:22+00:00" 1299 | }, 1300 | { 1301 | "name": "phpspec/prophecy", 1302 | "version": "v1.10.3", 1303 | "source": { 1304 | "type": "git", 1305 | "url": "https://github.com/phpspec/prophecy.git", 1306 | "reference": "451c3cd1418cf640de218914901e51b064abb093" 1307 | }, 1308 | "dist": { 1309 | "type": "zip", 1310 | "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", 1311 | "reference": "451c3cd1418cf640de218914901e51b064abb093", 1312 | "shasum": "" 1313 | }, 1314 | "require": { 1315 | "doctrine/instantiator": "^1.0.2", 1316 | "php": "^5.3|^7.0", 1317 | "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", 1318 | "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", 1319 | "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" 1320 | }, 1321 | "require-dev": { 1322 | "phpspec/phpspec": "^2.5 || ^3.2", 1323 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" 1324 | }, 1325 | "type": "library", 1326 | "extra": { 1327 | "branch-alias": { 1328 | "dev-master": "1.10.x-dev" 1329 | } 1330 | }, 1331 | "autoload": { 1332 | "psr-4": { 1333 | "Prophecy\\": "src/Prophecy" 1334 | } 1335 | }, 1336 | "notification-url": "https://packagist.org/downloads/", 1337 | "license": [ 1338 | "MIT" 1339 | ], 1340 | "authors": [ 1341 | { 1342 | "name": "Konstantin Kudryashov", 1343 | "email": "ever.zet@gmail.com", 1344 | "homepage": "http://everzet.com" 1345 | }, 1346 | { 1347 | "name": "Marcello Duarte", 1348 | "email": "marcello.duarte@gmail.com" 1349 | } 1350 | ], 1351 | "description": "Highly opinionated mocking framework for PHP 5.3+", 1352 | "homepage": "https://github.com/phpspec/prophecy", 1353 | "keywords": [ 1354 | "Double", 1355 | "Dummy", 1356 | "fake", 1357 | "mock", 1358 | "spy", 1359 | "stub" 1360 | ], 1361 | "time": "2020-03-05T15:02:03+00:00" 1362 | }, 1363 | { 1364 | "name": "phpunit/php-code-coverage", 1365 | "version": "5.3.2", 1366 | "source": { 1367 | "type": "git", 1368 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 1369 | "reference": "c89677919c5dd6d3b3852f230a663118762218ac" 1370 | }, 1371 | "dist": { 1372 | "type": "zip", 1373 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", 1374 | "reference": "c89677919c5dd6d3b3852f230a663118762218ac", 1375 | "shasum": "" 1376 | }, 1377 | "require": { 1378 | "ext-dom": "*", 1379 | "ext-xmlwriter": "*", 1380 | "php": "^7.0", 1381 | "phpunit/php-file-iterator": "^1.4.2", 1382 | "phpunit/php-text-template": "^1.2.1", 1383 | "phpunit/php-token-stream": "^2.0.1", 1384 | "sebastian/code-unit-reverse-lookup": "^1.0.1", 1385 | "sebastian/environment": "^3.0", 1386 | "sebastian/version": "^2.0.1", 1387 | "theseer/tokenizer": "^1.1" 1388 | }, 1389 | "require-dev": { 1390 | "phpunit/phpunit": "^6.0" 1391 | }, 1392 | "suggest": { 1393 | "ext-xdebug": "^2.5.5" 1394 | }, 1395 | "type": "library", 1396 | "extra": { 1397 | "branch-alias": { 1398 | "dev-master": "5.3.x-dev" 1399 | } 1400 | }, 1401 | "autoload": { 1402 | "classmap": [ 1403 | "src/" 1404 | ] 1405 | }, 1406 | "notification-url": "https://packagist.org/downloads/", 1407 | "license": [ 1408 | "BSD-3-Clause" 1409 | ], 1410 | "authors": [ 1411 | { 1412 | "name": "Sebastian Bergmann", 1413 | "email": "sebastian@phpunit.de", 1414 | "role": "lead" 1415 | } 1416 | ], 1417 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 1418 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 1419 | "keywords": [ 1420 | "coverage", 1421 | "testing", 1422 | "xunit" 1423 | ], 1424 | "time": "2018-04-06T15:36:58+00:00" 1425 | }, 1426 | { 1427 | "name": "phpunit/php-file-iterator", 1428 | "version": "1.4.5", 1429 | "source": { 1430 | "type": "git", 1431 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git", 1432 | "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" 1433 | }, 1434 | "dist": { 1435 | "type": "zip", 1436 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", 1437 | "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", 1438 | "shasum": "" 1439 | }, 1440 | "require": { 1441 | "php": ">=5.3.3" 1442 | }, 1443 | "type": "library", 1444 | "extra": { 1445 | "branch-alias": { 1446 | "dev-master": "1.4.x-dev" 1447 | } 1448 | }, 1449 | "autoload": { 1450 | "classmap": [ 1451 | "src/" 1452 | ] 1453 | }, 1454 | "notification-url": "https://packagist.org/downloads/", 1455 | "license": [ 1456 | "BSD-3-Clause" 1457 | ], 1458 | "authors": [ 1459 | { 1460 | "name": "Sebastian Bergmann", 1461 | "email": "sb@sebastian-bergmann.de", 1462 | "role": "lead" 1463 | } 1464 | ], 1465 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 1466 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", 1467 | "keywords": [ 1468 | "filesystem", 1469 | "iterator" 1470 | ], 1471 | "time": "2017-11-27T13:52:08+00:00" 1472 | }, 1473 | { 1474 | "name": "phpunit/php-text-template", 1475 | "version": "1.2.1", 1476 | "source": { 1477 | "type": "git", 1478 | "url": "https://github.com/sebastianbergmann/php-text-template.git", 1479 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" 1480 | }, 1481 | "dist": { 1482 | "type": "zip", 1483 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 1484 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 1485 | "shasum": "" 1486 | }, 1487 | "require": { 1488 | "php": ">=5.3.3" 1489 | }, 1490 | "type": "library", 1491 | "autoload": { 1492 | "classmap": [ 1493 | "src/" 1494 | ] 1495 | }, 1496 | "notification-url": "https://packagist.org/downloads/", 1497 | "license": [ 1498 | "BSD-3-Clause" 1499 | ], 1500 | "authors": [ 1501 | { 1502 | "name": "Sebastian Bergmann", 1503 | "email": "sebastian@phpunit.de", 1504 | "role": "lead" 1505 | } 1506 | ], 1507 | "description": "Simple template engine.", 1508 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 1509 | "keywords": [ 1510 | "template" 1511 | ], 1512 | "time": "2015-06-21T13:50:34+00:00" 1513 | }, 1514 | { 1515 | "name": "phpunit/php-timer", 1516 | "version": "1.0.9", 1517 | "source": { 1518 | "type": "git", 1519 | "url": "https://github.com/sebastianbergmann/php-timer.git", 1520 | "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" 1521 | }, 1522 | "dist": { 1523 | "type": "zip", 1524 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", 1525 | "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", 1526 | "shasum": "" 1527 | }, 1528 | "require": { 1529 | "php": "^5.3.3 || ^7.0" 1530 | }, 1531 | "require-dev": { 1532 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" 1533 | }, 1534 | "type": "library", 1535 | "extra": { 1536 | "branch-alias": { 1537 | "dev-master": "1.0-dev" 1538 | } 1539 | }, 1540 | "autoload": { 1541 | "classmap": [ 1542 | "src/" 1543 | ] 1544 | }, 1545 | "notification-url": "https://packagist.org/downloads/", 1546 | "license": [ 1547 | "BSD-3-Clause" 1548 | ], 1549 | "authors": [ 1550 | { 1551 | "name": "Sebastian Bergmann", 1552 | "email": "sb@sebastian-bergmann.de", 1553 | "role": "lead" 1554 | } 1555 | ], 1556 | "description": "Utility class for timing", 1557 | "homepage": "https://github.com/sebastianbergmann/php-timer/", 1558 | "keywords": [ 1559 | "timer" 1560 | ], 1561 | "time": "2017-02-26T11:10:40+00:00" 1562 | }, 1563 | { 1564 | "name": "phpunit/php-token-stream", 1565 | "version": "2.0.2", 1566 | "source": { 1567 | "type": "git", 1568 | "url": "https://github.com/sebastianbergmann/php-token-stream.git", 1569 | "reference": "791198a2c6254db10131eecfe8c06670700904db" 1570 | }, 1571 | "dist": { 1572 | "type": "zip", 1573 | "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", 1574 | "reference": "791198a2c6254db10131eecfe8c06670700904db", 1575 | "shasum": "" 1576 | }, 1577 | "require": { 1578 | "ext-tokenizer": "*", 1579 | "php": "^7.0" 1580 | }, 1581 | "require-dev": { 1582 | "phpunit/phpunit": "^6.2.4" 1583 | }, 1584 | "type": "library", 1585 | "extra": { 1586 | "branch-alias": { 1587 | "dev-master": "2.0-dev" 1588 | } 1589 | }, 1590 | "autoload": { 1591 | "classmap": [ 1592 | "src/" 1593 | ] 1594 | }, 1595 | "notification-url": "https://packagist.org/downloads/", 1596 | "license": [ 1597 | "BSD-3-Clause" 1598 | ], 1599 | "authors": [ 1600 | { 1601 | "name": "Sebastian Bergmann", 1602 | "email": "sebastian@phpunit.de" 1603 | } 1604 | ], 1605 | "description": "Wrapper around PHP's tokenizer extension.", 1606 | "homepage": "https://github.com/sebastianbergmann/php-token-stream/", 1607 | "keywords": [ 1608 | "tokenizer" 1609 | ], 1610 | "time": "2017-11-27T05:48:46+00:00" 1611 | }, 1612 | { 1613 | "name": "phpunit/phpunit", 1614 | "version": "6.5.14", 1615 | "source": { 1616 | "type": "git", 1617 | "url": "https://github.com/sebastianbergmann/phpunit.git", 1618 | "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7" 1619 | }, 1620 | "dist": { 1621 | "type": "zip", 1622 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7", 1623 | "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7", 1624 | "shasum": "" 1625 | }, 1626 | "require": { 1627 | "ext-dom": "*", 1628 | "ext-json": "*", 1629 | "ext-libxml": "*", 1630 | "ext-mbstring": "*", 1631 | "ext-xml": "*", 1632 | "myclabs/deep-copy": "^1.6.1", 1633 | "phar-io/manifest": "^1.0.1", 1634 | "phar-io/version": "^1.0", 1635 | "php": "^7.0", 1636 | "phpspec/prophecy": "^1.7", 1637 | "phpunit/php-code-coverage": "^5.3", 1638 | "phpunit/php-file-iterator": "^1.4.3", 1639 | "phpunit/php-text-template": "^1.2.1", 1640 | "phpunit/php-timer": "^1.0.9", 1641 | "phpunit/phpunit-mock-objects": "^5.0.9", 1642 | "sebastian/comparator": "^2.1", 1643 | "sebastian/diff": "^2.0", 1644 | "sebastian/environment": "^3.1", 1645 | "sebastian/exporter": "^3.1", 1646 | "sebastian/global-state": "^2.0", 1647 | "sebastian/object-enumerator": "^3.0.3", 1648 | "sebastian/resource-operations": "^1.0", 1649 | "sebastian/version": "^2.0.1" 1650 | }, 1651 | "conflict": { 1652 | "phpdocumentor/reflection-docblock": "3.0.2", 1653 | "phpunit/dbunit": "<3.0" 1654 | }, 1655 | "require-dev": { 1656 | "ext-pdo": "*" 1657 | }, 1658 | "suggest": { 1659 | "ext-xdebug": "*", 1660 | "phpunit/php-invoker": "^1.1" 1661 | }, 1662 | "bin": [ 1663 | "phpunit" 1664 | ], 1665 | "type": "library", 1666 | "extra": { 1667 | "branch-alias": { 1668 | "dev-master": "6.5.x-dev" 1669 | } 1670 | }, 1671 | "autoload": { 1672 | "classmap": [ 1673 | "src/" 1674 | ] 1675 | }, 1676 | "notification-url": "https://packagist.org/downloads/", 1677 | "license": [ 1678 | "BSD-3-Clause" 1679 | ], 1680 | "authors": [ 1681 | { 1682 | "name": "Sebastian Bergmann", 1683 | "email": "sebastian@phpunit.de", 1684 | "role": "lead" 1685 | } 1686 | ], 1687 | "description": "The PHP Unit Testing framework.", 1688 | "homepage": "https://phpunit.de/", 1689 | "keywords": [ 1690 | "phpunit", 1691 | "testing", 1692 | "xunit" 1693 | ], 1694 | "time": "2019-02-01T05:22:47+00:00" 1695 | }, 1696 | { 1697 | "name": "phpunit/phpunit-mock-objects", 1698 | "version": "5.0.10", 1699 | "source": { 1700 | "type": "git", 1701 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", 1702 | "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" 1703 | }, 1704 | "dist": { 1705 | "type": "zip", 1706 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", 1707 | "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", 1708 | "shasum": "" 1709 | }, 1710 | "require": { 1711 | "doctrine/instantiator": "^1.0.5", 1712 | "php": "^7.0", 1713 | "phpunit/php-text-template": "^1.2.1", 1714 | "sebastian/exporter": "^3.1" 1715 | }, 1716 | "conflict": { 1717 | "phpunit/phpunit": "<6.0" 1718 | }, 1719 | "require-dev": { 1720 | "phpunit/phpunit": "^6.5.11" 1721 | }, 1722 | "suggest": { 1723 | "ext-soap": "*" 1724 | }, 1725 | "type": "library", 1726 | "extra": { 1727 | "branch-alias": { 1728 | "dev-master": "5.0.x-dev" 1729 | } 1730 | }, 1731 | "autoload": { 1732 | "classmap": [ 1733 | "src/" 1734 | ] 1735 | }, 1736 | "notification-url": "https://packagist.org/downloads/", 1737 | "license": [ 1738 | "BSD-3-Clause" 1739 | ], 1740 | "authors": [ 1741 | { 1742 | "name": "Sebastian Bergmann", 1743 | "email": "sebastian@phpunit.de", 1744 | "role": "lead" 1745 | } 1746 | ], 1747 | "description": "Mock Object library for PHPUnit", 1748 | "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", 1749 | "keywords": [ 1750 | "mock", 1751 | "xunit" 1752 | ], 1753 | "abandoned": true, 1754 | "time": "2018-08-09T05:50:03+00:00" 1755 | }, 1756 | { 1757 | "name": "sebastian/code-unit-reverse-lookup", 1758 | "version": "1.0.1", 1759 | "source": { 1760 | "type": "git", 1761 | "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", 1762 | "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" 1763 | }, 1764 | "dist": { 1765 | "type": "zip", 1766 | "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", 1767 | "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", 1768 | "shasum": "" 1769 | }, 1770 | "require": { 1771 | "php": "^5.6 || ^7.0" 1772 | }, 1773 | "require-dev": { 1774 | "phpunit/phpunit": "^5.7 || ^6.0" 1775 | }, 1776 | "type": "library", 1777 | "extra": { 1778 | "branch-alias": { 1779 | "dev-master": "1.0.x-dev" 1780 | } 1781 | }, 1782 | "autoload": { 1783 | "classmap": [ 1784 | "src/" 1785 | ] 1786 | }, 1787 | "notification-url": "https://packagist.org/downloads/", 1788 | "license": [ 1789 | "BSD-3-Clause" 1790 | ], 1791 | "authors": [ 1792 | { 1793 | "name": "Sebastian Bergmann", 1794 | "email": "sebastian@phpunit.de" 1795 | } 1796 | ], 1797 | "description": "Looks up which function or method a line of code belongs to", 1798 | "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", 1799 | "time": "2017-03-04T06:30:41+00:00" 1800 | }, 1801 | { 1802 | "name": "sebastian/comparator", 1803 | "version": "2.1.3", 1804 | "source": { 1805 | "type": "git", 1806 | "url": "https://github.com/sebastianbergmann/comparator.git", 1807 | "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" 1808 | }, 1809 | "dist": { 1810 | "type": "zip", 1811 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", 1812 | "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", 1813 | "shasum": "" 1814 | }, 1815 | "require": { 1816 | "php": "^7.0", 1817 | "sebastian/diff": "^2.0 || ^3.0", 1818 | "sebastian/exporter": "^3.1" 1819 | }, 1820 | "require-dev": { 1821 | "phpunit/phpunit": "^6.4" 1822 | }, 1823 | "type": "library", 1824 | "extra": { 1825 | "branch-alias": { 1826 | "dev-master": "2.1.x-dev" 1827 | } 1828 | }, 1829 | "autoload": { 1830 | "classmap": [ 1831 | "src/" 1832 | ] 1833 | }, 1834 | "notification-url": "https://packagist.org/downloads/", 1835 | "license": [ 1836 | "BSD-3-Clause" 1837 | ], 1838 | "authors": [ 1839 | { 1840 | "name": "Jeff Welch", 1841 | "email": "whatthejeff@gmail.com" 1842 | }, 1843 | { 1844 | "name": "Volker Dusch", 1845 | "email": "github@wallbash.com" 1846 | }, 1847 | { 1848 | "name": "Bernhard Schussek", 1849 | "email": "bschussek@2bepublished.at" 1850 | }, 1851 | { 1852 | "name": "Sebastian Bergmann", 1853 | "email": "sebastian@phpunit.de" 1854 | } 1855 | ], 1856 | "description": "Provides the functionality to compare PHP values for equality", 1857 | "homepage": "https://github.com/sebastianbergmann/comparator", 1858 | "keywords": [ 1859 | "comparator", 1860 | "compare", 1861 | "equality" 1862 | ], 1863 | "time": "2018-02-01T13:46:46+00:00" 1864 | }, 1865 | { 1866 | "name": "sebastian/diff", 1867 | "version": "2.0.1", 1868 | "source": { 1869 | "type": "git", 1870 | "url": "https://github.com/sebastianbergmann/diff.git", 1871 | "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" 1872 | }, 1873 | "dist": { 1874 | "type": "zip", 1875 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", 1876 | "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", 1877 | "shasum": "" 1878 | }, 1879 | "require": { 1880 | "php": "^7.0" 1881 | }, 1882 | "require-dev": { 1883 | "phpunit/phpunit": "^6.2" 1884 | }, 1885 | "type": "library", 1886 | "extra": { 1887 | "branch-alias": { 1888 | "dev-master": "2.0-dev" 1889 | } 1890 | }, 1891 | "autoload": { 1892 | "classmap": [ 1893 | "src/" 1894 | ] 1895 | }, 1896 | "notification-url": "https://packagist.org/downloads/", 1897 | "license": [ 1898 | "BSD-3-Clause" 1899 | ], 1900 | "authors": [ 1901 | { 1902 | "name": "Kore Nordmann", 1903 | "email": "mail@kore-nordmann.de" 1904 | }, 1905 | { 1906 | "name": "Sebastian Bergmann", 1907 | "email": "sebastian@phpunit.de" 1908 | } 1909 | ], 1910 | "description": "Diff implementation", 1911 | "homepage": "https://github.com/sebastianbergmann/diff", 1912 | "keywords": [ 1913 | "diff" 1914 | ], 1915 | "time": "2017-08-03T08:09:46+00:00" 1916 | }, 1917 | { 1918 | "name": "sebastian/environment", 1919 | "version": "3.1.0", 1920 | "source": { 1921 | "type": "git", 1922 | "url": "https://github.com/sebastianbergmann/environment.git", 1923 | "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" 1924 | }, 1925 | "dist": { 1926 | "type": "zip", 1927 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", 1928 | "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", 1929 | "shasum": "" 1930 | }, 1931 | "require": { 1932 | "php": "^7.0" 1933 | }, 1934 | "require-dev": { 1935 | "phpunit/phpunit": "^6.1" 1936 | }, 1937 | "type": "library", 1938 | "extra": { 1939 | "branch-alias": { 1940 | "dev-master": "3.1.x-dev" 1941 | } 1942 | }, 1943 | "autoload": { 1944 | "classmap": [ 1945 | "src/" 1946 | ] 1947 | }, 1948 | "notification-url": "https://packagist.org/downloads/", 1949 | "license": [ 1950 | "BSD-3-Clause" 1951 | ], 1952 | "authors": [ 1953 | { 1954 | "name": "Sebastian Bergmann", 1955 | "email": "sebastian@phpunit.de" 1956 | } 1957 | ], 1958 | "description": "Provides functionality to handle HHVM/PHP environments", 1959 | "homepage": "http://www.github.com/sebastianbergmann/environment", 1960 | "keywords": [ 1961 | "Xdebug", 1962 | "environment", 1963 | "hhvm" 1964 | ], 1965 | "time": "2017-07-01T08:51:00+00:00" 1966 | }, 1967 | { 1968 | "name": "sebastian/exporter", 1969 | "version": "3.1.2", 1970 | "source": { 1971 | "type": "git", 1972 | "url": "https://github.com/sebastianbergmann/exporter.git", 1973 | "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" 1974 | }, 1975 | "dist": { 1976 | "type": "zip", 1977 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", 1978 | "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", 1979 | "shasum": "" 1980 | }, 1981 | "require": { 1982 | "php": "^7.0", 1983 | "sebastian/recursion-context": "^3.0" 1984 | }, 1985 | "require-dev": { 1986 | "ext-mbstring": "*", 1987 | "phpunit/phpunit": "^6.0" 1988 | }, 1989 | "type": "library", 1990 | "extra": { 1991 | "branch-alias": { 1992 | "dev-master": "3.1.x-dev" 1993 | } 1994 | }, 1995 | "autoload": { 1996 | "classmap": [ 1997 | "src/" 1998 | ] 1999 | }, 2000 | "notification-url": "https://packagist.org/downloads/", 2001 | "license": [ 2002 | "BSD-3-Clause" 2003 | ], 2004 | "authors": [ 2005 | { 2006 | "name": "Sebastian Bergmann", 2007 | "email": "sebastian@phpunit.de" 2008 | }, 2009 | { 2010 | "name": "Jeff Welch", 2011 | "email": "whatthejeff@gmail.com" 2012 | }, 2013 | { 2014 | "name": "Volker Dusch", 2015 | "email": "github@wallbash.com" 2016 | }, 2017 | { 2018 | "name": "Adam Harvey", 2019 | "email": "aharvey@php.net" 2020 | }, 2021 | { 2022 | "name": "Bernhard Schussek", 2023 | "email": "bschussek@gmail.com" 2024 | } 2025 | ], 2026 | "description": "Provides the functionality to export PHP variables for visualization", 2027 | "homepage": "http://www.github.com/sebastianbergmann/exporter", 2028 | "keywords": [ 2029 | "export", 2030 | "exporter" 2031 | ], 2032 | "time": "2019-09-14T09:02:43+00:00" 2033 | }, 2034 | { 2035 | "name": "sebastian/global-state", 2036 | "version": "2.0.0", 2037 | "source": { 2038 | "type": "git", 2039 | "url": "https://github.com/sebastianbergmann/global-state.git", 2040 | "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" 2041 | }, 2042 | "dist": { 2043 | "type": "zip", 2044 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", 2045 | "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", 2046 | "shasum": "" 2047 | }, 2048 | "require": { 2049 | "php": "^7.0" 2050 | }, 2051 | "require-dev": { 2052 | "phpunit/phpunit": "^6.0" 2053 | }, 2054 | "suggest": { 2055 | "ext-uopz": "*" 2056 | }, 2057 | "type": "library", 2058 | "extra": { 2059 | "branch-alias": { 2060 | "dev-master": "2.0-dev" 2061 | } 2062 | }, 2063 | "autoload": { 2064 | "classmap": [ 2065 | "src/" 2066 | ] 2067 | }, 2068 | "notification-url": "https://packagist.org/downloads/", 2069 | "license": [ 2070 | "BSD-3-Clause" 2071 | ], 2072 | "authors": [ 2073 | { 2074 | "name": "Sebastian Bergmann", 2075 | "email": "sebastian@phpunit.de" 2076 | } 2077 | ], 2078 | "description": "Snapshotting of global state", 2079 | "homepage": "http://www.github.com/sebastianbergmann/global-state", 2080 | "keywords": [ 2081 | "global state" 2082 | ], 2083 | "time": "2017-04-27T15:39:26+00:00" 2084 | }, 2085 | { 2086 | "name": "sebastian/object-enumerator", 2087 | "version": "3.0.3", 2088 | "source": { 2089 | "type": "git", 2090 | "url": "https://github.com/sebastianbergmann/object-enumerator.git", 2091 | "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" 2092 | }, 2093 | "dist": { 2094 | "type": "zip", 2095 | "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", 2096 | "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", 2097 | "shasum": "" 2098 | }, 2099 | "require": { 2100 | "php": "^7.0", 2101 | "sebastian/object-reflector": "^1.1.1", 2102 | "sebastian/recursion-context": "^3.0" 2103 | }, 2104 | "require-dev": { 2105 | "phpunit/phpunit": "^6.0" 2106 | }, 2107 | "type": "library", 2108 | "extra": { 2109 | "branch-alias": { 2110 | "dev-master": "3.0.x-dev" 2111 | } 2112 | }, 2113 | "autoload": { 2114 | "classmap": [ 2115 | "src/" 2116 | ] 2117 | }, 2118 | "notification-url": "https://packagist.org/downloads/", 2119 | "license": [ 2120 | "BSD-3-Clause" 2121 | ], 2122 | "authors": [ 2123 | { 2124 | "name": "Sebastian Bergmann", 2125 | "email": "sebastian@phpunit.de" 2126 | } 2127 | ], 2128 | "description": "Traverses array structures and object graphs to enumerate all referenced objects", 2129 | "homepage": "https://github.com/sebastianbergmann/object-enumerator/", 2130 | "time": "2017-08-03T12:35:26+00:00" 2131 | }, 2132 | { 2133 | "name": "sebastian/object-reflector", 2134 | "version": "1.1.1", 2135 | "source": { 2136 | "type": "git", 2137 | "url": "https://github.com/sebastianbergmann/object-reflector.git", 2138 | "reference": "773f97c67f28de00d397be301821b06708fca0be" 2139 | }, 2140 | "dist": { 2141 | "type": "zip", 2142 | "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", 2143 | "reference": "773f97c67f28de00d397be301821b06708fca0be", 2144 | "shasum": "" 2145 | }, 2146 | "require": { 2147 | "php": "^7.0" 2148 | }, 2149 | "require-dev": { 2150 | "phpunit/phpunit": "^6.0" 2151 | }, 2152 | "type": "library", 2153 | "extra": { 2154 | "branch-alias": { 2155 | "dev-master": "1.1-dev" 2156 | } 2157 | }, 2158 | "autoload": { 2159 | "classmap": [ 2160 | "src/" 2161 | ] 2162 | }, 2163 | "notification-url": "https://packagist.org/downloads/", 2164 | "license": [ 2165 | "BSD-3-Clause" 2166 | ], 2167 | "authors": [ 2168 | { 2169 | "name": "Sebastian Bergmann", 2170 | "email": "sebastian@phpunit.de" 2171 | } 2172 | ], 2173 | "description": "Allows reflection of object attributes, including inherited and non-public ones", 2174 | "homepage": "https://github.com/sebastianbergmann/object-reflector/", 2175 | "time": "2017-03-29T09:07:27+00:00" 2176 | }, 2177 | { 2178 | "name": "sebastian/recursion-context", 2179 | "version": "3.0.0", 2180 | "source": { 2181 | "type": "git", 2182 | "url": "https://github.com/sebastianbergmann/recursion-context.git", 2183 | "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" 2184 | }, 2185 | "dist": { 2186 | "type": "zip", 2187 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", 2188 | "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", 2189 | "shasum": "" 2190 | }, 2191 | "require": { 2192 | "php": "^7.0" 2193 | }, 2194 | "require-dev": { 2195 | "phpunit/phpunit": "^6.0" 2196 | }, 2197 | "type": "library", 2198 | "extra": { 2199 | "branch-alias": { 2200 | "dev-master": "3.0.x-dev" 2201 | } 2202 | }, 2203 | "autoload": { 2204 | "classmap": [ 2205 | "src/" 2206 | ] 2207 | }, 2208 | "notification-url": "https://packagist.org/downloads/", 2209 | "license": [ 2210 | "BSD-3-Clause" 2211 | ], 2212 | "authors": [ 2213 | { 2214 | "name": "Jeff Welch", 2215 | "email": "whatthejeff@gmail.com" 2216 | }, 2217 | { 2218 | "name": "Sebastian Bergmann", 2219 | "email": "sebastian@phpunit.de" 2220 | }, 2221 | { 2222 | "name": "Adam Harvey", 2223 | "email": "aharvey@php.net" 2224 | } 2225 | ], 2226 | "description": "Provides functionality to recursively process PHP variables", 2227 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context", 2228 | "time": "2017-03-03T06:23:57+00:00" 2229 | }, 2230 | { 2231 | "name": "sebastian/resource-operations", 2232 | "version": "1.0.0", 2233 | "source": { 2234 | "type": "git", 2235 | "url": "https://github.com/sebastianbergmann/resource-operations.git", 2236 | "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" 2237 | }, 2238 | "dist": { 2239 | "type": "zip", 2240 | "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", 2241 | "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", 2242 | "shasum": "" 2243 | }, 2244 | "require": { 2245 | "php": ">=5.6.0" 2246 | }, 2247 | "type": "library", 2248 | "extra": { 2249 | "branch-alias": { 2250 | "dev-master": "1.0.x-dev" 2251 | } 2252 | }, 2253 | "autoload": { 2254 | "classmap": [ 2255 | "src/" 2256 | ] 2257 | }, 2258 | "notification-url": "https://packagist.org/downloads/", 2259 | "license": [ 2260 | "BSD-3-Clause" 2261 | ], 2262 | "authors": [ 2263 | { 2264 | "name": "Sebastian Bergmann", 2265 | "email": "sebastian@phpunit.de" 2266 | } 2267 | ], 2268 | "description": "Provides a list of PHP built-in functions that operate on resources", 2269 | "homepage": "https://www.github.com/sebastianbergmann/resource-operations", 2270 | "time": "2015-07-28T20:34:47+00:00" 2271 | }, 2272 | { 2273 | "name": "sebastian/version", 2274 | "version": "2.0.1", 2275 | "source": { 2276 | "type": "git", 2277 | "url": "https://github.com/sebastianbergmann/version.git", 2278 | "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" 2279 | }, 2280 | "dist": { 2281 | "type": "zip", 2282 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", 2283 | "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", 2284 | "shasum": "" 2285 | }, 2286 | "require": { 2287 | "php": ">=5.6" 2288 | }, 2289 | "type": "library", 2290 | "extra": { 2291 | "branch-alias": { 2292 | "dev-master": "2.0.x-dev" 2293 | } 2294 | }, 2295 | "autoload": { 2296 | "classmap": [ 2297 | "src/" 2298 | ] 2299 | }, 2300 | "notification-url": "https://packagist.org/downloads/", 2301 | "license": [ 2302 | "BSD-3-Clause" 2303 | ], 2304 | "authors": [ 2305 | { 2306 | "name": "Sebastian Bergmann", 2307 | "email": "sebastian@phpunit.de", 2308 | "role": "lead" 2309 | } 2310 | ], 2311 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", 2312 | "homepage": "https://github.com/sebastianbergmann/version", 2313 | "time": "2016-10-03T07:35:21+00:00" 2314 | }, 2315 | { 2316 | "name": "symfony/polyfill-ctype", 2317 | "version": "v1.17.1", 2318 | "source": { 2319 | "type": "git", 2320 | "url": "https://github.com/symfony/polyfill-ctype.git", 2321 | "reference": "2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d" 2322 | }, 2323 | "dist": { 2324 | "type": "zip", 2325 | "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d", 2326 | "reference": "2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d", 2327 | "shasum": "" 2328 | }, 2329 | "require": { 2330 | "php": ">=5.3.3" 2331 | }, 2332 | "suggest": { 2333 | "ext-ctype": "For best performance" 2334 | }, 2335 | "type": "library", 2336 | "extra": { 2337 | "branch-alias": { 2338 | "dev-master": "1.17-dev" 2339 | }, 2340 | "thanks": { 2341 | "name": "symfony/polyfill", 2342 | "url": "https://github.com/symfony/polyfill" 2343 | } 2344 | }, 2345 | "autoload": { 2346 | "psr-4": { 2347 | "Symfony\\Polyfill\\Ctype\\": "" 2348 | }, 2349 | "files": [ 2350 | "bootstrap.php" 2351 | ] 2352 | }, 2353 | "notification-url": "https://packagist.org/downloads/", 2354 | "license": [ 2355 | "MIT" 2356 | ], 2357 | "authors": [ 2358 | { 2359 | "name": "Gert de Pagter", 2360 | "email": "BackEndTea@gmail.com" 2361 | }, 2362 | { 2363 | "name": "Symfony Community", 2364 | "homepage": "https://symfony.com/contributors" 2365 | } 2366 | ], 2367 | "description": "Symfony polyfill for ctype functions", 2368 | "homepage": "https://symfony.com", 2369 | "keywords": [ 2370 | "compatibility", 2371 | "ctype", 2372 | "polyfill", 2373 | "portable" 2374 | ], 2375 | "funding": [ 2376 | { 2377 | "url": "https://symfony.com/sponsor", 2378 | "type": "custom" 2379 | }, 2380 | { 2381 | "url": "https://github.com/fabpot", 2382 | "type": "github" 2383 | }, 2384 | { 2385 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 2386 | "type": "tidelift" 2387 | } 2388 | ], 2389 | "time": "2020-06-06T08:46:27+00:00" 2390 | }, 2391 | { 2392 | "name": "theseer/tokenizer", 2393 | "version": "1.1.3", 2394 | "source": { 2395 | "type": "git", 2396 | "url": "https://github.com/theseer/tokenizer.git", 2397 | "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" 2398 | }, 2399 | "dist": { 2400 | "type": "zip", 2401 | "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", 2402 | "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", 2403 | "shasum": "" 2404 | }, 2405 | "require": { 2406 | "ext-dom": "*", 2407 | "ext-tokenizer": "*", 2408 | "ext-xmlwriter": "*", 2409 | "php": "^7.0" 2410 | }, 2411 | "type": "library", 2412 | "autoload": { 2413 | "classmap": [ 2414 | "src/" 2415 | ] 2416 | }, 2417 | "notification-url": "https://packagist.org/downloads/", 2418 | "license": [ 2419 | "BSD-3-Clause" 2420 | ], 2421 | "authors": [ 2422 | { 2423 | "name": "Arne Blankerts", 2424 | "email": "arne@blankerts.de", 2425 | "role": "Developer" 2426 | } 2427 | ], 2428 | "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", 2429 | "time": "2019-06-13T22:48:21+00:00" 2430 | }, 2431 | { 2432 | "name": "webmozart/assert", 2433 | "version": "1.9.0", 2434 | "source": { 2435 | "type": "git", 2436 | "url": "https://github.com/webmozart/assert.git", 2437 | "reference": "9dc4f203e36f2b486149058bade43c851dd97451" 2438 | }, 2439 | "dist": { 2440 | "type": "zip", 2441 | "url": "https://api.github.com/repos/webmozart/assert/zipball/9dc4f203e36f2b486149058bade43c851dd97451", 2442 | "reference": "9dc4f203e36f2b486149058bade43c851dd97451", 2443 | "shasum": "" 2444 | }, 2445 | "require": { 2446 | "php": "^5.3.3 || ^7.0", 2447 | "symfony/polyfill-ctype": "^1.8" 2448 | }, 2449 | "conflict": { 2450 | "phpstan/phpstan": "<0.12.20", 2451 | "vimeo/psalm": "<3.9.1" 2452 | }, 2453 | "require-dev": { 2454 | "phpunit/phpunit": "^4.8.36 || ^7.5.13" 2455 | }, 2456 | "type": "library", 2457 | "autoload": { 2458 | "psr-4": { 2459 | "Webmozart\\Assert\\": "src/" 2460 | } 2461 | }, 2462 | "notification-url": "https://packagist.org/downloads/", 2463 | "license": [ 2464 | "MIT" 2465 | ], 2466 | "authors": [ 2467 | { 2468 | "name": "Bernhard Schussek", 2469 | "email": "bschussek@gmail.com" 2470 | } 2471 | ], 2472 | "description": "Assertions to validate method input/output with nice error messages.", 2473 | "keywords": [ 2474 | "assert", 2475 | "check", 2476 | "validate" 2477 | ], 2478 | "time": "2020-06-16T10:16:42+00:00" 2479 | } 2480 | ], 2481 | "aliases": [], 2482 | "minimum-stability": "stable", 2483 | "stability-flags": [], 2484 | "prefer-stable": false, 2485 | "prefer-lowest": false, 2486 | "platform": [], 2487 | "platform-dev": [], 2488 | "plugin-api-version": "1.1.0" 2489 | } 2490 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | ./components 11 | HtmlCompressor.php 12 | Exception.php 13 | View.php 14 | 15 | 16 | 17 | 18 | ./tests/unit/view 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /tests/unit/.gitignore: -------------------------------------------------------------------------------- 1 | runtime/cache/* -------------------------------------------------------------------------------- /tests/unit/TestCase.php: -------------------------------------------------------------------------------- 1 | getParam('components')['assetManager']['basePath']); 33 | file_put_contents(__DIR__ . '/runtime/compress.html', ''); 34 | $this->mockApplication(); 35 | } 36 | 37 | /** 38 | * @throws \yii\base\ErrorException 39 | */ 40 | protected function tearDown() 41 | { 42 | unlink(__DIR__ . '/runtime/compress.html'); 43 | FileHelper::removeDirectory($this->getParam('components')['view']['minifyPath']); 44 | FileHelper::removeDirectory($this->getParam('components')['assetManager']['basePath']); 45 | FileHelper::removeDirectory(__DIR__ . '/runtime/cache/'); 46 | $this->destroyApplication(); 47 | parent::tearDown(); 48 | } 49 | 50 | /** 51 | * Populates Yii::$app with a new application 52 | * The application will be destroyed on tearDown() automatically. 53 | * @param string $appClass 54 | */ 55 | protected function mockApplication($appClass = 'yii\console\Application') 56 | { 57 | // for update self::$params 58 | $this->getParam('id'); 59 | 60 | /** @var \yii\console\Application $app */ 61 | new $appClass(self::$params); 62 | } 63 | 64 | /** 65 | * Destroys the application instance created by [[mockApplication]]. 66 | */ 67 | protected function destroyApplication() 68 | { 69 | \Yii::$app = null; 70 | } 71 | 72 | /** 73 | * Returns a test configuration param from /data/config.php 74 | * @param string $name params name 75 | * @param mixed $default default value to use when param is not set. 76 | * @return mixed the value of the configuration param 77 | */ 78 | public function getParam($name, $default = null) 79 | { 80 | if (self::$params === null) { 81 | self::$params = require __DIR__ . '/config/main.php'; 82 | 83 | $mainLocal = __DIR__ . '/config/main-local.php'; 84 | 85 | if (file_exists($mainLocal)) { 86 | self::$params = ArrayHelper::merge(self::$params, require $mainLocal); 87 | } 88 | } 89 | 90 | return isset(self::$params[$name]) ? self::$params[$name] : $default; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /tests/unit/bootstrap.php: -------------------------------------------------------------------------------- 1 | 'testapp', 11 | 'basePath' => BASE_PATH, 12 | 'components' => [ 13 | 'view' => [ 14 | 'class' => 'rmrevin\yii\minify\View', 15 | 'minifyPath' => BASE_PATH . '/runtime/minyfy', 16 | 'basePath' => BASE_PATH . '/runtime', 17 | 'webPath' => '/runtime', 18 | 'forceCharset' => 'CP1251', 19 | 'cache' => 'cache', 20 | ], 21 | 'assetManager' => [ 22 | 'basePath' => BASE_PATH . '/runtime/assets', 23 | 'baseUrl' => '/assets', 24 | ], 25 | 'cache' => [ 26 | 'class' => 'yii\caching\FileCache', 27 | ], 28 | ], 29 | ]; 30 | -------------------------------------------------------------------------------- /tests/unit/data/CommentsAssetBundle.php: -------------------------------------------------------------------------------- 1 | View::POS_END, 29 | ]; 30 | 31 | public function init() 32 | { 33 | $this->sourcePath = __DIR__ . '/source'; 34 | 35 | parent::init(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tests/unit/data/DependAssetBundle.php: -------------------------------------------------------------------------------- 1 | View::POS_HEAD, 30 | ]; 31 | 32 | public $depends = [ 33 | 'rmrevin\yii\minify\tests\unit\data\JQueryAssetBundle', 34 | ]; 35 | 36 | public function init() 37 | { 38 | $this->sourcePath = __DIR__ . '/source'; 39 | 40 | parent::init(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tests/unit/data/EmptyAssetBundle.php: -------------------------------------------------------------------------------- 1 | sourcePath = __DIR__ . '/source'; 30 | 31 | parent::init(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /tests/unit/data/JQueryAssetBundle.php: -------------------------------------------------------------------------------- 1 | View::POS_HEAD, 26 | ]; 27 | 28 | public function init() 29 | { 30 | $this->sourcePath = __DIR__ . '/source'; 31 | 32 | parent::init(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /tests/unit/data/PrintAssetBundle.php: -------------------------------------------------------------------------------- 1 | 'print', 25 | ]; 26 | 27 | public function init() 28 | { 29 | $this->sourcePath = __DIR__ . '/source'; 30 | 31 | parent::init(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /tests/unit/data/TestAssetBundle.php: -------------------------------------------------------------------------------- 1 | View::POS_READY, 30 | ]; 31 | 32 | public $cssOptions = [ 33 | 'media' => 'all', 34 | ]; 35 | 36 | public $depends = [ 37 | 'rmrevin\yii\minify\tests\unit\data\DependAssetBundle', 38 | ]; 39 | 40 | public function init() 41 | { 42 | $this->sourcePath = __DIR__ . '/source'; 43 | 44 | parent::init(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /tests/unit/data/source/comments.css: -------------------------------------------------------------------------------- 1 | /** * 2 | * comment ****\/ 3 | *** * */ 4 | 5 | 6 | div.test { 7 | /* color: red; */ 8 | border: 1px solid #000000; 9 | width: 100%; 10 | height: 100%; 11 | } 12 | -------------------------------------------------------------------------------- /tests/unit/data/source/comments.js: -------------------------------------------------------------------------------- 1 | 2 | //remove comment 3 | this1 //remove comment 4 | this2 /* remove comment */ 5 | this3 /* remove 6 | comment */ 7 | this4 /* * * remove 8 | * * * * 9 | comment * * */ 10 | this5 http://removecomment.com 11 | id = id.replace(/\//g,'');//do not remove the regex // 12 | HTTP+'//www.googleadservices.com/pagead/conversion' 13 | /** 14 | * @var test 15 | */ 16 | -------------------------------------------------------------------------------- /tests/unit/data/source/depend.css: -------------------------------------------------------------------------------- 1 | /** depend css */ 2 | 3 | @charset "UTF-8"; 4 | 5 | @import url(//fonts.googleapis.com/css?family=Open+Sans); 6 | 7 | .depend { 8 | background: url('image.png'); 9 | /*width*/ 10 | } 11 | 12 | .depend { background: url('http://hello'); } -------------------------------------------------------------------------------- /tests/unit/data/source/depend.js: -------------------------------------------------------------------------------- 1 | /** depend js */ 2 | 3 | function depend() { 4 | console.log('depend'); 5 | } -------------------------------------------------------------------------------- /tests/unit/data/source/excluded.css: -------------------------------------------------------------------------------- 1 | .excluded { 2 | color: red; 3 | } -------------------------------------------------------------------------------- /tests/unit/data/source/excluded.js: -------------------------------------------------------------------------------- 1 | console.log('excluded'); 2 | -------------------------------------------------------------------------------- /tests/unit/data/source/for_import.css: -------------------------------------------------------------------------------- 1 | /** file for import test **/ 2 | .test { 3 | color: rebeccapurple; 4 | } -------------------------------------------------------------------------------- /tests/unit/data/source/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmrevin/yii2-minify-view/2b99b5a061200cc0ab3633ed6f6fa05dedb2af6e/tests/unit/data/source/image.png -------------------------------------------------------------------------------- /tests/unit/data/source/print.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | .print-hide { 4 | display: none; 5 | } 6 | 7 | .bad > div > .formatting{ color: gray; } 8 | -------------------------------------------------------------------------------- /tests/unit/data/source/test.css: -------------------------------------------------------------------------------- 1 | /** css */ 2 | @import url(http://fonts.googleapis.com/css?family=Open+Sans); 3 | @import url("for_import.css"); 4 | 5 | /** 6 | comment 7 | */ 8 | 9 | div.test { 10 | /* color: red; */ 11 | border: 1px solid #000000; 12 | width: 100%; 13 | height: 100%; 14 | background: url(data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7) no-repeat top right; 15 | } 16 | -------------------------------------------------------------------------------- /tests/unit/data/source/test.js: -------------------------------------------------------------------------------- 1 | /** js */ 2 | 3 | function test() { 4 | console.log('hello'); 5 | } 6 | -------------------------------------------------------------------------------- /tests/unit/runtime/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /tests/unit/view/HtmlCompressorTest.php: -------------------------------------------------------------------------------- 1 | 23 |

Inside text

24 | 25 |
    Inside pre\n    test
26 | "; 27 | 28 | $result = '

Inside text

    Inside pre
30 |     test
'; 31 | 32 | $this->assertEquals($result, HtmlCompressor::compress($str)); 33 | $this->assertEquals($result, \Minify_HTML::minify($str)); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /tests/unit/view/ViewTest.php: -------------------------------------------------------------------------------- 1 | assertInstanceOf('rmrevin\yii\minify\View', $this->getView()); 24 | 25 | $this->assertEquals('CP1251', $this->getView()->forceCharset); 26 | } 27 | 28 | public function testEmptyBundle() 29 | { 30 | $view = $this->getView(); 31 | 32 | minify\tests\unit\data\EmptyAssetBundle::register($this->getView()); 33 | 34 | ob_start(); 35 | echo 'This is test page'; 36 | 37 | $view->endBody(); 38 | $view->endPage(); 39 | 40 | $files = FileHelper::findFiles($this->getView()->minifyPath); 41 | 42 | $this->assertCount(0, $files); 43 | 44 | foreach ($files as $file) { 45 | $this->assertNotEmpty(file_get_contents($file)); 46 | } 47 | } 48 | 49 | public function testEndPage() 50 | { 51 | $view = $this->getView(); 52 | 53 | minify\tests\unit\data\TestAssetBundle::register($this->getView()); 54 | 55 | ob_start(); 56 | echo 'This is test page'; 57 | 58 | $view->endBody(); 59 | $view->endPage(); 60 | 61 | $files = FileHelper::findFiles($this->getView()->minifyPath); 62 | 63 | $this->assertCount(2, $files); 64 | 65 | foreach ($files as $file) { 66 | $this->assertNotEmpty(file_get_contents($file)); 67 | } 68 | } 69 | 70 | public function testRemoveComments() 71 | { 72 | $view = $this->getView(); 73 | 74 | minify\tests\unit\data\CommentsAssetBundle::register($view); 75 | 76 | ob_start(); 77 | echo 'This is test page versioning'; 78 | 79 | $view->endBody(); 80 | 81 | $view->endPage(); 82 | 83 | $files = FileHelper::findFiles($this->getView()->minifyPath); 84 | 85 | foreach ($files as $file) { 86 | $content = file_get_contents($file); 87 | 88 | if (false !== mb_strpos($file, '.js')) { 89 | $this->assertEquals("this1 90 | this2 91 | this3 92 | this4 93 | this5 http:id=id.replace(/\\//g,'');HTTP+'//www.googleadservices.com/pagead/conversion';", $content); 94 | } 95 | 96 | if (false !== mb_strpos($file, '.css')) { 97 | $this->assertEquals('@charset "CP1251"; 98 | div.test{border:1px solid #000;width:100%;height:100%}', $content); 99 | } 100 | } 101 | } 102 | 103 | public function testMediaPrint() 104 | { 105 | $view = $this->getView(); 106 | 107 | minify\tests\unit\data\PrintAssetBundle::register($view); 108 | 109 | ob_start(); 110 | echo 'This is test page versioning'; 111 | 112 | $view->endBody(); 113 | 114 | $view->endPage(); 115 | 116 | $files = FileHelper::findFiles($this->getView()->minifyPath); 117 | 118 | foreach ($files as $file) { 119 | $content = file_get_contents($file); 120 | 121 | $this->assertEquals('@charset "CP1251"; 122 | @media print{.print-hide{display:none}.bad>div>.formatting{color:gray}}', $content); 123 | } 124 | } 125 | 126 | public function testMainWithVersion() 127 | { 128 | $view = $this->getView(); 129 | $view->assetManager->appendTimestamp = true; 130 | 131 | $this->assertInstanceOf(minify\View::className(), $view); 132 | 133 | $this->assertEquals('CP1251', $view->forceCharset); 134 | } 135 | 136 | public function testEndPageWithVersion() 137 | { 138 | $view = $this->getView(); 139 | $view->assetManager->appendTimestamp = true; 140 | 141 | minify\tests\unit\data\TestAssetBundle::register($view); 142 | 143 | ob_start(); 144 | echo 'This is test page with versioning'; 145 | 146 | $view->endBody(); 147 | 148 | $this->assertCount(2, $view->jsFiles[minify\View::POS_HEAD]); 149 | $this->assertCount(1, $view->jsFiles[minify\View::POS_READY]); 150 | 151 | $view->endPage(); 152 | 153 | $files = FileHelper::findFiles($view->minifyPath); 154 | 155 | $this->assertCount(2, $files); 156 | 157 | foreach ($files as $file) { 158 | $this->assertNotEmpty(file_get_contents($file)); 159 | } 160 | } 161 | 162 | public function testAlternativeEndPageWithVersion() 163 | { 164 | $view = $this->getView(); 165 | $view->assetManager->appendTimestamp = true; 166 | 167 | $view->expandImports = false; 168 | $view->forceCharset = false; 169 | 170 | minify\tests\unit\data\TestAssetBundle::register($view); 171 | 172 | ob_start(); 173 | echo 'This is test page versioning'; 174 | 175 | $view->endBody(); 176 | 177 | $this->assertCount(2, $view->jsFiles[minify\View::POS_HEAD]); 178 | $this->assertCount(1, $view->jsFiles[minify\View::POS_READY]); 179 | 180 | foreach ((array)$view->jsFiles[minify\View::POS_HEAD] as $file => $html) { 181 | if (Url::isRelative($file)) { 182 | $this->assertNotFalse(mb_strpos($file, '?v=')); 183 | } 184 | } 185 | 186 | foreach ((array)$view->jsFiles[minify\View::POS_READY] as $file => $html) { 187 | if (Url::isRelative($file)) { 188 | $this->assertNotFalse(mb_strpos($file, '?v=')); 189 | } 190 | } 191 | 192 | $view->endPage(); 193 | } 194 | 195 | public function testFiletimeCheckAlgorithm() 196 | { 197 | $view = $this->getView(); 198 | $view->fileCheckAlgorithm = 'filemtime'; 199 | 200 | minify\tests\unit\data\TestAssetBundle::register($view); 201 | 202 | ob_start(); 203 | echo 'This is test page versioning'; 204 | 205 | $view->endBody(); 206 | 207 | $this->assertCount(2, $view->jsFiles[minify\View::POS_HEAD]); 208 | $this->assertCount(1, $view->jsFiles[minify\View::POS_READY]); 209 | 210 | $view->endPage(); 211 | } 212 | 213 | public function testExcludeBundles() 214 | { 215 | $view = $this->getView(); 216 | $view->excludeBundles = [ 217 | minify\tests\unit\data\ExcludedAssetBundle::className(), 218 | ]; 219 | 220 | $view->init(); 221 | 222 | minify\tests\unit\data\TestAssetBundle::register($view); 223 | minify\tests\unit\data\ExcludedAssetBundle::register($view); 224 | 225 | ob_start(); 226 | echo 'This is test page versioning'; 227 | 228 | $view->endBody(); 229 | 230 | $this->assertCount(2, $view->cssFiles); 231 | $this->assertCount(3, $view->jsFiles); 232 | 233 | $view->endPage(); 234 | } 235 | 236 | public function testExcludeFiles() 237 | { 238 | $view = $this->getView(); 239 | $view->excludeFiles = [ 240 | 'excluded.css', 241 | ]; 242 | 243 | minify\tests\unit\data\TestAssetBundle::register($view); 244 | minify\tests\unit\data\ExcludedAssetBundle::register($view); 245 | 246 | ob_start(); 247 | echo 'This is test page versioning'; 248 | 249 | $view->endBody(); 250 | 251 | $this->assertCount(2, $view->cssFiles); 252 | $this->assertCount(3, $view->jsFiles); 253 | 254 | $view->endPage(); 255 | } 256 | 257 | /** 258 | * @return minify\View 259 | */ 260 | protected function getView() 261 | { 262 | return \Yii::$app->getView(); 263 | } 264 | } 265 | --------------------------------------------------------------------------------