[phpMyAdmin Developers] Single location for classes

Michal Čihař michal at cihar.com
Fri Jun 16 16:43:28 CEST 2017


Hello

Maurício Meneghini Fauth píše v Út 13. 06. 2017 v 21:35 -0300:
> Currently, classes do not have a single location in the directory
> structure. The class files are mixed with other kinds of files in the
> libraries directory, and the PMA namespace points to the root path
> which causes all classes to have a namespace that begins with
> PMA\libraries. This affects the performance of the autoloader.

Is this something noticeable or just hypothetic? 

> One solution to solve this problem would be to move the classes to a
> new directory that contains only class files and create a new
> namespace that points to that directory.
> The directory can have any name that describes it, like lib, classes,
> includes or src, but what I usually see in open source projects is
> the src directory.

I don't think src is good fit there, it's good for libraries, but I
don't think it makes sense for us. Also we've spent quite some time to
educate people to block access to the libraries folder, so I'd stick
with that.

> Then we can use the namespace PhpMyAdmin, which is already used in
> SqlParser, in the src directory, and after all classes are moved to
> that directory, we remove the PMA namespace.

I was thinking about namespace unification as well, so this certainly
makes sense.

How about just registering namespace on the libraries folder (eg.
PhpMyAdmin\Core)?

-- 
	Michal Čihař | https://cihar.com/ | https://weblate.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.phpmyadmin.net/pipermail/developers/attachments/20170616/185b6ed6/attachment.sig>


More information about the Developers mailing list