@@ -351,17 +351,17 @@ private function editDatabaseWithSchema($slug, $type, $update = false)
351351 $ pluginSchema = $ this ->Schema ->load ($ options );
352352 $ compare = $ this ->Schema ->compare ($ currentSchema , $ pluginSchema );
353353 unlink ($ options ['path ' ] . DS . $ options ['file ' ]);
354-
354+ $ pluginTables = [];
355355 if ($ type === 'CREATE ' ) {
356356 // Check edits
357357 $ contents = [];
358358 foreach ($ compare as $ table => $ changes ) {
359- if (isset ($ compare [ $ table ] ['create ' ])) continue ; // not handle create here
359+ if (isset ($ changes ['create ' ])) continue ; // not handle create here
360360
361- if (!isset ($ compare [ $ table ] ['add ' ])) continue ; // no add
361+ if (!isset ($ changes ['add ' ])) continue ; // no add
362362
363363 if (explode ('__ ' , $ table )[0 ] != strtolower ($ slug )) { // other plugin
364- foreach ($ compare [ $ table ] ['add ' ] as $ column => $ structure ) {
364+ foreach ($ changes ['add ' ] as $ column => $ structure ) {
365365 if (explode ('- ' , $ column )[0 ] != strtolower ($ slug )) // other plugin
366366 unset($ compare [$ table ]['add ' ][$ column ]);
367367 }
@@ -380,9 +380,9 @@ private function editDatabaseWithSchema($slug, $type, $update = false)
380380 $ contents [$ table ] = $ db ->alterSchema ([$ table => $ compare [$ table ]], $ table );
381381 }
382382 // add tables
383- $ pluginTables = [];
383+
384384 foreach ($ compare as $ table => $ changes ) {
385- if (isset ($ compare [ $ table ] ['create ' ])) { // is create
385+ if (isset ($ changes ['create ' ])) { // is create
386386 $ contents [$ table ] = $ db ->createSchema ($ pluginSchema , $ table );
387387 $ pluginTables [] = $ table ; // save for delete
388388 }
@@ -537,7 +537,7 @@ private function refreshPermissions()
537537 $ defaultPermissions = $ this ->controller ->Permissions ->permissions ;
538538 $ pluginsPermissions = [];
539539
540- foreach ($ this ->loadPlugins () as $ id => $ data ) {
540+ foreach ($ this ->loadPlugins () as $ data ) {
541541 if (!isset ($ data ->permissions ->available )) continue ; // no permissions on this plugin
542542 foreach ($ data ->permissions ->available as $ key => $ permission ) {
543543 $ pluginsPermissions [] = $ permission ; // add permission to plugins permissions
@@ -596,7 +596,7 @@ public function loadPlugins()
596596 $ pluginList ->$ id ->slugLower = strtolower ($ plugin ['name ' ]);
597597 $ pluginList ->$ id ->DBid = $ plugin ['id ' ];
598598 $ pluginList ->$ id ->DBinstall = $ plugin ['created ' ];
599- $ pluginList ->$ id ->active = ( $ plugin ['state ' ]) ? true : false ;
599+ $ pluginList ->$ id ->active = $ plugin ['state ' ];
600600 if ($ pluginList ->$ id ->active )
601601 $ count ++;
602602 $ pluginList ->$ id ->isValid = $ this ->isValid ($ pluginList ->$ id ->slug ); // plugin valid
0 commit comments