XoopsCore icon indicating copy to clipboard operation
XoopsCore copied to clipboard

Roadmap: Namespace Conversion for Kernel Classes

Open geekwright opened this issue 10 years ago • 2 comments

Using a Namespace for classes is considered best practice. Some kernel classes have been converted to the Xoops\Core\Kernel namespace, but more remain.

geekwright avatar Feb 21 '15 20:02 geekwright

does this concern all classes in class and kernel directories ? if not what are the rules to decide ?

alain91 avatar Aug 17 '15 08:08 alain91

Alain,

Thanks for taking an interest in this one!

The first priority would be to update the kernel directory. Currently, only object.php has been converted.

I would like to move the these to the Xoops\Core\Kernel\Handlers namespace.

Each separate class should be in its own file in that namespace.

The classes in existing files would be converted to stubs, for example, like this for blocks.php:

class XoopsBlock extends Xoops\Core\Kernel\Handlers\XoopsBlock
{
}

class XoopsBlockHandler extends Xoops\Core\Kernel\Handlers\XoopsBlockHandler
{
}

These will be retained for legacy code compatibility, and will be removed in a future version.

Xoops::getHandler() will need to be modified to go directly to the namespaced handlers.

The classes directory is very similar, but has a big mix of what has and has not been done. There are also a few exceptions. I'll do an inventory and post the plan for those separately.

geekwright avatar Aug 17 '15 22:08 geekwright