...
 
Commits (2)
{
"name": "agenda-libre-php",
"version": "3.5.0",
"version": "3.6.0-dev",
"description": "agenda libre is free software written in php that manages collaborative agenda",
"homepage": "https://git.framasoft.org/agenda-libre/agenda-libre-php",
"keywords": [
......
......@@ -30,37 +30,43 @@
class db
{
/**
* open a connection to the database
*
* @param $db_host the database server name
* @param $db_user the database login
* @param $db_pass the database password
* @param $db_charset the database charset
* @param $db_name the database name
* @return the database resource or throw an exception
*/
//function sqlConnect($db_host, $db_user, $db_pass, $db_charset = "UTF-8", $db_name)
function db()
{
global $db_host;
global $db_user;
global $db_pass;
//global $db_charset;
$db_charset = "UTF-8";
global $db_name;
if(@mysql_connect($db_host,$db_user,$db_pass)==FALSE)
{
echo "Probleme de connexion à la base de données sur $db_host.\n";
return 0;
}
if(@mysql_select_db($db_name) == FALSE)
{
echo "Problème de selection de la base de données $db_name sur $db_host.\n";
return 0;
}
mysql_query("set names 'utf8'");
try {
$dbResource = new PDO("mysql:host=$db_host;dbname=$db_name", $db_user, $db_pass);
$dbResource->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$dbResource->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
$dbResource->exec("SET CHARACTER SET $db_charset");
} catch (PDOException $exception) {
throw $exception;
}
return $dbResource;
}
function query ($query)
{
if( ($result = @mysql_query($query)) == FALSE)
{
echo "Probleme dans la syntaxe de $query : " . mysql_error() . "\n";
return 0;
}
return $result;
$pdoResultSet = $dbResource->query($statement);
return $pdoResultSet;
//$pdoResultSet->closeCursor();
}
function insertid ()
......
......@@ -57,7 +57,7 @@ regions = {
}
baseUrl = "http://agenda.example.org"
agendaVersion = "3.5.0"
agendaVersion = "3.6.0-dev"
def Usage():
print u"""Soumettre un évènement dans l'Agenda du Libre
......