diff --git a/libraries/src/Cache/Cache.php b/libraries/src/Cache/Cache.php index 0850b9d84bd04..ae205a9ba529b 100644 --- a/libraries/src/Cache/Cache.php +++ b/libraries/src/Cache/Cache.php @@ -77,33 +77,6 @@ public function __construct($options) } } - /** - * Returns a reference to a cache adapter object, always creating it - * - * @param string $type The cache object type to instantiate - * @param array $options The array of options - * - * @return CacheController - * - * @since 1.7.0 - * - * @deprecated 4.2 will be removed in 7.0 - * Use the cache controller factory instead - * Example: Factory::getContainer()->get(CacheControllerFactoryInterface::class)->createCacheController($type, $options); - */ - public static function getInstance($type = 'output', $options = []) - { - @trigger_error( - \sprintf( - '%s() is deprecated. The cache controller should be fetched from the factory.', - __METHOD__ - ), - E_USER_DEPRECATED - ); - - return Factory::getContainer()->get(CacheControllerFactoryInterface::class)->createCacheController($type, $options); - } - /** * Get the storage handlers * diff --git a/libraries/src/Cache/CacheController.php b/libraries/src/Cache/CacheController.php index d5e5465dd1503..dccef202f7eb4 100644 --- a/libraries/src/Cache/CacheController.php +++ b/libraries/src/Cache/CacheController.php @@ -9,9 +9,6 @@ namespace Joomla\CMS\Cache; -use Joomla\CMS\Factory; -use Joomla\Filesystem\Path; - // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects @@ -75,95 +72,4 @@ public function __call($name, $arguments) { return \call_user_func_array([$this->cache, $name], $arguments); } - - /** - * Returns a reference to a cache adapter object, always creating it - * - * @param string $type The cache object type to instantiate; default is output. - * @param array $options Array of options - * - * @return CacheController - * - * @since 1.7.0 - * @throws \RuntimeException - * - * @deprecated 4.2 will be removed in 7.0 - * Use the cache controller factory instead - * Example: Factory::getContainer()->get(CacheControllerFactoryInterface::class)->createCacheController($type, $options); - */ - public static function getInstance($type = 'output', $options = []) - { - @trigger_error( - \sprintf( - '%s() is deprecated. The cache controller should be fetched from the factory.', - __METHOD__ - ), - E_USER_DEPRECATED - ); - - try { - return Factory::getContainer()->get(CacheControllerFactoryInterface::class)->createCacheController($type, $options); - } catch (\RuntimeException) { - $type = strtolower(preg_replace('/[^A-Z0-9_\.-]/i', '', $type)); - $class = 'JCacheController' . ucfirst($type); - - if (!class_exists($class)) { - // Search for the class file in the Cache include paths. - $path = Path::find(self::addIncludePath(), strtolower($type) . '.php'); - - if ($path !== false) { - \JLoader::register($class, $path); - } - - // The class should now be loaded - if (!class_exists($class)) { - throw new \RuntimeException('Unable to load Cache Controller: ' . $type, 500); - } - - // Only trigger a deprecation notice if the file and class are found - @trigger_error( - 'Support for including cache controllers using path lookup is deprecated and will be removed in 7.0.' - . ' Use a custom cache controller factory instead.', - E_USER_DEPRECATED - ); - } - - return new $class($options); - } - } - - /** - * Add a directory where Cache should search for controllers. You may either pass a string or an array of directories. - * - * @param array|string $path A path to search. - * - * @return array An array with directory elements - * - * @since 1.7.0 - * - * @deprecated 4.2 will be removed in 7.0 - * Use the cache controller factory instead - * Example: Factory::getContainer()->get(CacheControllerFactoryInterface::class)->createCacheController($type, $options); - */ - public static function addIncludePath($path = '') - { - static $paths; - - if (!isset($paths)) { - $paths = []; - } - - if (!empty($path) && !\in_array($path, $paths)) { - // Only trigger a deprecation notice when adding a lookup path - @trigger_error( - 'Support for including cache controllers using path lookup is deprecated and will be removed in 7.0.' - . ' Use a custom cache controller factory instead.', - E_USER_DEPRECATED - ); - - array_unshift($paths, Path::clean($path)); - } - - return $paths; - } } diff --git a/libraries/src/Pathway/Pathway.php b/libraries/src/Pathway/Pathway.php index ab15cc61c0602..f6a48bc925af9 100644 --- a/libraries/src/Pathway/Pathway.php +++ b/libraries/src/Pathway/Pathway.php @@ -9,9 +9,6 @@ namespace Joomla\CMS\Pathway; -use Joomla\CMS\Factory; -use Joomla\CMS\Language\Text; - // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects @@ -41,45 +38,6 @@ class Pathway */ protected $count = 0; - /** - * Pathway instances container. - * - * @var Pathway[] - * @since 1.7 - */ - protected static $instances = []; - - /** - * Returns a Pathway object - * - * @param string $client The name of the client - * - * @return Pathway A Pathway object. - * - * @since 1.5 - * @throws \RuntimeException - * - * @deprecated 4.3 will be removed in 7.0 - * Get the instance from the application - * Example: - * $app->getPathway() - */ - public static function getInstance($client) - { - if (empty(self::$instances[$client])) { - // Create a Pathway object - $name = ucfirst($client) . 'Pathway'; - - if (!Factory::getContainer()->has($name)) { - throw new \RuntimeException(Text::sprintf('JLIB_APPLICATION_ERROR_PATHWAY_LOAD', $client), 500); - } - - self::$instances[$client] = Factory::getContainer()->get($name); - } - - return self::$instances[$client]; - } - /** * Return the Pathway items array * diff --git a/libraries/src/Session/Session.php b/libraries/src/Session/Session.php index d9def5b00ff2c..31d9d70e75a73 100644 --- a/libraries/src/Session/Session.php +++ b/libraries/src/Session/Session.php @@ -143,27 +143,6 @@ public static function getHandlers(): array return $connectors; } - /** - * Returns the global session object. - * - * @return static The Session object. - * - * @since 1.5 - * - * @deprecated 4.3 will be removed in 7.0 - * Load the session service from the dependency injection container or via $app->getSession() - * Example: Factory::getApplication()->getSession(); - */ - public static function getInstance() - { - @trigger_error( - __METHOD__ . '() is deprecated. Load the session from the dependency injection container or via Factory::getApplication()->getSession().', - E_USER_DEPRECATED - ); - - return Factory::getApplication()->getSession(); - } - /** * Get data from the session store *