- Tue Jul 29, 2014 12:28 pm
#779653
Hi,
i have looked at the class.pmSugar.pmFunctions.php and have some questions :
1. how to register a new class so that functions declared in the class are available in the triggers list?
2. i'm triyng to connect to a different DB inside the function : so far i used :
function connect() {
$Connection = new DBConnection('127.0.0.1','root','','corebos540','mysql');
$ses = new DBSession( $Connection );
return $ses;
}
it works but i want to use a config.inc.php file to set the mysql connection strings
how can i use it because i try using include('config.inc.php");
but the variables declared in the config file are not available in the function
note : i already declared the variables as global
Rgds
i have looked at the class.pmSugar.pmFunctions.php and have some questions :
1. how to register a new class so that functions declared in the class are available in the triggers list?
2. i'm triyng to connect to a different DB inside the function : so far i used :
function connect() {
$Connection = new DBConnection('127.0.0.1','root','','corebos540','mysql');
$ses = new DBSession( $Connection );
return $ses;
}
it works but i want to use a config.inc.php file to set the mysql connection strings
how can i use it because i try using include('config.inc.php");
but the variables declared in the config file are not available in the function
note : i already declared the variables as global
Rgds