LaravelSetup.php 924 B

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