Skip to content

Commit ed90dea

Browse files
committed
✨ Support for renamed assets, configurable digests (SRI)
thanks for the PR @S1SYPHOS Signed-off-by: bnomei <[email protected]>
1 parent b747701 commit ed90dea

File tree

4 files changed

+32
-20
lines changed

4 files changed

+32
-20
lines changed

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "bnomei/kirby3-fingerprint",
33
"type": "kirby-plugin",
4-
"version": "3.1.2",
5-
"description": "File Method and css/js helper to add cachebusting hash and optional Subresource Integrity to file",
4+
"version": "3.2.0",
5+
"description": "File Method and css/js helper to add cache-busting hash and optional Subresource Integrity to file",
66
"license": "MIT",
77
"authors": [
88
{
@@ -67,7 +67,6 @@
6767
"kirby-cms-path": "tests/kirby"
6868
},
6969
"suggest": {
70-
"bnomei/kirby3-autoid": "Get modification timestamp for kirby files (not css/js) at almost zero-cpu-cost",
7170
"bnomei/kirby3-security-headers": "Let's make the web a saver place – sensible defaults included.",
7271
"diverently/laravel-mix-kirby": "Consider using this plugin instead if all your assets are versioned by laravel mix."
7372
}

vendor/autoload.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,21 @@
33
// autoload.php @generated by Composer
44

55
if (PHP_VERSION_ID < 50600) {
6-
echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
7-
exit(1);
6+
if (!headers_sent()) {
7+
header('HTTP/1.1 500 Internal Server Error');
8+
}
9+
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
10+
if (!ini_get('display_errors')) {
11+
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
12+
fwrite(STDERR, $err);
13+
} elseif (!headers_sent()) {
14+
echo $err;
15+
}
16+
}
17+
trigger_error(
18+
$err,
19+
E_USER_ERROR
20+
);
821
}
922

1023
require_once __DIR__ . '/composer/autoload_real.php';

vendor/composer/InstalledVersions.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class InstalledVersions
2828
{
2929
/**
3030
* @var mixed[]|null
31-
* @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
31+
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
3232
*/
3333
private static $installed;
3434

@@ -39,7 +39,7 @@ class InstalledVersions
3939

4040
/**
4141
* @var array[]
42-
* @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
42+
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
4343
*/
4444
private static $installedByVendor = array();
4545

@@ -243,7 +243,7 @@ public static function getInstallPath($packageName)
243243

244244
/**
245245
* @return array
246-
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
246+
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
247247
*/
248248
public static function getRootPackage()
249249
{
@@ -257,7 +257,7 @@ public static function getRootPackage()
257257
*
258258
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
259259
* @return array[]
260-
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
260+
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
261261
*/
262262
public static function getRawData()
263263
{
@@ -280,7 +280,7 @@ public static function getRawData()
280280
* Returns the raw data of all installed.php which are currently loaded for custom implementations
281281
*
282282
* @return array[]
283-
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
283+
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
284284
*/
285285
public static function getAllRawData()
286286
{
@@ -303,7 +303,7 @@ public static function getAllRawData()
303303
* @param array[] $data A vendor/composer/installed.php data set
304304
* @return void
305305
*
306-
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
306+
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
307307
*/
308308
public static function reload($data)
309309
{
@@ -313,7 +313,7 @@ public static function reload($data)
313313

314314
/**
315315
* @return array[]
316-
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
316+
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
317317
*/
318318
private static function getInstalled()
319319
{

vendor/composer/installed.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
<?php return array(
22
'root' => array(
3-
'pretty_version' => '3.1.2',
4-
'version' => '3.1.2.0',
3+
'name' => 'bnomei/kirby3-fingerprint',
4+
'pretty_version' => '3.2.0',
5+
'version' => '3.2.0.0',
6+
'reference' => NULL,
57
'type' => 'kirby-plugin',
68
'install_path' => __DIR__ . '/../../',
79
'aliases' => array(),
8-
'reference' => NULL,
9-
'name' => 'bnomei/kirby3-fingerprint',
1010
'dev' => false,
1111
),
1212
'versions' => array(
1313
'bnomei/kirby3-fingerprint' => array(
14-
'pretty_version' => '3.1.2',
15-
'version' => '3.1.2.0',
14+
'pretty_version' => '3.2.0',
15+
'version' => '3.2.0.0',
16+
'reference' => NULL,
1617
'type' => 'kirby-plugin',
1718
'install_path' => __DIR__ . '/../../',
1819
'aliases' => array(),
19-
'reference' => NULL,
2020
'dev_requirement' => false,
2121
),
2222
'getkirby/composer-installer' => array(
2323
'pretty_version' => '1.2.1',
2424
'version' => '1.2.1.0',
25+
'reference' => 'c98ece30bfba45be7ce457e1102d1b169d922f3d',
2526
'type' => 'composer-plugin',
2627
'install_path' => __DIR__ . '/../getkirby/composer-installer',
2728
'aliases' => array(),
28-
'reference' => 'c98ece30bfba45be7ce457e1102d1b169d922f3d',
2929
'dev_requirement' => false,
3030
),
3131
),

0 commit comments

Comments
 (0)