File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed
Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 33namespace ABWebDevelopers \Portfolio \Updates ;
44
55use ABWebDevelopers \ImageResize \Classes \Resizer ;
6- use Schema ;
7- use October \Rain \Database \Updates \Migration ;
86use ABWebDevelopers \ImageResize \Models \Settings ;
7+ use Illuminate \Support \Facades \DB ;
98use Illuminate \Support \Facades \File ;
10- use Illuminate \ Support \ Facades \ Storage ;
9+ use October \ Rain \ Database \ Updates \ Migration ;
1110
1211class ClearOldCacheDir extends Migration
1312{
1413 public function up ()
1514 {
16- $ oldpath = base_path ('storage/app/media/imageresizecache ' );
15+ // Check that the settings for this plugin exist
16+ if (DB ::table ('system_settings ' )->where ('item ' , 'abwebdevelopers_imageresize ' )->exists ()) {
17+ $ oldpath = base_path ('storage/app/media/imageresizecache ' );
1718
18- if (Settings::instance ()->cache_directory !== $ oldpath ) {
19- if (is_dir ($ oldpath )) {
20- Resizer::clearFiles (null , $ oldpath );
19+ if (Settings::instance ()->cache_directory !== $ oldpath ) {
20+ if (is_dir ($ oldpath )) {
21+ Resizer::clearFiles (null , $ oldpath );
2122
22- File::deleteDirectory ($ oldpath );
23- @unlink ($ oldpath );
23+ File::deleteDirectory ($ oldpath );
24+ @unlink ($ oldpath );
25+ }
2426 }
2527 }
2628 }
Original file line number Diff line number Diff line change 34342.1.4 :
3535 - Add new Dashboard Widget as an alternative method of clearing the image resize cache
36362.1.5 :
37- - Add new setting that runs `imageresize:clear` when `cache:clear` is run (if configured), and fix a Settings bug that was introduced from v2.1.0
37+ - Add new setting that runs `imageresize:clear` when `cache:clear` is run (if configured), and fix a Settings bug that was introduced from v2.1.0
38+ 2.1.6 :
39+ - Fix migration (2.1.2 migration) that causes installations to fail (due to plugin settings not existing for new projects at time of execution)
You can’t perform that action at this time.
0 commit comments