mirror of
https://github.com/phpbb/phpbb.git
synced 2025-01-16 13:48:58 +01:00
[ticket/16543] Add script for automate it on builds
PHPBB3-16543
This commit is contained in:
parent
87dfa9a061
commit
80a6a58a84
@ -37,9 +37,9 @@ function patch_file(string $filepath): void
|
||||
$old = $file;
|
||||
$new = preg_replace_callback(
|
||||
'(^@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)));
|
||||
|
||||
return 'hash=' . $hash;
|
||||
|
Loading…
x
Reference in New Issue
Block a user