Log wrong requests
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
bebeb8a817
commit
1f87dd9f5e
17
Plugin.php
17
Plugin.php
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace Aweos\Resizer;
|
namespace Aweos\Resizer;
|
||||||
|
|
||||||
|
use Log;
|
||||||
use Aweos\Resizer\Classes\CacheManager;
|
use Aweos\Resizer\Classes\CacheManager;
|
||||||
use Aweos\Resizer\Classes\FileObserver;
|
use Aweos\Resizer\Classes\FileObserver;
|
||||||
use Aweos\Resizer\Classes\ImageResizer;
|
use Aweos\Resizer\Classes\ImageResizer;
|
||||||
|
@ -84,7 +85,8 @@ class Plugin extends PluginBase
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function registerSettings() {
|
public function registerSettings()
|
||||||
|
{
|
||||||
return [
|
return [
|
||||||
'resizer' => [
|
'resizer' => [
|
||||||
'label' => 'Resizer Settings',
|
'label' => 'Resizer Settings',
|
||||||
|
@ -99,17 +101,22 @@ class Plugin extends PluginBase
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function registerMarkupTags() {
|
public function registerMarkupTags()
|
||||||
|
{
|
||||||
return [
|
return [
|
||||||
'filters' => [
|
'filters' => [
|
||||||
'resize' => fn ($media, $size = 'original', $sizes = null, $options = []) => app(CacheManager::class)->get(
|
'resize' => function ($media, $size = 'original', $sizes = null, $options = []) {
|
||||||
|
if (is_null($media)) {
|
||||||
|
Log::warning('Media not found in path ' . url()->current());
|
||||||
|
}
|
||||||
|
return app(CacheManager::class)->get(
|
||||||
new MediaPath($media),
|
new MediaPath($media),
|
||||||
$size,
|
$size,
|
||||||
$sizes,
|
$sizes,
|
||||||
$options,
|
$options,
|
||||||
)
|
);
|
||||||
|
}
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue