コード例 #1
0
ファイル: database.php プロジェクト: klas/joomla-cms
 /**
  * Method to set the database character set to UTF-8.
  *
  * @param   JDatabaseDriver  $db    JDatabaseDriver object.
  * @param   string           $name  Name of the database to process.
  *
  * @return  boolean  True on success.
  *
  * @since   3.1
  */
 public function setDatabaseCharset($db, $name)
 {
     // Run the create database query.
     $db->setQuery($db->getAlterDbCharacterSet($name));
     try {
         $db->execute();
     } catch (RuntimeException $e) {
         return false;
     }
     return true;
 }
コード例 #2
0
ファイル: database.php プロジェクト: rasiodesign/joomla-cms
 /**
  * Method to set the database character set to UTF-8.
  *
  * @param   JDatabaseDriver  $db    JDatabaseDriver object.
  * @param   string           $name  Name of the database to process.
  *
  * @return  boolean  True on success.
  *
  * @since   3.0
  */
 public function setDatabaseCharset($db, $name)
 {
     // Run the create database query.
     $db->setQuery($db->getAlterDbCharacterSet($name));
     /*'ALTER DATABASE '.$db->quoteName($name).' CHARACTER' .
     			' SET `utf8`'
     		);*/
     try {
         $db->execute();
     } catch (RuntimeException $e) {
         return false;
     }
     return true;
 }