diff --git a/system/src/Grav/Common/Plugin.php b/system/src/Grav/Common/Plugin.php index b2084205f..96084b0ed 100644 --- a/system/src/Grav/Common/Plugin.php +++ b/system/src/Grav/Common/Plugin.php @@ -188,19 +188,18 @@ class Plugin implements EventSubscriberInterface * Persists to disk the plugin parameters currently stored in the Grav Config object * * @param string $plugin_name The name of the plugin whose config it should store. - * If omitted, saves the current plugin * * @return true */ - protected function saveConfig($plugin_name = '') { + public static function saveConfig($plugin_name) { if (!$plugin_name) { - $plugin_name = $this->name; + return false; } - $locator = $this->grav['locator']; + $locator = Grav::instance()['locator']; $filename = 'config://plugins/' . $plugin_name . '.yaml'; $file = YamlFile::instance($locator->findResource($filename, true, true)); - $content = $this->grav['config']->get('plugins.' . $plugin_name); + $content = Grav::instance()['config']->get('plugins.' . $plugin_name); $file->save($content); $file->free();