Skip to content

Commit

Permalink
Switch to framework supplied compatibility method
Browse files Browse the repository at this point in the history
  • Loading branch information
billtomczak committed Dec 11, 2023
1 parent 3b9caf5 commit 8952bf5
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions src/admin/include.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@
* along with OSDownloads. If not, see <http://www.gnu.org/licenses/>.
*/

use Alledia\Framework\AutoLoader;
use Alledia\Framework\Joomla\Extension\Helper;
use Alledia\Framework\Helper as FrameworkHelper;
use Alledia\Framework\Joomla\Extension\Helper as ExtensionHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Version;
use Joomla\Database\DatabaseDriver;
use Joomla\Database\DatabaseQuery;

defined('_JEXEC') or die();

Expand All @@ -50,23 +48,12 @@

require_once OSDOWNLOADS_ADMIN . '/vendor/autoload.php';

Helper::loadLibrary('com_osdownloads');
AutoLoader::register('\\Alledia\\OSDownloads', OSDOWNLOADS_LIBRARY);
ExtensionHelper::loadLibrary('com_osdownloads');
FrameworkHelper::createDatabaseClassAliases();

if (Version::MAJOR_VERSION < 4) {
// Joomla 3 shims
JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php');

$classAliases = [
JDatabaseQuery::class => DatabaseQuery::class,
JDatabaseDriver::class => DatabaseDriver::class,
];
foreach ($classAliases as $class => $classAlias) {
if (class_exists($classAlias) == false) {
class_alias($class, $classAlias);
}
}
unset($classAliases);
}

switch (Factory::getApplication()->getName()) {
Expand Down

0 comments on commit 8952bf5

Please sign in to comment.