The name speaks for itself. So here is my project structure:
|src |Database |Core |MySQL.php |Support start.php |vendor composer.json index.php
MySQL.php file:
<?php namespace Database\Core;
index.php and start.php files:
//start.php file <?php require __DIR__ . '/../vendor/autoload.php'; ?> //index.php file <?php use Database\Core; require __DIR__ . '/src/start.php'; $mysql = new MySQL();
And finally, my startup part of composer.json:
"autoload": { "psr-4": "Database\\": "src/" // Also tried "src/Database" too }
Where is the problem? I am really tired of trying to deal with this situation. Please help the guys! Thanks.
php composer-php autoloader
lostbyte
source share