Re-add deprecated Pico::getBaseThemeUrl() and AbstractPicoPlugin::__call()

This reverts commits efc4fb5288 and bc816febfc
This commit is contained in:
Daniel Rudolf 2022-02-06 23:15:39 +01:00
parent 41fc15a7e8
commit fe6c8f805a
No known key found for this signature in database
GPG key ID: A061F02CD8DE4538
2 changed files with 38 additions and 0 deletions

View file

@ -193,6 +193,30 @@ abstract class AbstractPicoPlugin implements PicoPluginInterface
return isset($pluginConfig[$configName]) ? $pluginConfig[$configName] : $default;
}
/**
* Passes all not satisfiable method calls to Pico
*
* @see PicoPluginInterface::getPico()
*
* @deprecated 2.1.0
*
* @param string $methodName name of the method to call
* @param array $params parameters to pass
*
* @return mixed return value of the called method
*/
public function __call($methodName, array $params)
{
if (method_exists($this->getPico(), $methodName)) {
return call_user_func_array(array($this->getPico(), $methodName), $params);
}
throw new BadMethodCallException(
'Call to undefined method ' . get_class($this->getPico()) . '::' . $methodName . '() '
. 'through ' . get_called_class() . '::__call()'
);
}
/**
* Enables all plugins which this plugin depends on
*

View file

@ -2373,6 +2373,20 @@ class Pico
return substr($path, $contentDirLength, -$contentExtLength) ?: null;
}
/**
* Returns the URL of the themes folder of this Pico instance
*
* @see Pico::getUrlFromPath()
*
* @deprecated 2.1.0
*
* @return string
*/
public function getBaseThemeUrl()
{
return $this->getConfig('themes_url');
}
/**
* Substitutes URL placeholders (e.g. %base_url%)
*