Post by veganista » Thu Jan 09, 2014 11:01 pm

First off, great to see auto-loading make it into the next version.

This autoloader will make it easy to load OpenCart classes but I feel it may fall a bit short when loading complex third party libraries.

In terms of organisation I personally like to keep my third party libraries separate from my OpenCart classes so i use the convention of placing them in a vendor folder in the app root.

My suggestion is to allow autoloading to happen for 3rd party libraries from the vendor folder. We have PSR-4 that we could use.

I'm not suggesting we make the OpenCart classes PSR-4 compliant but could we apply it to 3rd party libraries we may use?

I'm thinking we may have issues with namespaces if we go the PSR-4 route however as it would also mean OpenCart was now 5.3.0+ only.

Apologies if this has been discussed before.

Cheers

New member

Posts

Joined
Mon Apr 26, 2010 11:50 pm

Post by sir.creator » Thu Feb 03, 2022 8:18 pm

You can add composer. And in index.php write:

include "vendor/autoload.php";

And enjoy life

Newbie

Posts

Joined
Thu Feb 03, 2022 8:15 pm
Who is online

Users browsing this forum: No registered users and 7 guests