Пример #1
0
 private function _dumpDatabase($filename, $dbname, $droptable)
 {
     $filename .= ".sql";
     $filename = $this->folder . DIRECTORY_SEPARATOR . $filename;
     $dbconfigList = BizSystem::getConfiguration()->getDatabaseInfo();
     $dbconfig = $dbconfigList[$dbname];
     if (strtolower($dbconfig["Driver"]) != 'pdo_mysql') {
         return;
     }
     include_once dirname(dirname(__FILE__)) . "/lib/MySQLDump.class.php";
     $backup = new MySQLDump();
     if ($droptable == 1) {
         $backup->droptableifexists = true;
     } else {
         $backup->droptableifexists = false;
     }
     if ($dbconfig["Port"]) {
         $dbHost = $dbconfig["Server"] . ":" . $dbconfig["Port"];
     } else {
         $dbHost = $dbconfig["Port"];
     }
     $dbc = $backup->connect($dbHost, $dbconfig["User"], $dbconfig["Password"], $dbconfig["DBName"], $dbconfig["Charset"]);
     if (!$dbc) {
         echo $backup->mysql_error;
     }
     $backup->dump();
     $data = $backup->output;
     file_put_contents($filename, $data);
     @chmod($filename, 0777);
     return $filename;
 }
Пример #2
0
 protected function getSimpleFromList(&$list, $selectFrom)
 {
     // in case of a|b|c
     $dbconfig = BizSystem::getConfiguration()->getDatabaseInfo();
     foreach ($dbconfig as $rec => $value) {
         $list[$i]['val'] = $rec;
         $list[$i]['txt'] = $rec;
         $list[$i]['pic'] = $rec;
         $i++;
     }
 }
Пример #3
0
 /**
  * set char to quote system identifiers
  * @return void
  */
 protected function setQuoteIdentifiers()
 {
     if ($this->m_QuoteIdentifiers == null) {
         $this->m_QuoteIdentifiers = '';
         $dbInfo = BizSystem::getConfiguration()->getDatabaseInfo($this->m_Database);
         if (strtoupper($dbInfo["Driver"]) == "PDO_MYSQL") {
             $this->m_QuoteIdentifiers = '`';
         }
     }
 }