Changeset 20462


Ignore:
Timestamp:
Jan 30, 2013, 12:12:22 PM (11 years ago)
Author:
mistic100
Message:

feature:65 Add support for PHP mysqli extension, activated by default, remove returns of link_identifier

Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/c13y_internal.class.php

    r19703 r20462  
    4343    $check_list = array();
    4444
    45     $check_list[] = array('type' => 'PHP', 'current' => phpversion(), 'required' => REQUIRED_PHP_VERSION);
    46 
    47     $db_version = pwg_get_db_version();
    48     $check_list[] = array('type' => $conf['dblayer'],
    49                           'current' => $db_version,
    50                           'required' => constant('REQUIRED_'.str_replace('-', '_', strtoupper($conf['dblayer'])).'_VERSION')
    51                           );
     45    $check_list[] = array(
     46        'type' => 'PHP',
     47        'current' => phpversion(),
     48        'required' => REQUIRED_PHP_VERSION,
     49        );
     50
     51    $check_list[] = array(
     52        'type' => 'MySQL',
     53        'current' => pwg_get_db_version(),
     54        'required' => REQUIRED_MYSQL_VERSION,
     55        );
    5256
    5357    foreach ($check_list as $elem)
  • trunk/admin/intro.php

    r19703 r20462  
    198198    'OS' => PHP_OS,
    199199    'PHP_VERSION' => phpversion(),
    200     'DB_ENGINE' => $conf['dblayer'],
     200    'DB_ENGINE' => 'MySQL',
    201201    'DB_VERSION' => $db_version,
    202202    'DB_ELEMENTS' => l10n_dec('%d photo', '%d photos', $nb_elements),
  • trunk/i.php

    r19703 r20462  
    403403try
    404404{
    405   $pwg_db_link = pwg_db_connect($conf['db_host'], $conf['db_user'],
    406                                 $conf['db_password'], $conf['db_base']);
     405  pwg_db_connect($conf['db_host'], $conf['db_user'],
     406                 $conf['db_password'], $conf['db_base']);
    407407}
    408408catch (Exception $e)
     
    512512  $page['rotation_angle'] = 0;
    513513}
    514 pwg_db_close($pwg_db_link);
     514pwg_db_close();
    515515
    516516if (!try_switch_source($params, $src_mtime) && $params->type==IMG_CUSTOM)
  • trunk/include/dblayer/functions_mysql.inc.php

    r19703 r20462  
    4141    throw new Exception("Can't connect to server");
    4242  }
    43   if (mysql_select_db($database, $link))
    44   {
    45     return $link;
    46   }
    47   else
     43  if (!mysql_select_db($database, $link))
    4844  {
    4945    throw new Exception('Connection to server succeed, but it was impossible to connect to database');
     
    139135}
    140136
    141 function pwg_db_changes($result)
     137function pwg_db_changes()
    142138{
    143139  return mysql_affected_rows();
     
    174170}
    175171
    176 function pwg_db_insert_id($table=null, $column='id')
     172function pwg_db_insert_id()
    177173{
    178174  return mysql_insert_id();
    179175}
    180176
    181 function pwg_db_close($link=null)
    182 {
    183   return mysql_close($link);
     177function pwg_db_close()
     178{
     179  return mysql_close();
    184180}
    185181
  • trunk/install.php

    r19703 r20462  
    129129$dbpasswd = (!empty($_POST['dbpasswd'])) ? $_POST['dbpasswd'] : '';
    130130$dbname = (!empty($_POST['dbname'])) ? $_POST['dbname'] : '';
    131 $dblayer = 'mysql';
     131$dblayer = extension_loaded('mysqli') ? 'mysqli' : 'mysql';
    132132
    133133$admin_name = (!empty($_POST['admin_name'])) ? $_POST['admin_name'] : '';
Note: See TracChangeset for help on using the changeset viewer.