Skip to content
Snippets Groups Projects
Commit 0dbafb0b authored by Sergey Ivashchenko's avatar Sergey Ivashchenko
Browse files

Merge branch 'develop' of https://github.corp.ebay.com/magento2/magento2ce into MAGETWO-33616

parents 4bad98a3 bee1a30a
Branches
No related merge requests found
......@@ -54,7 +54,7 @@ sub vcl_recv {
std.collect(req.http.Cookie);
# static files are always cacheable. remove SSL flag and cookie
if (req.url ~ "^/(pub/)?(media|static)/.*\.(png|jpg|jpeg|gif|css|js|swf|ico|woff|svg)$") {
if (req.url ~ "^/(pub/)?(media|static)/.*\.(ico|css|js|jpg|jpeg|png|gif|tiff|bmp|gz|tgz|bz2|tbz|mp3|ogg|svg|swf|woff|woff2|eot|ttf|otf)$") {
unset req.http.Https;
unset req.http.Cookie;
}
......@@ -96,7 +96,7 @@ sub vcl_fetch {
# images, css and js are cacheable by default so we have to remove cookie also
if (beresp.ttl > 0s && (req.request == "GET" || req.request == "HEAD")) {
unset beresp.http.set-cookie;
if (req.url !~ "\.(css|js|jpg|png|gif|tiff|bmp|gz|tgz|bz2|tbz|mp3|ogg|svg|swf|woff)(\?|$)") {
if (req.url !~ "\.(ico|css|js|jpg|jpeg|png|gif|tiff|bmp|mp3|ogg|svg|swf|woff|woff2|eot|ttf|otf)(\?|$)") {
set beresp.http.Pragma = "no-cache";
set beresp.http.Expires = "-1";
set beresp.http.Cache-Control = "no-store, no-cache, must-revalidate, max-age=0";
......
......@@ -47,7 +47,7 @@ sub vcl_recv {
std.collect(req.http.Cookie);
# static files are always cacheable. remove SSL flag and cookie
if (req.url ~ "^/(pub/)?(media|static)/.*\.(png|jpg|jpeg|gif|css|js|swf|ico|woff|svg)$") {
if (req.url ~ "^/(pub/)?(media|static)/.*\.(ico|css|js|jpg|jpeg|png|gif|tiff|bmp|mp3|ogg|svg|swf|woff|woff2|eot|ttf|otf)$") {
unset req.http.Https;
unset req.http.Cookie;
}
......@@ -90,7 +90,7 @@ sub vcl_backend_response {
# images, css and js are cacheable by default so we have to remove cookie also
if (beresp.ttl > 0s && (bereq.method == "GET" || bereq.method == "HEAD")) {
unset beresp.http.set-cookie;
if (bereq.url !~ "\.(css|js|jpg|png|gif|tiff|bmp|gz|tgz|bz2|tbz|mp3|ogg|svg|swf|woff)(\?|$)") {
if (bereq.url !~ "\.(ico|css|js|jpg|jpeg|png|gif|tiff|bmp|gz|tgz|bz2|tbz|mp3|ogg|svg|swf|woff|woff2|eot|ttf|otf)(\?|$)") {
set beresp.http.Pragma = "no-cache";
set beresp.http.Expires = "-1";
set beresp.http.Cache-Control = "no-store, no-cache, must-revalidate, max-age=0";
......
......@@ -36,6 +36,7 @@ class HhvmCompatibilityTest extends \PHPUnit_Framework_TestCase
'mime_magic.magicfile',
'display_errors',
'default_socket_timeout',
'pcre.recursion_limit',
];
public function testAllowedIniGetSetDirectives()
......
This diff is collapsed.
......@@ -41,6 +41,18 @@ try {
echo ' |- ' . $label . ': ' . $config->getValue($configKey) . PHP_EOL;
}
/** @var $config \Magento\Indexer\Model\Config */
$config = $application->getObjectManager()->get('Magento\Indexer\Model\Config');
$indexerListIds = $config->getIndexers();
/** @var $indexerRegistry \Magento\Indexer\Model\IndexerRegistry */
$indexerRegistry = $application->getObjectManager()->create('Magento\Indexer\Model\IndexerRegistry');
$indexersState = [];
foreach ($indexerListIds as $key => $indexerId) {
$indexer = $indexerRegistry->get($indexerId['indexer_id']);
$indexersState[$indexerId['indexer_id']] = $indexer->isScheduled();
$indexer->setScheduled(true);
}
foreach ($application->getFixtures() as $fixture) {
echo $fixture->getActionTitle() . '... ';
$startTime = microtime(true);
......@@ -50,6 +62,12 @@ try {
echo ' done in ' . gmdate('H:i:s', $resultTime) . PHP_EOL;
}
foreach ($indexerListIds as $indexerId) {
/** @var $indexer \Magento\Indexer\Model\Indexer */
$indexer = $indexerRegistry->get($indexerId['indexer_id']);
$indexer->setScheduled($indexersState[$indexerId['indexer_id']]);
}
$application->reindex();
$totalEndTime = microtime(true);
$totalResultTime = $totalEndTime - $totalStartTime;
......
......@@ -11,6 +11,11 @@ use Magento\Framework\Code\Minifier\AdapterInterface;
class CssMinifier implements AdapterInterface
{
/**
* 'pcre.recursion_limit' value for CSSMin minification
*/
const PCRE_RECURSION_LIMIT = 1000;
/**
* @var CSSmin
*/
......@@ -32,6 +37,10 @@ class CssMinifier implements AdapterInterface
*/
public function minify($content)
{
return $this->cssMinifier->run($content);
$pcreRecursionLimit = ini_get('pcre.recursion_limit');
ini_set('pcre.recursion_limit', self::PCRE_RECURSION_LIMIT);
$result = $this->cssMinifier->run($content);
ini_set('pcre.recursion_limit', $pcreRecursionLimit);
return $result;
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment