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

This reverts commits efc4fb5288 and bc816febfc
pico-3.0
Daniel Rudolf 3 years ago
parent 41fc15a7e8
commit fe6c8f805a
No known key found for this signature in database
GPG Key ID: A061F02CD8DE4538
  1. 24
      lib/AbstractPicoPlugin.php
  2. 14
      lib/Pico.php

@ -193,6 +193,30 @@ abstract class AbstractPicoPlugin implements PicoPluginInterface
return isset($pluginConfig[$configName]) ? $pluginConfig[$configName] : $default; 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 * Enables all plugins which this plugin depends on
* *

@ -2373,6 +2373,20 @@ class Pico
return substr($path, $contentDirLength, -$contentExtLength) ?: null; 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%) * Substitutes URL placeholders (e.g. %base_url%)
* *

Loading…
Cancel
Save