? ? Pending

User tests: Successful: Unsuccessful:

avatar SharkyKZ
SharkyKZ
10 Jan 2020

Summary of Changes

Per doc block, autoloading type should default to psr4 in 4.0

Testing Instructions

Code review?

Documentation Changes Required

Yeah.

avatar SharkyKZ SharkyKZ - open - 10 Jan 2020
avatar SharkyKZ SharkyKZ - change - 10 Jan 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 10 Jan 2020
Category Libraries
01092b8 10 Jan 2020 avatar SharkyKZ Typos
avatar SharkyKZ SharkyKZ - change - 10 Jan 2020
Labels Added: ?
avatar richard67
richard67 - comment - 11 Jan 2020

@SharkyKZ Looks good to me on code review. I only wonder why the same change hasn't been made for the getNamespaces function here https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/loader.php#L171, i.e. same doc block notice added in past so that it now could be changed, too. But maybe that's right, I don't know. Do you have any idea?

Update: Maybe the prs typo in the comment here should be corrected, too? https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/loader.php#L165

avatar SharkyKZ
SharkyKZ - comment - 11 Jan 2020

No idea. Typos already corrected.

avatar 810
810 - comment - 11 Jan 2020

We should also edit the getNamespaces on the libraries/namespacemap.php file.

It should also support the libraries dir when you have added the namespace on the xml file. So you don't need to add a extra plugin to execute it.

Now you need a extra plugin if you just want to add a Library.

avatar SharkyKZ
SharkyKZ - comment - 11 Jan 2020

@810 I'm already working on that, but that will be a different PR.

avatar 810
810 - comment - 11 Jan 2020

Ok thnx,
i had edited yesterday already, but i removed the code.

avatar 810
810 - comment - 11 Jan 2020

ps on the registerNamespace on loader.php
there is also a windows dir issue. You can add a path::clean($path) to fix it.
now for me its: loading this location: C:\wamp\www\freshj4\libraries\kunena/

avatar 810
810 - comment - 11 Jan 2020

its working, but the path is: C:\wamp\www\freshj4\libraries/kunena/

\JLoader::registerNamespace('Kunena\\Forum\\Libraries', JPATH_LIBRARIES . '/kunena/');

avatar SharkyKZ
SharkyKZ - comment - 11 Jan 2020

Mixed slashes generally don't cause issues. If you need to perform string manipulation of the paths for whatever reason, you can use Joomla\CMS\Filesystem\Path::clean() yourself.

avatar richard67
richard67 - comment - 11 Jan 2020

Mixed slashes generally don't cause issues. If you need to perform string manipulation of the paths for whatever reason, you can use Joomla\CMS\Filesystem\Path::clean() yourself.

Correct.

avatar richard67 richard67 - test_item - 11 Jan 2020 - Tested successfully
avatar richard67
richard67 - comment - 11 Jan 2020

I have tested this item successfully on 6dd0919

Code review.


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

avatar richard67
richard67 - comment - 11 Jan 2020

@wilsonge Do you think it needs to make the same change here https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/loader.php#L171 for function getNamespaces, i.e. let $type parameter default to 'psr4'?

avatar 810 810 - test_item - 11 Jan 2020 - Tested successfully
avatar 810
810 - comment - 11 Jan 2020

I have tested this item successfully on 6dd0919


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

avatar richard67 richard67 - change - 11 Jan 2020
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 11 Jan 2020

RTC


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

avatar wilsonge wilsonge - change - 11 Jan 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-01-11 15:27:13
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 11 Jan 2020
avatar wilsonge wilsonge - merge - 11 Jan 2020
avatar wilsonge
wilsonge - comment - 11 Jan 2020

Thanks!

Add a Comment

Login with GitHub to post a comment