From 040a799170e0d06dcc0eea2936801aec306a40e1 Mon Sep 17 00:00:00 2001 From: Bart Vandeputte <bart.vdputte@gmail.com> Date: Tue, 12 Mar 2019 10:38:45 +0100 Subject: [PATCH] Undo fingerprint for content files - use K3 included hashes instead! --- index.php | 14 -------------- readme.md | 11 ----------- 2 files changed, 25 deletions(-) diff --git a/index.php b/index.php index 9c48950..ece55ca 100644 --- a/index.php +++ b/index.php @@ -2,14 +2,6 @@ require __DIR__ . DS . "src" . DS . "Fingerprint.php"; -Kirby::plugin('bvdputte/fingerprint', [ - 'fileMethods' => [ - 'fingerprint' => function () { - return bvdputte\Fingerprint::addHash($this->root()); - } - ] -]); - /* A little Kirby helper functions */ @@ -24,10 +16,4 @@ function jsfingerprint($url, $options = null) { return bvdputte\Fingerprint::js($url, $options = null); } -} -if (! function_exists("fingerprint")) { - function fingerprint($path) - { - return bvdputte\Fingerprint::addHash($path); - } } \ No newline at end of file diff --git a/readme.md b/readme.md index 2c27e82..8902bf8 100644 --- a/readme.md +++ b/readme.md @@ -29,17 +29,6 @@ jsfingerprint("assets/scripts.js"); // Output: <script src="//localhost:3000/assets/js/scripts.1e9dd0c95e7b12ce96729501c7585deb.js"></script> ``` -You can also use this on a `path` or `$file` objects: - -```php -echo fingerprint($page->some_imagefield()->toFile()->root()); -// Output: /var/www/mysite/content/home/testimage.0d859e73e897635c53e59407be9b32aa.jpg -echo $page->some_imagefield()->toFile()->fingerprint(); -// Output: /var/www/mysite/content/home/testimage.0d859e73e897635c53e59407be9b32aa.jpg -``` - -💡 Always test if the file exists first! - ## Advanced features For more advanced features, such as subresource integrity, please checkout [bnomei's kirby3-fingerprint plugin](https://github.com/bnomei/kirby3-fingerprint).