Beispiel #1
0
 function __destruct()
 {
     $this->db->free();
     $this->db->close();
 }
Beispiel #2
0
                 {
                     return strpos(strtolower($str), strtolower($needle));
                 }
             }
             if (stripos($names['table_name'], $tb_prefix) === 0) {
                 $sqldump .= data2sql($names['table_name']);
             }
         }
         pb_create_folder(PHPB2B_ROOT . DS . "data" . DS . "backup_" . $backupdir);
         $file_path = PHPB2B_ROOT . DS . "data" . DS . "backup_" . $backupdir . DS . date('ymd') . '_' . pb_radom() . ".sql";
         if (trim($sqldump)) {
             file_put_contents($file_path, $sqldump);
             unset($sqldump);
         }
     }
     $db->free();
 }
 ob_start();
 $schema_path = "data/schemas/" . $app_lang . "/";
 $schema_common_path = "data/schemas/";
 if (!file_exists($schema_path)) {
     die(L("congratulate", "msg", $schema_path));
 }
 if (file_exists($schema_common_path . "mysql.sql")) {
     $conn = $db->connect($dbname, $dbhost, $dbuser, $dbpasswd);
     if ($version > '4.1' && $charset) {
         $db->query($set_names);
     }
     if ($version > '5.0') {
         $db->query($set_modes);
     }