Autoloading from packages

Permalink
Hi Everyone,

A couple of versions ago classes in the src folder of a package wouldn't autoload anymore. I couldn't figure out why and eventually just implemented autoloading myself. But this is obviously not the proper way to do it and Concrete is going to deprecate the PSR4 autoloader soon and just use composer. I've been checking the forums and documentation but can't figure out why it's not working. Is it still suppose to autoload by Concrete or do I have to something myself?

I have a structure like this for example : /packages/cool_package/src/Foundation/Reporting/Log.php
and the namespace + classname of this file will be: Concrete\Package\CoolPackage\Src\Foundation\Reporting\Log. This doesn't autoload.

I also have a class in a different folder that is not autoloading:
/packages/antispam/Antispam/AntispamController. This class is being dynamically loaded by Concrete as an antispam controller but won't autoload.

Justin1978
 
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi Justin1978,

Have you read the documentation on the autoloading changes between 5.7 and v8?

Adding Custom Code to Packages
https://documentation.concrete5.org/developers/packages/adding-custo...
Justin1978 replied on at Permalink Reply
Justin1978
I thought I deleted this post after I created it. I did manage to find the answer after I created the thread on this page:https://documentation.concrete5.org/developers/packages/adding-custo... Funny how you always find the answer after you ask a question. I did a lot of searching first.