This is my first time writing an application in PHP. I normally developer in Node or MVC4, if that helps any.
Here is my directory structure for this project:
-TestProject
--BackgroundWorkers
---Worker1
----Repositories
-----Worker1.php
--index.php
--SplClassLoader.php
The namespace in Worker1.php is Worker1\Repositories
and the class name is Worker1
.
I've attempted every combination of Namespace and Path I can think of, but here's an example:
<?php
require_once("SplClassLoader.php");
$loader = new SplClassLoader('Worker1\Repositories', 'TestProject/BackgroundWorkers/Worker1');
$loader -> register();
$r = new Worker1\Repositories\Worker1();
?>
What am I doing wrong?