From 98b1f87281fe722f938c63e6ce9c5118d03bec30 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Mon, 29 Feb 2016 20:20:02 +0100 Subject: [PATCH 1/3] CONTRIBUTING.md: Update markdown parsers --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aa787bd..7a44267 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -49,7 +49,7 @@ With this command you can specify a file or folder to limit which files it will Pico accepts the problems of having redundant documentation on different places (concretely Pico's inline user docs, the `README.md` and the website) for the sake of a better user experience. When updating the docs, please make sure to keep them in sync. -If you update the [`README.md`](https://github.com/picocms/Pico/blob/master/README.md) or [`content-sample/index.md`](https://github.com/picocms/Pico/blob/master/content-sample/index.md), please make sure to update the corresponding files in the [`_docs`](https://github.com/picocms/Pico/tree/gh-pages/_docs/) folder of the `gh-pages` branch (i.e. [Pico's website](http://picocms.org/docs/)) and vice versa. Unfortunately this involves three (!) different markdown parsers. If you're experiencing problems, use Pico's [`erusev/parsedown-extra`](https://github.com/erusev/parsedown-extra) as a reference. You can try to make the contents compatible to [Redcarpet](https://github.com/vmg/redcarpet) by yourself, otherwise please address the issues in your pull request message and we'll take care of it. +If you update the [`README.md`](https://github.com/picocms/Pico/blob/master/README.md) or [`content-sample/index.md`](https://github.com/picocms/Pico/blob/master/content-sample/index.md), please make sure to update the corresponding files in the [`_docs`](https://github.com/picocms/Pico/tree/gh-pages/_docs/) folder of the `gh-pages` branch (i.e. [Pico's website](http://picocms.org/docs/)) and vice versa. Unfortunately this involves three (!) different markdown parsers. If you're experiencing problems, use Pico's [`erusev/parsedown-extra`](https://github.com/erusev/parsedown-extra) as a reference. You can try to make the contents compatible to [Kramdown](http://kramdown.gettalong.org/) (Pico's website) and [Redcarpet](https://github.com/vmg/redcarpet) (`README.md`) by yourself, otherwise please address the issues in your pull request message and we'll take care of it. Versioning ---------- From c0a7fdc8019240f6328bb5e3e9223e762841d7af Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Mon, 29 Feb 2016 20:41:41 +0100 Subject: [PATCH 2/3] Don't always check dependants of a disabled plugin This isn't necessary because dependant plugins will check their dependencies on their own. Follow-up to f10440b --- lib/AbstractPicoPlugin.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/AbstractPicoPlugin.php b/lib/AbstractPicoPlugin.php index fcfd059..4ec5dab 100644 --- a/lib/AbstractPicoPlugin.php +++ b/lib/AbstractPicoPlugin.php @@ -77,9 +77,9 @@ abstract class AbstractPicoPlugin implements PicoPluginInterface $pluginConfig = $this->getConfig(get_called_class()); if (is_array($pluginConfig) && isset($pluginConfig['enabled'])) { $this->setEnabled($pluginConfig['enabled']); - } else { - // make sure dependencies are checked - $this->setEnabled($this->enabled, true, true); + } elseif ($this->enabled) { + // make sure dependencies are fulfilled + $this->checkDependencies(true); } } } From a2aa46fd0ec5ee67d12be5fbf7d15742b303b75e Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Mon, 29 Feb 2016 20:58:42 +0100 Subject: [PATCH 3/3] Don't let dependant plugins automatically enable plugins which should be disabled by default Follow-up to f10440b and c0a7fdc --- lib/AbstractPicoPlugin.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/AbstractPicoPlugin.php b/lib/AbstractPicoPlugin.php index 4ec5dab..4ee337e 100644 --- a/lib/AbstractPicoPlugin.php +++ b/lib/AbstractPicoPlugin.php @@ -78,8 +78,13 @@ abstract class AbstractPicoPlugin implements PicoPluginInterface if (is_array($pluginConfig) && isset($pluginConfig['enabled'])) { $this->setEnabled($pluginConfig['enabled']); } elseif ($this->enabled) { - // make sure dependencies are fulfilled - $this->checkDependencies(true); + // make sure dependencies are already fulfilled, + // otherwise the plugin needs to be enabled manually + try { + $this->checkDependencies(false); + } catch (RuntimeException $e) { + $this->enabled = false; + } } } }