InstallRoute.php 499 B

1234567891011121314151617181920212223242526
  1. <?php
  2. class InstallRoute implements IRoute
  3. {
  4. public static function getInstance()
  5. {
  6. return new InstallRoute(new View(), new HeaderWrapper());
  7. }
  8. private $view;
  9. private $header;
  10. private function __construct(View $view, HeaderWrapper $header)
  11. {
  12. $this->view = $view;
  13. $this->header = $header;
  14. }
  15. public function run(Url $url)
  16. {
  17. if(!file_exists(APPROOT . "setup/install.php"))
  18. {
  19. $this->header->location("/");
  20. }
  21. return $this->view->render("../setup/install.php", array());
  22. }
  23. }