Hello Daniel,
just a couple of opinions/considerations
1)
i noticed you are moving core/system classes to namespaced versions.
what about following PSR the way Yii2 frameworks does?
/system/library/cart/Customer.php
namespace system/library/cart; // or even including vendor name oc/system/library/cart
class Customer {
// ...
}
Yii2 uses lowercase for directory paths and namespaces (this does not break PSR) and camel case for class names and files. I believe this would be less confusing for people coming from or using other frameworks.
2)
even not following PSR standards i believe it would be better to keep class names related to file names, for example
"session/default.php" could be less confusing if written as "session/file.php" and setting the "file" session adapter in the configuration as the default adapter/driver.
kind regards,
maks
Hi,
Namespaces were introduced for one thing and for one thing only! If you have two classes (maybe from different libraries), which happen to have the same name. e.g. Customer from Opencart and Customer from some CRM system or whatever, namespace can be used to prevent naming conflicts. With proper namespaces set, a global uniqueness for a class can be guaranteed.
If a vendor prefix (like Opencart... ) is not added, the whole namespacing thing isn't worth doing in the first place! Please be aware the the OC\ namespace prefix is already used by owncloud (e.g. https://github.com/owncloud/core/blob/master/core/user/usercontroller.php)
Following PSR-4 (https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md) would be amazing and would allow for using the composer autoloader.
Please add the vendor Prefix!
opencart is staying out as default. if other people add libraries in then it should be unde the vendor folder and will have there own folder.