Skip to content

Commit e0c9004

Browse files
committed
v1.5.0
- Exclude content representation #3 - Updated dependencies
1 parent 65d9f18 commit e0c9004

File tree

8 files changed

+438
-319
lines changed

8 files changed

+438
-319
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"kirby3-plugin",
99
"kirby-plugin"
1010
],
11-
"version": "1.4.0",
11+
"version": "1.5.0",
1212
"type": "kirby-plugin",
1313
"license": "MIT",
1414
"authors": [

index.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ public function render(array $data = []): string
1313
{
1414
$html = Tpl::load($this->file(), $data);
1515

16-
if (option('afbora.kirby-minify-html.enabled') === true) {
16+
if (
17+
option('afbora.kirby-minify-html.enabled') === true &&
18+
$this->hasDefaultType() === true
19+
) {
1720
$htmlMin = new HtmlMin();
18-
1921
$options = option('afbora.kirby-minify-html.options', []);
2022

2123
foreach ($options as $option => $param) {

vendor/composer/ClassLoader.php

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
*/
4343
class ClassLoader
4444
{
45+
private $vendorDir;
46+
4547
// PSR-4
4648
private $prefixLengthsPsr4 = array();
4749
private $prefixDirsPsr4 = array();
@@ -57,6 +59,13 @@ class ClassLoader
5759
private $missingClasses = array();
5860
private $apcuPrefix;
5961

62+
private static $registeredLoaders = array();
63+
64+
public function __construct($vendorDir = null)
65+
{
66+
$this->vendorDir = $vendorDir;
67+
}
68+
6069
public function getPrefixes()
6170
{
6271
if (!empty($this->prefixesPsr0)) {
@@ -300,6 +309,17 @@ public function getApcuPrefix()
300309
public function register($prepend = false)
301310
{
302311
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
312+
313+
if (null === $this->vendorDir) {
314+
return;
315+
}
316+
317+
if ($prepend) {
318+
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
319+
} else {
320+
unset(self::$registeredLoaders[$this->vendorDir]);
321+
self::$registeredLoaders[$this->vendorDir] = $this;
322+
}
303323
}
304324

305325
/**
@@ -308,13 +328,17 @@ public function register($prepend = false)
308328
public function unregister()
309329
{
310330
spl_autoload_unregister(array($this, 'loadClass'));
331+
332+
if (null !== $this->vendorDir) {
333+
unset(self::$registeredLoaders[$this->vendorDir]);
334+
}
311335
}
312336

313337
/**
314338
* Loads the given class or interface.
315339
*
316340
* @param string $class The name of the class
317-
* @return bool|null True if loaded, null otherwise
341+
* @return true|null True if loaded, null otherwise
318342
*/
319343
public function loadClass($class)
320344
{
@@ -323,6 +347,8 @@ public function loadClass($class)
323347

324348
return true;
325349
}
350+
351+
return null;
326352
}
327353

328354
/**
@@ -367,6 +393,16 @@ public function findFile($class)
367393
return $file;
368394
}
369395

396+
/**
397+
* Returns the currently registered loaders indexed by their corresponding vendor directories.
398+
*
399+
* @return self[]
400+
*/
401+
public static function getRegisteredLoaders()
402+
{
403+
return self::$registeredLoaders;
404+
}
405+
370406
private function findFileWithExtension($class, $ext)
371407
{
372408
// PSR-4 lookup

0 commit comments

Comments
 (0)