Пример #1
0
 function checkModuleInstalled()
 {
     $tableName = $this->getTableName();
     // check if table exists
     $tableExists = new CDbCommand(Yii::app()->getDb(), "\n            show tables like '{$tableName}'\n        ");
     try {
         $exists = $tableExists->queryColumn();
     } catch (Exception $e) {
         $exists = false;
     }
     return $exists ? true : false;
 }
Пример #2
0
 public static function doesTableExist($tableName)
 {
     $tableExists = new CDbCommand(Yii::app()->getDb(), "\n            show tables like '{$tableName}'\n        ");
     try {
         $exists = $tableExists->queryColumn();
     } catch (Exception $e) {
         $exists = false;
     }
     return $exists ? true : false;
 }