I'm trying to build my own composer project and am trying to test out the code to ensure it works as I start building it. I've read through dozens of tutorials and stack overflow questions, and all seem to point to that I'm doing things right, though since it's not working, I imagine I'm not.
I have a file structure of:
index.php
composer.json
composer.lock
vendor/
src
\Frankenstein
\DB
|FrankensteinDB.php
and have made the composer.json look as follows:
{
"autoload": {
"psr-4" : {"Frankenstein\\":"src/Frankenstein"}
},
"require": {
"enrise/frisbee": "0.1.0"
}
}
FrankensteinDB.php looks like:
<?php
namespace Frankenstein\DB;
use Frisbee\Exception\Flingable;
class FrankensteinDB extends Flingable
{
public function __construct($name)
{
parent::__construct($name, 1337);
}
public function run()
{
}
public function next()
{
}
}
and of course lastly, the index.php is as follows:
<?php
require_once 'vendor/autoload.php';
use Frankenstein\DB\FrankensteinDB;
try {
throw new FrankensteinDB('frankenstein');
} catch (Error $e){
$e->getCode();
}
every time I run the code I get Class 'Frankenstein\DB\FrankensteinDB' not found
and I just can't figure out why. I've tried about every combination of folders in the namespace, use, and composer psr-4 part and nothing seems to work. I also am running composer update after each change to be sure the autoload files get regenerated.