mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Merge branch 'prep-release-3.3.1' into 3.3.x
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
|
||||
<!-- a few settings for the build -->
|
||||
<property name="newversion" value="3.3.2-dev" />
|
||||
<property name="prevversion" value="3.3.1-RC1" />
|
||||
<property name="prevversion" value="3.3.1" />
|
||||
<property name="olderversions" value="3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.7-pl1, 3.1.8, 3.1.9, 3.1.10, 3.1.11, 3.1.12, 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.2.8, 3.2.9, 3.2.10, 3.3.0" />
|
||||
<!-- no configuration should be needed beyond this point -->
|
||||
|
||||
|
@@ -1,16 +1,16 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* This file is part of the phpBB Forum Software package.
|
||||
*
|
||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||
*
|
||||
* For full copyright and license information, please see
|
||||
* the docs/CREDITS.txt file.
|
||||
*
|
||||
*/
|
||||
*
|
||||
* This file is part of the phpBB Forum Software package.
|
||||
*
|
||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||
*
|
||||
* For full copyright and license information, please see
|
||||
* the docs/CREDITS.txt file.
|
||||
*
|
||||
*/
|
||||
|
||||
if ($_SERVER['argc'] != 2)
|
||||
{
|
||||
|
54
build/update_stylesheet_querystrings.php
Normal file
54
build/update_stylesheet_querystrings.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
*
|
||||
* This file is part of the phpBB Forum Software package.
|
||||
*
|
||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||
*
|
||||
* For full copyright and license information, please see
|
||||
* the docs/CREDITS.txt file.
|
||||
*
|
||||
*/
|
||||
|
||||
if (php_sapi_name() !== 'cli')
|
||||
{
|
||||
die("This program must be run from the command line.\n");
|
||||
}
|
||||
|
||||
if (version_compare(PHP_VERSION, '7.1.3', '<'))
|
||||
{
|
||||
die('update_stylesheet_querystrings.php requires at least PHP 7.1.3');
|
||||
}
|
||||
|
||||
// Usage: "$ php build/update_stylesheet_querystrings.php"
|
||||
$targets = [dirname(dirname(__FILE__)) . '/phpBB/styles/prosilver/theme/stylesheet.css'];
|
||||
|
||||
array_map('patch_glob', $targets);
|
||||
|
||||
function patch_glob($glob): void
|
||||
{
|
||||
array_map('patch_file', glob($glob));
|
||||
}
|
||||
|
||||
function patch_file(string $filepath): void
|
||||
{
|
||||
$file = file_get_contents($filepath);
|
||||
$old = $file;
|
||||
$new = preg_replace_callback(
|
||||
'(^@import\\s+url\\([\'"](?<basename>\\w++\\.css)\\?\\K(?:hash|v)=[^\'"]++)m',
|
||||
function ($match) use ($filepath)
|
||||
{
|
||||
$path = dirname($filepath) . DIRECTORY_SEPARATOR . $match['basename'];
|
||||
$hash = sprintf('%08x', crc32(file_get_contents($path)));
|
||||
|
||||
return 'hash=' . $hash;
|
||||
},
|
||||
$old
|
||||
);
|
||||
|
||||
if ($new !== $old)
|
||||
{
|
||||
file_put_contents($filepath, $new);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user