User tests: Successful: Unsuccessful:
Per doc block, autoloading type should default to psr4
in 4.0
Code review?
Yeah.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
No idea. Typos already corrected.
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.
Ok thnx,
i had edited yesterday already, but i removed the code.
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/
its working, but the path is: C:\wamp\www\freshj4\libraries/kunena/
\JLoader::registerNamespace('Kunena\\Forum\\Libraries', JPATH_LIBRARIES . '/kunena/');
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.
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.
I have tested this item
Code review.
@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'
?
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
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:
?
|
Thanks!
@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