Install a libraries plugin or media plugin.
example: Kunena 6.0 Libraries
on kunena.xml file has
<namespace>Kunena\Forum\Libraries</namespace>
autoload_psr4.php has the libraries namespace.
No libraries or media dir has been added to the autoload_prs4.php file.
other namespaces has been added:
'Kunena\\Forum\\Site\\' => [JPATH_SITE . '/components/com_kunena/'],
'Kunena\\Forum\\Api\\' => [JPATH_API . '/components/com_kunena/'],
'Kunena\\Forum\\Administrator\\' => [JPATH_ADMINISTRATOR . '/components/com_kunena/'],
'Kunena\\Forum\\Plugin\\Kunena\\Altauserpoints\\' => [JPATH_PLUGINS . '/kunena/altauserpoints/'],
'Kunena\\Forum\\Plugin\\Kunena\\Community\\' => [JPATH_PLUGINS . '/kunena/community/'],
'Kunena\\Forum\\Plugin\\Kunena\\Comprofiler\\' => [JPATH_PLUGINS . '/kunena/comprofiler/'],
'Kunena\\Forum\\Plugin\\Kunena\\Finder\\' => [JPATH_PLUGINS . '/kunena/finder/'],
'Kunena\\Forum\\Plugin\\Kunena\\Gravatar\\' => [JPATH_PLUGINS . '/kunena/gravatar/'],
'Kunena\\Forum\\Plugin\\Kunena\\Joomla\\' => [JPATH_PLUGINS . '/kunena/joomla/'],
'Kunena\\Forum\\Plugin\\Kunena\\Kunena\\' => [JPATH_PLUGINS . '/kunena/kunena/'],
'Kunena\\Forum\\Plugin\\Quickicon\\Kunena\\' => [JPATH_PLUGINS . '/quickicon/kunena/'],
'Kunena\\Forum\\Plugin\\System\\Kunena\\' => [JPATH_PLUGINS . '/system/kunena/'],
Also i tried on system plugin:
class plgSystemKunena extends CMSPlugin
{
/**
* Method to register custom library.
*
* return void
*/
public function onAfterInitialise()
{
\JLoader::registerNamespace('Kunena\\Forum\\Libraries', JPATH_LIBRARIES . '/kunena/');
}
}
4.0-dev git
Labels |
Added:
?
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-01-11 14:23:49 |
Closed_By | ⇒ | SharkyKZ |
Closed_Date | 2020-01-11 14:23:49 | ⇒ | 2020-01-11 14:23:50 |
Closed_By | SharkyKZ | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @SharkyKZ by The JTracker Application at issues.joomla.org/joomla-cms/27459
Please test PR #27479.
Right, currently namespace mapper doesn't support libraries.
The plugin method should work but you need to pass the autoloading type (
psr4
) .JLoader::registerNamespace()
doc block says it should default topsr4
in 4.0 but that hasn't been done yet.Note, autoloading is based on filesystem. Directory/file casing must match class names otherwise the code will fail on case sensitive filesystems (Linux).