From a9039ba87611b697e51293bdd46ec3335e4642e3 Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Tue, 3 Jan 2012 14:36:17 +0100 Subject: [PATCH] replace config.inc --- lib/classes/task/Scheduler.class.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/classes/task/Scheduler.class.php b/lib/classes/task/Scheduler.class.php index 207f6eaa47..33651d12c2 100644 --- a/lib/classes/task/Scheduler.class.php +++ b/lib/classes/task/Scheduler.class.php @@ -45,7 +45,19 @@ class task_Scheduler protected static function get_connection() { - require __DIR__ . '/../../../config/connexion.inc'; + $handler = new \Alchemy\Phrasea\Core\Configuration\Handler( + new \Alchemy\Phrasea\Core\Configuration\Application(), + new \Alchemy\Phrasea\Core\Configuration\Parser\Yaml() + ); + $configuration = new \Alchemy\Phrasea\Core\Configuration($handler); + + $connexion = $configuration->getConnexion(); + + $hostname = $connexion->get('host'); + $port = $connexion->get('port'); + $user = $connexion->get('user'); + $password = $connexion->get('password'); + $dbname = $connexion->get('dbname'); return new connection_pdo('appbox', $hostname, $port, $user, $password, $dbname); } @@ -111,7 +123,7 @@ class task_Scheduler { continue; } - + $tid = $task->get_task_id(); if (!$task->is_running())