This repository has been archived on 2025-06-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
server/onyx/modules/db/main.php
2013-10-09 15:40:23 +02:00

28 lines
No EOL
757 B
PHP

<?php
if(!defined('ONYX')) exit;
switch($OPT['type'])
{
case 'mysql':
case 'postgresql':
$api = array('mysql' => 'mysql_connect', 'postgresql' => 'pg_connect');
if(!function_exists($api[$OPT['type']])) trigger_error('API introuvable',E_USER_ERROR);
unset($api);
function dbpass($crypt,$cle)
{
return cxor(base64_decode($crypt),md5($cle,TRUE));
}
$db_config = $OPT;
require_once($OPT['type'].'.class.php');
define('DB_TYPE',$OPT['type']);
break;
default: trigger_error('Base de donnee inconnue',E_USER_ERROR);
}
?>