Loading core/tests/Drupal/Tests/PerformanceTestTrait.php +22 −12 Original line number Diff line number Diff line Loading @@ -398,6 +398,10 @@ private function collectNetworkData(array $messages, PerformanceData $performanc // not. foreach ($stylesheet_urls as $url) { $stylesheet_count++; if (!str_starts_with($url, $GLOBALS['base_url'])) { $stylesheet_bytes += strlen(file_get_contents($url)); } else { if ($GLOBALS['base_path'] === '/') { $filename = ltrim(parse_url($url, PHP_URL_PATH), '/'); $stylesheet_bytes += strlen(file_get_contents($filename)); Loading @@ -409,8 +413,13 @@ private function collectNetworkData(array $messages, PerformanceData $performanc $stylesheet_bytes += strlen(str_replace($GLOBALS['base_path'], '/', file_get_contents($filename))); } } } foreach ($script_urls as $url) { $script_count++; if (!str_starts_with($url, $GLOBALS['base_url'])) { $script_bytes += strlen(file_get_contents($url)); } else { if ($GLOBALS['base_path'] === '/') { $filename = ltrim(parse_url($url, PHP_URL_PATH), '/'); } Loading @@ -419,6 +428,7 @@ private function collectNetworkData(array $messages, PerformanceData $performanc } $script_bytes += strlen(file_get_contents($filename)); } } $performance_data->setStylesheetCount($stylesheet_count); $performance_data->setStylesheetBytes($stylesheet_bytes); Loading Loading
core/tests/Drupal/Tests/PerformanceTestTrait.php +22 −12 Original line number Diff line number Diff line Loading @@ -398,6 +398,10 @@ private function collectNetworkData(array $messages, PerformanceData $performanc // not. foreach ($stylesheet_urls as $url) { $stylesheet_count++; if (!str_starts_with($url, $GLOBALS['base_url'])) { $stylesheet_bytes += strlen(file_get_contents($url)); } else { if ($GLOBALS['base_path'] === '/') { $filename = ltrim(parse_url($url, PHP_URL_PATH), '/'); $stylesheet_bytes += strlen(file_get_contents($filename)); Loading @@ -409,8 +413,13 @@ private function collectNetworkData(array $messages, PerformanceData $performanc $stylesheet_bytes += strlen(str_replace($GLOBALS['base_path'], '/', file_get_contents($filename))); } } } foreach ($script_urls as $url) { $script_count++; if (!str_starts_with($url, $GLOBALS['base_url'])) { $script_bytes += strlen(file_get_contents($url)); } else { if ($GLOBALS['base_path'] === '/') { $filename = ltrim(parse_url($url, PHP_URL_PATH), '/'); } Loading @@ -419,6 +428,7 @@ private function collectNetworkData(array $messages, PerformanceData $performanc } $script_bytes += strlen(file_get_contents($filename)); } } $performance_data->setStylesheetCount($stylesheet_count); $performance_data->setStylesheetBytes($stylesheet_bytes); Loading