PicoDeprecated: Making $config globally accessible again
This was dropped without a replacement with Pico 0.9. I checked all changes since Pico 0.8 manually, as far as I can tell there should be no more surprises regarding BC... Thanks @Lomanic for rubbing our nose in the fact that we should check this! I also added the missing changes of Pico 0.9 to changelog.txt
This commit is contained in:
parent
9a702415fb
commit
8da62f4aad
@ -16,7 +16,7 @@
|
|||||||
and `AbstractPicoPlugin`); if you're plugin dev, you really should
|
and `AbstractPicoPlugin`); if you're plugin dev, you really should
|
||||||
take a look at the UPGRADE section of the docs!
|
take a look at the UPGRADE section of the docs!
|
||||||
* [New] Introducing the `PicoDeprecated` plugin to maintain full backward
|
* [New] Introducing the `PicoDeprecated` plugin to maintain full backward
|
||||||
compatibility with Pico 0.9 and older
|
compatibility with Pico 0.9 and Pico 0.8
|
||||||
* [New] Support YAML-style meta header comments (`---`)
|
* [New] Support YAML-style meta header comments (`---`)
|
||||||
* [New] Various new placeholders to use in content files (e.g. `%site_title%`)
|
* [New] Various new placeholders to use in content files (e.g. `%site_title%`)
|
||||||
* [New] Provide access to all meta headers in content files (`%meta.*%`)
|
* [New] Provide access to all meta headers in content files (`%meta.*%`)
|
||||||
@ -68,11 +68,15 @@
|
|||||||
2015.04.28 - version 0.9
|
2015.04.28 - version 0.9
|
||||||
* [New] Default theme is now mobile-friendly
|
* [New] Default theme is now mobile-friendly
|
||||||
* [New] Description meta now available in content areas
|
* [New] Description meta now available in content areas
|
||||||
|
* [New] Add description to composer.json
|
||||||
* [Changed] content folder is now content-sample
|
* [Changed] content folder is now content-sample
|
||||||
|
* [Changed] config.php moved to config.php.template
|
||||||
* [Changed] Updated documentation & wiki
|
* [Changed] Updated documentation & wiki
|
||||||
* [Changed] Removed Composer, Twig files in /vendor, you must run composer install now
|
* [Changed] Removed Composer, Twig files in /vendor, you must run composer install now
|
||||||
* [Changed] Localized date format; strftime() instead of date()
|
* [Changed] Localized date format; strftime() instead of date()
|
||||||
* [Changed] Added ignore for tmp file extensions in the get_files() method
|
* [Changed] Added ignore for tmp file extensions in the get_files() method
|
||||||
|
* [Changed] michelf/php-markdown is replaced with erusev/parsedown-extra
|
||||||
|
* [Changed] $config is no global variable anymore
|
||||||
* [Fixed] Pico now only removes the 1st comment block in .md files
|
* [Fixed] Pico now only removes the 1st comment block in .md files
|
||||||
* [Fixed] Issue wherein the alphabetical sorting of pages did not happen
|
* [Fixed] Issue wherein the alphabetical sorting of pages did not happen
|
||||||
|
|
||||||
|
@ -88,27 +88,38 @@ class PicoDeprecated extends AbstractPicoPlugin
|
|||||||
/**
|
/**
|
||||||
* Triggers the deprecated event config_loaded($config)
|
* Triggers the deprecated event config_loaded($config)
|
||||||
*
|
*
|
||||||
|
* This method also defines deprecated constants, reads the `config.php`
|
||||||
|
* in Picos root dir, enables the plugins {@link PicoParsePagesContent}
|
||||||
|
* and {@link PicoExcerpt} and makes `$config` globally accessible (the
|
||||||
|
* latter was removed with Pico 0.9 and was added again as deprecated
|
||||||
|
* feature with Pico 1.0)
|
||||||
|
*
|
||||||
* @see PicoDeprecated::defineConstants()
|
* @see PicoDeprecated::defineConstants()
|
||||||
* @see PicoDeprecated::loadRootDirConfig()
|
* @see PicoDeprecated::loadRootDirConfig()
|
||||||
* @see PicoDeprecated::enablePlugins()
|
* @see PicoDeprecated::enablePlugins()
|
||||||
* @see DummyPlugin::onConfigLoaded()
|
* @see DummyPlugin::onConfigLoaded()
|
||||||
|
* @param mixed[] &$realConfig array of config variables
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function onConfigLoaded(&$config)
|
public function onConfigLoaded(&$realConfig)
|
||||||
{
|
{
|
||||||
$this->defineConstants();
|
global $config;
|
||||||
$this->loadRootDirConfig($config);
|
|
||||||
$this->enablePlugins();
|
|
||||||
|
|
||||||
$this->triggerEvent('config_loaded', array(&$config));
|
$this->defineConstants();
|
||||||
|
$this->loadRootDirConfig($realConfig);
|
||||||
|
$this->enablePlugins();
|
||||||
|
$config = &$realConfig;
|
||||||
|
|
||||||
|
$this->triggerEvent('config_loaded', array(&$realConfig));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines deprecated constants
|
* Defines deprecated constants
|
||||||
*
|
*
|
||||||
* `CONTENT_DIR` is deprecated since v0.9, `ROOT_DIR`, `LIB_DIR`,
|
* `ROOT_DIR`, `LIB_DIR`, `PLUGINS_DIR`, `THEMES_DIR` and `CONTENT_EXT`
|
||||||
* `PLUGINS_DIR`, `THEMES_DIR` and `CONTENT_EXT` since v1.0, `CONFIG_DIR`
|
* are deprecated since v1.0, `CONTENT_DIR` existed just in v0.9,
|
||||||
* existed just for a short time between v0.9 and v1.0 and `CACHE_DIR`
|
* `CONFIG_DIR` just for a short time between v0.9 and v1.0 and
|
||||||
* was dropped with v1.0 without a replacement.
|
* `CACHE_DIR` was dropped with v1.0 without a replacement.
|
||||||
*
|
*
|
||||||
* @see PicoDeprecated::onConfigLoaded()
|
* @see PicoDeprecated::onConfigLoaded()
|
||||||
* @return void
|
* @return void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user