Ejemplo n.º 1
0
 public function query($sql, $params = array())
 {
     Logger::Debug("Query {$sql} ", $params);
     $reponse = $this->pdo->prepare($sql);
     if ($reponse === false) {
         $error = $this->pdo->errorInfo();
         ErrorHandler::error(500, null, "Error in SQL statement {$error[0]} ({$error[1]}) {$error[2]} in\n{$sql}");
     }
     $reponse->setFetchMode(PDO::FETCH_NAMED);
     $result = $reponse->execute($params);
     if ($result === false) {
         $error = $reponse->errorInfo();
         ErrorHandler::error(500, null, "Sql error {$error[0]} ({$error[1]}) {$error[2]} in\n{$sql}");
     }
     return $reponse;
 }
Ejemplo n.º 2
0
 public function getTableInfo($name)
 {
     Logger::Debug("getTableInfo ({$name})");
     return false;
 }
Ejemplo n.º 3
0
 public function update()
 {
     if (Cli::getOption("a")) {
         $cf_dir = "\"" . realpath(CF_DIR) . "\"";
     } else {
         $cf_dir = "ROOT_DIR . \"/" . System::relativePath(System::absPath(ROOT_DIR), System::absPath(CF_DIR)) . "\"";
     }
     Cli::pinfo(" * Create paths.php");
     Logger::Debug("CF dir is {$cf_dir}");
     Logger::Debug("ROOT dir is " . ROOT_DIR);
     $content = "<?php // DO NOT MODIFY THIS FILE, IT IS GENERATED BY setup update SCRIPT\n\n";
     $content .= "@define(\"ROOT_DIR\", \"" . ROOT_DIR . "\");\n";
     $content .= "@define(\"CF_DIR\", {$cf_dir});\n";
     file_put_contents(CONFIG_DIR . "/paths.php", $content);
 }