예제 #1
0
 private function __construct()
 {
     try {
         $this->mysql = internal_dbal::connect('mysql', MYSQL_HOST, MYSQL_DB, MYSQL_USER, MYSQL_PASS, MYSQL_PORT);
         $this->mysql->query('SET NAMES utf8;');
         $this->mysql->query('SET character_set_client = utf8;');
         $this->mysql->query('SET character_set_results = utf8;');
         $this->mysql->query('SET character_set_connection = utf8;');
         $this->mysql->query('SET CHARACTER SET utf8;');
         $this->mysql->query('SET collation_connection = utf8_polish_ci;');
     } catch (idbal_exception $e) {
         die($e->getMessage() . '<br />' . 'W pliku: <b>' . $e->getFile() . '</b>, numer wiersza: <b>' . $e->getLine() . '</b>');
     }
 }
예제 #2
0
 static function get_class($class)
 {
     $path = pathinfo(realpath(__FILE__));
     self::$path = $path['dirname'] . '/';
     if (false === (include_once self::$path . $class . '.php')) {
         return false;
     }
     if (!class_exists('internal_dbal_' . $class)) {
         return false;
     }
     return true;
 }