Skip to content

Commit

Permalink
feature:65 Add support for PHP mysqli extension, activated by default…
Browse files Browse the repository at this point in the history
…, remove returns of link_identifier

git-svn-id: http://piwigo.org/svn/trunk@20462 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
mistic100 committed Jan 30, 2013
1 parent 0bba3bf commit 6f04aba
Show file tree
Hide file tree
Showing 7 changed files with 861 additions and 20 deletions.
16 changes: 10 additions & 6 deletions admin/include/c13y_internal.class.php
Expand Up @@ -42,13 +42,17 @@ function c13y_version($c13y)

$check_list = array();

$check_list[] = array('type' => 'PHP', 'current' => phpversion(), 'required' => REQUIRED_PHP_VERSION);
$check_list[] = array(
'type' => 'PHP',
'current' => phpversion(),
'required' => REQUIRED_PHP_VERSION,
);

$db_version = pwg_get_db_version();
$check_list[] = array('type' => $conf['dblayer'],
'current' => $db_version,
'required' => constant('REQUIRED_'.str_replace('-', '_', strtoupper($conf['dblayer'])).'_VERSION')
);
$check_list[] = array(
'type' => 'MySQL',
'current' => pwg_get_db_version(),
'required' => REQUIRED_MYSQL_VERSION,
);

foreach ($check_list as $elem)
{
Expand Down
2 changes: 1 addition & 1 deletion admin/intro.php
Expand Up @@ -197,7 +197,7 @@
'PWG_VERSION' => PHPWG_VERSION,
'OS' => PHP_OS,
'PHP_VERSION' => phpversion(),
'DB_ENGINE' => $conf['dblayer'],
'DB_ENGINE' => 'MySQL',
'DB_VERSION' => $db_version,
'DB_ELEMENTS' => l10n_dec('%d photo', '%d photos', $nb_elements),
'DB_CATEGORIES' =>
Expand Down
6 changes: 3 additions & 3 deletions i.php
Expand Up @@ -402,8 +402,8 @@ function send_derivative($expires)

try
{
$pwg_db_link = pwg_db_connect($conf['db_host'], $conf['db_user'],
$conf['db_password'], $conf['db_base']);
pwg_db_connect($conf['db_host'], $conf['db_user'],
$conf['db_password'], $conf['db_base']);
}
catch (Exception $e)
{
Expand Down Expand Up @@ -511,7 +511,7 @@ function send_derivative($expires)
{
$page['rotation_angle'] = 0;
}
pwg_db_close($pwg_db_link);
pwg_db_close();

if (!try_switch_source($params, $src_mtime) && $params->type==IMG_CUSTOM)
{
Expand Down
14 changes: 5 additions & 9 deletions include/dblayer/functions_mysql.inc.php
Expand Up @@ -40,11 +40,7 @@ function pwg_db_connect($host, $user, $password, $database)
{
throw new Exception("Can't connect to server");
}
if (mysql_select_db($database, $link))
{
return $link;
}
else
if (!mysql_select_db($database, $link))
{
throw new Exception('Connection to server succeed, but it was impossible to connect to database');
}
Expand Down Expand Up @@ -138,7 +134,7 @@ function pwg_db_nextval($column, $table)
return $next;
}

function pwg_db_changes($result)
function pwg_db_changes()
{
return mysql_affected_rows();
}
Expand Down Expand Up @@ -173,14 +169,14 @@ function pwg_db_real_escape_string($s)
return mysql_real_escape_string($s);
}

function pwg_db_insert_id($table=null, $column='id')
function pwg_db_insert_id()
{
return mysql_insert_id();
}

function pwg_db_close($link=null)
function pwg_db_close()
{
return mysql_close($link);
return mysql_close();
}

/**
Expand Down

0 comments on commit 6f04aba

Please sign in to comment.