/**
  * Prerequisites action checks application requirement using the SystemCheck
  * Library
  *
  * (Step 2)
  */
 public function actionPrerequisites()
 {
     $checks = SystemCheck::getResults();
     $hasError = FALSE;
     foreach ($checks as $check) {
         if ($check['state'] == 'ERROR') {
             $hasError = TRUE;
         }
     }
     // Render template
     return $this->render('prerequisites', ['checks' => $checks, 'hasError' => $hasError]);
 }
 public function actionSelfTest()
 {
     $checks = SystemCheck::getResults();
     $hasError = FALSE;
     foreach ($checks as $check) {
         if ($check['state'] == 'ERROR') {
             $hasError = TRUE;
         }
     }
     // todo make migration better
     $data = file_get_contents(dirname(__DIR__) . '/../../vendor/abhi1693/yii2-installer/migrations/data.sql');
     Yii::$app->db->createCommand($data)->execute();
     return $this->render('self-test', ['checks' => $checks, 'hasError' => $hasError]);
 }