Somehow I have problems with the composer autoloader. I am using Propel as ORM framework. My folder structure looks the following:
src/BestFreeSites/App
- /Map
- /Base
src/BestFreeSites/Auth
src/BestFreeSites/Framework
I want to include all files using composer autoload. My composer.json file looks like this:
"autoload": {
"classmap": [
"src/BestFreeSites/App/",
"src/BestFreeSites/App/Base/",
"src/BestFreeSites/App/Map/",
"src/BestFreeSites/Auth/",
"src/BestFreeSites/Framework/"
]
}
The classes in the first three folders are accessible, but not the classes in Auth and Framework (created by me). I've also set the correct namespaces. Let's take AuthController.php (in folder Auth) as an example:
namespace BestFreeSites\Auth;
public class AuthController
{
public function register($args)
{
return $args;
}
}
And I'm trying to include the file with 'use', like this:
use \BestFreeSites\App\SiteQuery;
use \BestFreeSites\App\UserQuery;
use \BestFreeSites\App\RatingQuery;
use \BestFreeSites\Auth\AuthController as Auth;
use \BestFreeSites\Framework\Abstract;
Only the last two imports are not working. I have already dumped my autoload and reloaded it (composer dump-autoload)
Could anyone please guide me in the right direction?
Thanks in advance :)
Kind regards, David