コード例 #1
0
ファイル: Language.php プロジェクト: stnc/stnc-framework
 /**
  * dil fonksiyonu yuklenir
  *
  * public function load($name, $code = LANGUAGE_CODE)
  *
  * @param string $name
  * @param string $code
  */
 public function load($name)
 {
     $code = $this->defaultLanguage;
     // lang dosyası
     $file = "app/language/" . $code . "/" . $name . "_lng.php";
     // okunabilir mi
     if (is_readable($file)) {
         // dosya gerekli ...
         $this->_array = (include $file);
     } else {
         // hata bas
         die(\Controllers\Error::display("Dil dosyası bulunamadı  '" . $code . "/" . $name_lng . ".php'"));
     }
 }
コード例 #2
0
ファイル: database.php プロジェクト: joaopauloti/inmvc
 /**
  * Update Function
  *
  * Function used to update things on the database.
  *
  * @param string $table A name of table to insert into
  * @param string $data An associative array
  * @param string $where the WHERE query part
  */
 public function update($table, $data, $where)
 {
     ksort($data);
     $fieldDetails = NULL;
     foreach ($data as $key => $value) {
         $fieldDetails .= "`{$key}`=:{$key},";
     }
     $fieldDetails = rtrim($fieldDetails, ',');
     $sth = $this->prepare("UPDATE {$table} SET {$fieldDetails} WHERE {$where}");
     foreach ($data as $key => $value) {
         $sth->bindValue(":{$key}", $value);
     }
     if (!$sth->execute()) {
         $error = new Error();
         $error->index('500');
         die;
     }
 }
コード例 #3
0
ファイル: database.php プロジェクト: RicardoPiuco/pi_db
 /**
  * Update Function
  *
  * Function used to update things on the database.
  *
  * @param string $table A name of table to insert into
  * @param string $data An associative array
  * @param string $where the WHERE query part
  */
 public function update($table, $data, $where, $dataWhere = array())
 {
     ksort($data);
     $this->fieldDetails = null;
     foreach ($data as $key => $value) {
         $this->fieldDetails .= $key . '=:' . $key . ',';
     }
     $this->fieldDetails = rtrim($this->fieldDetails, ',');
     $sth = $this->prepare('UPDATE ' . $table . ' SET ' . $this->fieldDetails . ' WHERE ' . $where);
     foreach ($data as $key => $value) {
         $sth->bindValue(':' . $key, $value);
     }
     foreach ($dataWhere as $key => $value) {
         $sth->bindValue(':' . $key, $value);
     }
     if (!$sth->execute()) {
         $error = new Error();
         $error->index('500');
         die;
     }
     return $sth->rowCount();
 }
コード例 #4
0
ファイル: Application.php プロジェクト: ivan-yarema/SmokerMVC
 public function error($code, $message)
 {
     $errorController = new Error();
     $errorController->index($code, $message);
 }