Example #1
0
 /**
  * check the setup
  */
 protected function checkSetup()
 {
     /**
      * @triggerEvent before_setup_check this event is triggered before the setup check
      */
     Event::triggerEvent('before_setup_check');
     if (!Registry::isRegistered('templateVars')) {
         Registry::set('templateVars', []);
     }
     if (!isset($this->settings['encryptionKey']) || strlen($this->settings['encryptionKey']) == 0) {
         if ($this->router->getCurrentUrl() !== 'setup') {
             $this->response->redirect($this->router->url('setup'));
             return;
         }
     } else {
         if (is_file(CONTENT_DIR . 'setup.md')) {
             unlink(CONTENT_DIR . 'setup.md');
         }
     }
     /**
      * @triggerEvent after_setup_check this event is triggered after the setup check
      */
     Event::triggerEvent('after_setup_check');
 }