public static function checkAutoIncrement($server, $user, $pwd)
 {
     try {
         $link = DbPDO::_getPDO($server, $user, $pwd, false, 5);
     } catch (PDOException $e) {
         return false;
     }
     $ret = (bool) (($result = $link->query('SELECT @@auto_increment_increment as aii')) && ($row = $result->fetch()) && $row['aii'] == 1);
     $ret &= (bool) (($result = $link->query('SELECT @@auto_increment_offset as aio')) && ($row = $result->fetch()) && $row['aio'] == 1);
     unset($link);
     return $ret;
 }
Beispiel #2
0
 /**
  * @see Db::checkEncoding()
  */
 public static function tryUTF8($server, $user, $pwd)
 {
     try {
         $link = DbPDO::_getPDO($server, $user, $pwd, false, 5);
     } catch (PDOException $e) {
         return false;
     }
     $result = $link->exec('SET NAMES \'utf8\'');
     unset($link);
     return $result === false ? false : true;
 }