0
I’m having a problem with Poser’s autoload, the structure and code are all right, only he’s not finding the class.
I’ve already updated the autoloads by bash and nothing... anyone knows what it might be?
{
"name": "celestino/ecommerce",
"description": "PHP 7 Ecommerce",
"type": "project",
"authors": [
{
"name": "Lucas Celestino",
"email": "[email protected]"
}
],
"minimum-stability": "dev",
"require": {
"phpmailer/phpmailer":"5.2.*",
"rain/raintpl":"3.0.0",
"slim/slim":"2.0"
},
"autoload":{
"psr-4": {
"Cap\\":"vendor\\cap\\php-classes\\src"
}
}
}
This is my index.php where I’m calling the class:
<?php
require_once("vendor\autoload.php");
$app = new \Slim\Slim();
$app->get('/', function ()
{
$sql = new Cap\DB\Sql();
$sql->teste();
});
$app->run();
?>
And that’s my class I’m calling.
Folder structure: Ecommerce vendor cap php-classes src DB
<?php
namespace DB;
class Sql
{
public function teste()
{
echo "Funcionando";
}
}
?>