The sqlConnect object is usually created in the config file with the name $conx and used all over the application. Exemple of the config file :
$conx = new sqlConnect("root", "en34b25") ; $conx->setHostname("localhost") ; $conx->setDatabase("testpackage") ; // Directory where Radria is located $conx->setBaseDirectory($cfg_local_mydbdir) ; // Directory where the project is located unless your config.php file is outside of your project tree. The project directory should be "./" $conx->setProjectDirectory("./") ; $conx->start()
The sqlConnect function creates a connection to the database and stores the project directory. It is used throughout the application. Most Radria applications need an sqlConnect object even if you don't use a database. Example of a sqlConnect object without using the database :
$conx = new sqlConnect() ; // Directory where pas is located $conx->setBaseDirectory($cfg_local_mydbdir) ; // Directory where the project is located unless your config.php file is outside your project tree is should be "./" $conx->setProjectDirectory("./") ;
In this case the $conx is used to get directory information like base PAS directory and project directory.
It records all the SQL Queries for that $connection object.
Another very used feature is the backup sync : $conx→setBackupSync(true);
This flag will be sent to the sqlQuery object which will record all the queries sent to the database in two files.
This is used by SiteManager to synchronize remote databases. It can also be used in production environments to log queries at the application level.