Booked Scheduler Community Support
October 20, 2019, 02:41:47 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Postgres in 2.1 version  (Read 2160 times)
mbrada
Newbie
*

Karma: 0
Posts: 2


« on: May 17, 2012, 12:25:00 PM »

Hello:

I have a production copy of phpSch... 1.2. It is working fine on postgres 8.4.

Now I am installing version 2.1 with the purpose of upgrade it. I saw the login form and get this error message when submit.

Fatal error: Call to undefined function mysql_connect() in /home/aulas/desa/lib/Database/MySQL/MySqlConnection.php on line 53

... even though, my configuration is:

$conf['settings']['database']['type'] = 'pgsql';
$conf['settings']['database']['user'] = 'myuser';        // database user with permission to the phpScheduleIt database
$conf['settings']['database']['password'] = 'XXX';
$conf['settings']['database']['hostspec'] = 'mypostgresserver';        // ip, dns or named pipe
$conf['settings']['database']['name'] = 'mydatabase';

The test version is in the same server as production version, so the questions are:

Works 2.1 with postgresql ?
Do I need to install something more ?

Thanx in advance !

Martin
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 6408


WWW
« Reply #1 on: May 29, 2012, 02:15:36 PM »

At the moment phpScheduleIt is only configured to use MySQL. You can try this code to enable any MDB2 database. Change the GetDatabase() function on line 28 of /lib/Database/DatabaseFactory.php to:

Code:
public static function GetDatabase()
{
if (is_null(self::$_instance))
{
$databaseType = Configuration::Instance()->GetSectionKey(ConfigSection::DATABASE, ConfigKeys::DATABASE_TYPE);
$dbUser = Configuration::Instance()->GetSectionKey(ConfigSection::DATABASE, ConfigKeys::DATABASE_USER);
$dbPassword = Configuration::Instance()->GetSectionKey(ConfigSection::DATABASE, ConfigKeys::DATABASE_PASSWORD);
$hostSpec = Configuration::Instance()->GetSectionKey(ConfigSection::DATABASE, ConfigKeys::DATABASE_HOSTSPEC);
$dbName = Configuration::Instance()->GetSectionKey(ConfigSection::DATABASE, ConfigKeys::DATABASE_NAME);

if (strtolower($databaseType) == 'mysql')
{
self::$_instance = new Database(new MySqlConnection($dbUser, $dbPassword, $hostSpec,$dbName));
}
else
{
self::$_instance = new Database(new Mdb2Connection($databaseType,$dbUser, $dbPassword, $hostSpec,$dbName));
}

}

return self::$_instance;
}
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!