Hi built an library to deal with Ms Sql querys in CI4. Stored in Libraries folder
<?php
namespace App\Libraries;
class Mssql
{
/* default values */
private $connection = null;
private $server = "";
private $database = "";
private $user = "";
private $password = "";
private $port = "";
const ICONV_TRANSLIT = "TRANSLIT";
const ICONV_IGNORE = "IGNORE";
const WITHOUT_ICONV = "";
public function __construct()
{
die("Just entered in lib Mssql");
/*$db = new Database();
$this->server = $db->mssqlServer;
$this->database = $db->mssqlDatabase;
$this->user = $db->mssqlUser;
$this->password = $db->mssqlPassword;
$this->port = $db->mssqlPort;*/
}
I want it to autoload when the app starts so I edited the autoload.php file like this
public $psr4 = [
APP_NAMESPACE => APPPATH, // For custom app namespace
'Config' => APPPATH . 'Config',
'Libraries' => APPPATH . 'Libraries',
];
public $classmap = [
'Mssql' => APPPATH . 'Libraries/Mssql.php',
];
I think that I should see "Just entered in lib Mssql" when entering in the home controller but it do nothing... Can someone point me what I am doing wrong? I dont want to type use App\libraries\Mssql in every single model file that I have