Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
philipp lang | 1f87dd9f5e | |
philipp lang | bebeb8a817 | |
philipp lang | ea7b2e57ec |
17
Plugin.php
17
Plugin.php
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Aweos\Resizer;
|
||||
|
||||
use Log;
|
||||
use Aweos\Resizer\Classes\CacheManager;
|
||||
use Aweos\Resizer\Classes\FileObserver;
|
||||
use Aweos\Resizer\Classes\ImageResizer;
|
||||
|
@ -84,7 +85,8 @@ class Plugin extends PluginBase
|
|||
});
|
||||
}
|
||||
|
||||
public function registerSettings() {
|
||||
public function registerSettings()
|
||||
{
|
||||
return [
|
||||
'resizer' => [
|
||||
'label' => 'Resizer Settings',
|
||||
|
@ -99,17 +101,22 @@ class Plugin extends PluginBase
|
|||
];
|
||||
}
|
||||
|
||||
public function registerMarkupTags() {
|
||||
public function registerMarkupTags()
|
||||
{
|
||||
return [
|
||||
'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),
|
||||
$size,
|
||||
$sizes,
|
||||
$options,
|
||||
)
|
||||
);
|
||||
}
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "aweos/oc-resizer-plugin",
|
||||
"type": "october-plugin",
|
||||
"require": {
|
||||
"guzzlehttp/guzzle": "^6.3",
|
||||
"guzzlehttp/guzzle": "^7.5",
|
||||
"intervention/image": "^2.6"
|
||||
},
|
||||
"require-dev": {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
bootstrap="../../../modules/system/tests/bootstrap.php"
|
||||
bootstrap="../../../tests/bootstrap.php"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
|
|
|
@ -19,6 +19,10 @@ class TestCase extends PluginTestCase
|
|||
|
||||
Setting::set('queue', 'default');
|
||||
$this->media = MediaLibrary::instance();
|
||||
|
||||
$pluginManager = PluginManager::instance();
|
||||
$pluginManager->registerAll(true);
|
||||
$pluginManager->bootAll(true);
|
||||
}
|
||||
|
||||
public function assertHasFile($file): void
|
||||
|
|
Loading…
Reference in New Issue