1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-16 20:28:28 +01:00

Updated vendor folder.

This commit is contained in:
Cameron 2021-01-04 05:24:35 -08:00
parent f9492a8c89
commit f20f00408c
10 changed files with 149 additions and 45 deletions

View File

@ -24,10 +24,11 @@
"php": ">=5.6",
"ext-json": "*",
"ext-pdo": "*",
"hybridauth/hybridauth": "^3.1.1",
"phpmailer/phpmailer": "^6.1",
"ifsnop/mysqldump-php": "^2.8",
"matthiasmullie/minify": "^1.3",
"intervention/image": "^2.5"
"hybridauth/hybridauth": "^3.6.0",
"phpmailer/phpmailer": "^6.2.0",
"ifsnop/mysqldump-php": "^2.9",
"matthiasmullie/minify": "^1.3.65",
"intervention/image": "^2.5.1",
"": ""
}
}

28
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "69374030afa61b1e84c6c973551b0e5f",
"content-hash": "12129f1e8aec686d7cae22b9281fe71d",
"packages": [
{
"name": "firebase/php-jwt",
@ -330,16 +330,16 @@
},
{
"name": "matthiasmullie/minify",
"version": "1.3.63",
"version": "1.3.65",
"source": {
"type": "git",
"url": "https://github.com/matthiasmullie/minify.git",
"reference": "9ba1b459828adc13430f4dd6c49dae4950dc4117"
"reference": "227f19062451c55a797e0cc667ef983834e6580c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/matthiasmullie/minify/zipball/9ba1b459828adc13430f4dd6c49dae4950dc4117",
"reference": "9ba1b459828adc13430f4dd6c49dae4950dc4117",
"url": "https://api.github.com/repos/matthiasmullie/minify/zipball/227f19062451c55a797e0cc667ef983834e6580c",
"reference": "227f19062451c55a797e0cc667ef983834e6580c",
"shasum": ""
},
"require": {
@ -388,9 +388,23 @@
],
"support": {
"issues": "https://github.com/matthiasmullie/minify/issues",
"source": "https://github.com/matthiasmullie/minify/tree/1.3.63"
"source": "https://github.com/matthiasmullie/minify/tree/1.3.65"
},
"time": "2020-01-21T20:21:08+00:00"
"funding": [
{
"url": "https://github.com/[user1",
"type": "github"
},
{
"url": "https://github.com/matthiasmullie] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g.",
"type": "github"
},
{
"url": "https://github.com/user2",
"type": "github"
}
],
"time": "2020-12-27T21:43:29+00:00"
},
{
"name": "matthiasmullie/path-converter",

View File

@ -1 +1,14 @@
../matthiasmullie/minify/bin/minifycss
#!/usr/bin/env sh
dir=$(cd "${0%[/\\]*}" > /dev/null; cd "../matthiasmullie/minify/bin" && pwd)
if [ -d /proc/cygdrive ]; then
case $(which php) in
$(readlink -n /proc/cygdrive)/*)
# We are in Cygwin using Windows php, so the path must be translated
dir=$(cygpath -m "$dir");
;;
esac
fi
"${dir}/minifycss" "$@"

View File

@ -1 +1,14 @@
../matthiasmullie/minify/bin/minifyjs
#!/usr/bin/env sh
dir=$(cd "${0%[/\\]*}" > /dev/null; cd "../matthiasmullie/minify/bin" && pwd)
if [ -d /proc/cygdrive ]; then
case $(which php) in
$(readlink -n /proc/cygdrive)/*)
# We are in Cygwin using Windows php, so the path must be translated
dir=$(cygpath -m "$dir");
;;
esac
fi
"${dir}/minifyjs" "$@"

View File

@ -29,7 +29,7 @@ private static $installed = array (
'aliases' =>
array (
),
'reference' => '153cf33aa76c3378a8332616fe68fd796d00343b',
'reference' => 'f9492a8c89860284979e9b947dc04836bc20d33b',
'name' => 'e107inc/e107',
),
'versions' =>
@ -41,7 +41,7 @@ private static $installed = array (
'aliases' =>
array (
),
'reference' => '153cf33aa76c3378a8332616fe68fd796d00343b',
'reference' => 'f9492a8c89860284979e9b947dc04836bc20d33b',
),
'firebase/php-jwt' =>
array (
@ -90,12 +90,12 @@ private static $installed = array (
),
'matthiasmullie/minify' =>
array (
'pretty_version' => '1.3.63',
'version' => '1.3.63.0',
'pretty_version' => '1.3.65',
'version' => '1.3.65.0',
'aliases' =>
array (
),
'reference' => '9ba1b459828adc13430f4dd6c49dae4950dc4117',
'reference' => '227f19062451c55a797e0cc667ef983834e6580c',
),
'matthiasmullie/path-converter' =>
array (

View File

@ -335,17 +335,17 @@
},
{
"name": "matthiasmullie/minify",
"version": "1.3.63",
"version_normalized": "1.3.63.0",
"version": "1.3.65",
"version_normalized": "1.3.65.0",
"source": {
"type": "git",
"url": "https://github.com/matthiasmullie/minify.git",
"reference": "9ba1b459828adc13430f4dd6c49dae4950dc4117"
"reference": "227f19062451c55a797e0cc667ef983834e6580c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/matthiasmullie/minify/zipball/9ba1b459828adc13430f4dd6c49dae4950dc4117",
"reference": "9ba1b459828adc13430f4dd6c49dae4950dc4117",
"url": "https://api.github.com/repos/matthiasmullie/minify/zipball/227f19062451c55a797e0cc667ef983834e6580c",
"reference": "227f19062451c55a797e0cc667ef983834e6580c",
"shasum": ""
},
"require": {
@ -361,7 +361,7 @@
"suggest": {
"psr/cache-implementation": "Cache implementation to use with Minify::cache"
},
"time": "2020-01-21T20:21:08+00:00",
"time": "2020-12-27T21:43:29+00:00",
"bin": [
"bin/minifycss",
"bin/minifyjs"
@ -396,8 +396,22 @@
],
"support": {
"issues": "https://github.com/matthiasmullie/minify/issues",
"source": "https://github.com/matthiasmullie/minify/tree/1.3.63"
"source": "https://github.com/matthiasmullie/minify/tree/1.3.65"
},
"funding": [
{
"url": "https://github.com/[user1",
"type": "github"
},
{
"url": "https://github.com/matthiasmullie] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g.",
"type": "github"
},
{
"url": "https://github.com/user2",
"type": "github"
}
],
"install-path": "../matthiasmullie/minify"
},
{

View File

@ -6,7 +6,7 @@
'aliases' =>
array (
),
'reference' => '153cf33aa76c3378a8332616fe68fd796d00343b',
'reference' => 'f9492a8c89860284979e9b947dc04836bc20d33b',
'name' => 'e107inc/e107',
),
'versions' =>
@ -18,7 +18,7 @@
'aliases' =>
array (
),
'reference' => '153cf33aa76c3378a8332616fe68fd796d00343b',
'reference' => 'f9492a8c89860284979e9b947dc04836bc20d33b',
),
'firebase/php-jwt' =>
array (
@ -67,12 +67,12 @@
),
'matthiasmullie/minify' =>
array (
'pretty_version' => '1.3.63',
'version' => '1.3.63.0',
'pretty_version' => '1.3.65',
'version' => '1.3.65.0',
'aliases' =>
array (
),
'reference' => '9ba1b459828adc13430f4dd6c49dae4950dc4117',
'reference' => '227f19062451c55a797e0cc667ef983834e6580c',
),
'matthiasmullie/path-converter' =>
array (

View File

@ -6,7 +6,7 @@ WORKDIR /var/www
RUN apt-get update
RUN apt-get install -y zip unzip zlib1g-dev
RUN docker-php-ext-install zip
RUN if [[ `php-config --vernum` -ge 73000 ]]; then docker-php-ext-install zip; fi
RUN docker-php-ext-install pcntl
RUN curl -sS https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer

View File

@ -9,6 +9,21 @@ services:
- ./data:/var/www/data
- ./tests:/var/www/tests
- ./phpunit.xml.dist:/var/www/phpunit.xml.dist
'8.0':
extends: php
build:
args:
version: 8.0-cli
'7.4':
extends: php
build:
args:
version: 7.4-cli
'7.3':
extends: php
build:
args:
version: 7.3-cli
'7.2':
extends: php
build:

View File

@ -216,7 +216,7 @@ class CSS extends Minify
// grab referenced file & minify it (which may include importing
// yet other @import statements recursively)
$minifier = new static($importPath);
$minifier = new self($importPath);
$minifier->setMaxImportSize($this->maxImportSize);
$minifier->setImportExtensions($this->importExtensions);
$importContent = $minifier->execute($source, $parents);
@ -307,7 +307,8 @@ class CSS extends Minify
*/
$this->extractStrings();
$this->stripComments();
$this->extractCalcs();
$this->extractMath();
$this->extractCustomProperties();
$css = $this->replace($css);
$css = $this->stripWhitespace($css);
@ -678,19 +679,29 @@ class CSS extends Minify
}
/**
* Replace all `calc()` occurrences.
* Replace all occurrences of functions that may contain math, where
* whitespace around operators needs to be preserved (e.g. calc, clamp)
*/
protected function extractCalcs()
protected function extractMath()
{
$functions = array('calc', 'clamp', 'min', 'max');
$pattern = '/('. implode('|', $functions) .')(\(.+?)(?=$|;|})/m';
// PHP only supports $this inside anonymous functions since 5.4
$minifier = $this;
$callback = function ($match) use ($minifier) {
$length = strlen($match[1]);
$callback = function ($match) use ($minifier, $pattern, &$callback) {
$function = $match[1];
$length = strlen($match[2]);
$expr = '';
$opened = 0;
// the regular expression for extracting math has 1 significant problem:
// it can't determine the correct closing parenthesis...
// instead, it'll match a larger portion of code to where it's certain that
// the calc() musts have ended, and we'll figure out which is the correct
// closing parenthesis here, by counting how many have opened
for ($i = 0; $i < $length; $i++) {
$char = $match[1][$i];
$char = $match[2][$i];
$expr .= $char;
if ($char === '(') {
$opened++;
@ -698,18 +709,41 @@ class CSS extends Minify
break;
}
}
$rest = str_replace($expr, '', $match[1]);
$expr = trim(substr($expr, 1, -1));
// now that we've figured out where the calc() starts and ends, extract it
$count = count($minifier->extracted);
$placeholder = 'calc('.$count.')';
$minifier->extracted[$placeholder] = 'calc('.$expr.')';
$placeholder = 'math('.$count.')';
$minifier->extracted[$placeholder] = $function.'('.trim(substr($expr, 1, -1)).')';
// and since we've captured more code than required, we may have some leftover
// calc() in here too - go recursive on the remaining but of code to go figure
// that out and extract what is needed
$rest = str_replace($function.$expr, '', $match[0]);
$rest = preg_replace_callback($pattern, $callback, $rest);
return $placeholder.$rest;
};
$this->registerPattern('/calc(\(.+?)(?=$|;|}|calc\()/', $callback);
$this->registerPattern('/calc(\(.+?)(?=$|;|}|calc\()/m', $callback);
$this->registerPattern($pattern, $callback);
}
/**
* Replace custom properties, whose values may be used in scenarios where
* we wouldn't want them to be minified (e.g. inside calc)
*/
protected function extractCustomProperties()
{
// PHP only supports $this inside anonymous functions since 5.4
$minifier = $this;
$this->registerPattern(
'/(?<=^|[;}])(--[^:;{}"\'\s]+)\s*:([^;{}]+)/m',
function ($match) use ($minifier) {
$placeholder = '--custom-'. count($minifier->extracted) . ':0';
$minifier->extracted[$placeholder] = $match[1] .':'. trim($match[2]);
return $placeholder;
}
);
}
/**