mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/16543] Add script for automate it on builds
PHPBB3-16543
This commit is contained in:
parent
87dfa9a061
commit
80a6a58a84
1 changed files with 2 additions and 2 deletions
|
@ -37,9 +37,9 @@ function patch_file(string $filepath): void
|
||||||
$old = $file;
|
$old = $file;
|
||||||
$new = preg_replace_callback(
|
$new = preg_replace_callback(
|
||||||
'(^@import\\s+url\\([\'"](?<basename>\\w++\\.css)\\?\\K(?:hash|v)=[^\'"]++)m',
|
'(^@import\\s+url\\([\'"](?<basename>\\w++\\.css)\\?\\K(?:hash|v)=[^\'"]++)m',
|
||||||
function ($m) use ($filepath)
|
function ($match) use ($filepath)
|
||||||
{
|
{
|
||||||
$path = dirname($filepath) . DIRECTORY_SEPARATOR . $m['basename'];
|
$path = dirname($filepath) . DIRECTORY_SEPARATOR . $match['basename'];
|
||||||
$hash = sprintf('%08x', crc32(file_get_contents($path)));
|
$hash = sprintf('%08x', crc32(file_get_contents($path)));
|
||||||
|
|
||||||
return 'hash=' . $hash;
|
return 'hash=' . $hash;
|
||||||
|
|
Loading…
Add table
Reference in a new issue