I am creating a PHP application using the Mini2 framework.
https://github.com/panique/mini2
This is a very simple basic MVC framework. In my index.php file, I have to declare various routes, models, etc.
I share the fragment in which I declare the models.
$model = new \Mini\Model\Model($app->config('database'));
$usermodel = new \Mini\Model\User\userModel($app->config('database'));
In my project root ... there are these files
/Mini/Model/Model.php
/Mini/Model/userModel.php
Here is what my Model.php looks like
<?php
namespace Mini\Model;
use PDO;
class Model
{
private $db;
function __construct($config)
{
$dsn = 'mysql:host=' . $config['db_host'] . ';dbname=' . $config['db_name'] . ';port=' . $config['db_port'];
$options = array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ, PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING);
$this->db = new PDO($dsn, $config['db_user'], $config['db_pass'], $options);
}
}
Here is what my userModel.php looks like
<? php
namespace Mini\Model\User;
use PDO;
class userModel
{
/private $db;
function __construct($config)
{
$dsn = 'mysql:host='. $config['db_host']. ';dbname='. $config['db_name']. ';port='. $config['db_port'];
$options = array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ, PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING);
$this->db = new PDO($dsn, $config['db_user'], $config['db_pass'], $options);
}
}
When I launch my web application, I get this error.

Both of my model files are used and declared the same, but only one is available. Only Model.php is available.
I checked the internal files of the Mini2 infrastructure and could not find the file that requires file preloading. Now I am at a loss.
, userModel User inside model.
/Mini/Model/User/userModel.php

php .