admidio icon indicating copy to clipboard operation
admidio copied to clipboard

Using Namespaces

Open ximex opened this issue 10 years ago • 3 comments

To avoid conflicts with classnames of other libs and better logical structure we should use namespaces. https://secure.php.net/manual/en/language.namespaces.php

ximex avatar Nov 06 '15 17:11 ximex

If we finished the API we should definitly use it to avoid trouble shooting. At the moment in my opinion it is not important. The only thing would be an issue if Admidio is implementet in a modern CMS, but we removed the classic theme ... so it is not really usefull

thomas-rcv avatar Nov 10 '15 22:11 thomas-rcv

A possible structure for namespaces:

classes\Core\Session. ...\Component  ...\AdmException. ..\Navigation. ...\Message. ...\Language
classes\Html\HtmlPage ...\HtmlTable. ...\HtmlForm. ...\Menu
classes\Modules\Modules. ...\ModuleDates
classes\Utils\StringUtils.  ...\FileSystemUtils
classes\Users\User. ...\UserImport.  ...\TableUserField

Where to add classes like Tablephotos , TableCategory or ListConfiguration?

After use of namespaces should we rename classes? e.g. AdmException to only Exception?

Fasse avatar Jun 25 '21 08:06 Fasse

i think we should but all classes that extends TableAccess in the same directory. And to Exceptions. I think we should use more of the already defined exceptions: https://www.php.net/manual/en/class.exception.php

ximex avatar Jun 27 '21 09:06 ximex