Esempio n. 1
0
 public static function existe($nom, $table = null)
 {
     $nom = self::tableName($nom);
     //
     $tab = is_null($table) ? Config::get('database.database') : $table;
     $i = Database::countS("select * FROM information_schema.tables WHERE table_schema ='" . $tab . "' AND table_name = '" . $nom . "' LIMIT 1;");
     if ($i > 0) {
         return true;
     } else {
         return false;
     }
 }
Esempio n. 2
0
 private function exist($key)
 {
     return Database::countS("select * from " . $this->DatabaseTableName() . " where name='{$key}'") > 0;
 }
Esempio n. 3
0
 public static function check()
 {
     if (Session::existe('auths')) {
         return true;
     } else {
         if (Cookie::existe(Config::get('auth.rememeber_cookie'))) {
             $y = Database::countS('select * from ' . Config::get('auth.table') . ' where rememberToken="' . Cookie::get(Config::get('auth.rememeber_cookie')) . '"');
             if ($y == 1) {
                 return true;
             } else {
                 return false;
             }
         } else {
             return false;
         }
     }
 }