? Success

User tests: Successful: Unsuccessful:

avatar johanjanssens
johanjanssens
6 Mar 2015

Joomla 3.4 is extending Composer\Autoload\ClassLoader to make sure JLoader::applyAliasFor($class); is called when a class is being loaded.

Description

The implementation in Joomla 3.4 prevents to use composer in your own extension and requires developers to implement a workaround first.

To resolve this the PR rewrites the implementation and instead of extending Composer\Autoload\ClassLoader it decorates it. This is the advised approach to handle this scenario by the Composer team. For details see following discussion.

Additionally the fix brings the Composer integration in Joomla more inline with Composer itself. The specialised composer_autoload.php file is removed in favour of the autoload.php file generated by Composer.

List of changes

  • Remove /libraries/composer_autoload.php use default /libraries/vendor/autoload.php as per composer specification
  • Decorate \Composer\Autoload\ClassLoader through JClassLoader
  • Unregister default class loader and register decorator during Joomla Cms bootstrapping

Testing instructions

Make sure Joomla still works.

avatar johanjanssens johanjanssens - open - 6 Mar 2015
avatar joomla-cms-bot joomla-cms-bot - change - 6 Mar 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 6 Mar 2015
Easy No Yes
avatar joomla-cms-bot joomla-cms-bot - change - 6 Mar 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 6 Mar 2015
Category Libraries Repository
avatar wilsonge
wilsonge - comment - 7 Mar 2015

Hey Johan. Thanks for this. Looks like a great improvement. A few small things. Firstly travis is failing pretty hard with this change. Secondly can you fix the spaces instead of tabs in the files please :)

avatar johanjanssens
johanjanssens - comment - 26 Apr 2015

@wilsonge Changed the files to using tabs instead of spaces as requested. All yours.

avatar infograf768
infograf768 - comment - 3 May 2015
avatar wilsonge wilsonge - change - 3 May 2015
Milestone Added:
avatar johanjanssens johanjanssens - change - 3 May 2015
Milestone Removed:
avatar johanjanssens
johanjanssens - comment - 3 May 2015

@infograf768 Thanks for the headsup. Made it so.

Little suggestion to optimise this process. Deleted files and folder could be added to a JSON file during package build. This can be done by getting the info from Git or by comparing packages. A JSON files could be created by the packager to hold the deleted files and folders.

avatar zero-24
zero-24 - comment - 15 May 2015

@test just applyed the patch and i can't see that anything breaks i guess joomla will be absolutly broken if this file don't work correct? Or can/need we test some special case?

avatar zero-24 zero-24 - test_item - 15 May 2015 - Tested successfully
avatar wilsonge
wilsonge - comment - 16 May 2015

We moved everything across to JRegistry so things would still work. You should try using JRegistry instead of /Joomla/Registry/Registry in places and check it still works.

avatar zero-24
zero-24 - comment - 19 May 2015

@test i have just tryed some external components (e.g. akeeba backup and ARS es well as others) and they work with that patch.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6335.

avatar wilsonge
wilsonge - comment - 17 Jun 2015

Merged in e1cfdc0 - thankyou very much @johanjanssens :)

avatar wilsonge wilsonge - change - 17 Jun 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-06-17 20:49:25
Closed_By wilsonge
avatar wilsonge wilsonge - close - 17 Jun 2015
avatar johanjanssens
johanjanssens - comment - 17 Jun 2015

@wilsonge Thanks! Great news.

avatar johanjanssens
johanjanssens - comment - 19 Jun 2015
avatar infograf768
infograf768 - comment - 1 Jul 2015

Add a Comment

Login with GitHub to post a comment