LaravelSetup.php 798 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace Hestia\WebApp\Installers;
  3. class LaravelSetup extends BaseSetup {
  4. protected $appname = 'laravel';
  5. protected $config = [
  6. 'form' => [
  7. ],
  8. 'database' => true,
  9. 'resources' => [
  10. 'composer' => [ 'src' => 'laravel/laravel', 'dst' => '/' ],
  11. ],
  12. ];
  13. public function install(array $options=null) : bool
  14. {
  15. parent::install($options);
  16. $result = null;
  17. $htaccess_rewrite = '
  18. <IfModule mod_rewrite.c>
  19. RewriteEngine On
  20. RewriteRule ^(.*)$ public/$1 [L]
  21. </IfModule>';
  22. $tmp_configpath = $this->saveTempFile($htaccess_rewrite);
  23. $this->appcontext->runUser('v-move-fs-file',[$tmp_configpath, $this->getDocRoot(".htaccess")], $result);
  24. return ($result->code === 0);
  25. }
  26. }