Browse Source

Installer fix modules and apache static htaccess

master
Egorka 6 years ago
parent
commit
82bd94cefe
  1. 9
      setup.php

9
setup.php

@ -296,9 +296,6 @@ $main_htacces = <<<MH
RewriteCond %{HTTP_HOST} ^static.{$this->_domain}
RewriteRule ^(.*)$ zxcms/static/$1 [L]
#RewriteCond %{HTTP_HOST} ^static.{$this->_domain}
#RewriteRule ^(.*)$ $1 [L]
RewriteCond %{HTTP_HOST} ^admin.{$this->_domain}
RewriteRule ^(.*)$ zxcms/backend/web/$1 [L]
@ -316,7 +313,6 @@ $main_htacces = <<<MH
RewriteCond %{HTTP_HOST} ^admin.{$this->_domain}
RewriteRule ^.*$ zxcms/backend/web/index.php [L]
#RewriteCond %{REQUEST_URI} !^/zxcms/static
RewriteCond %{REQUEST_URI} ^/(assets|css|js|images)
RewriteRule ^assets/(.*)$ zxcms/frontend/web/assets/$1 [L]
RewriteRule ^css/(.*)$ zxcms/frontend/web/css/$1 [L]
@ -324,7 +320,6 @@ $main_htacces = <<<MH
RewriteRule ^images/(.*)$ zxcms/frontend/web/images/$1 [L]
RewriteRule ^(.*)$ zxcms/frontend/web/$1 [L]
#RewriteCond %{REQUEST_URI} !^/zxcms/static
RewriteCond %{REQUEST_URI} !^/zxcms/(frontend|backend)/web/(assets|css|js)/
RewriteCond %{REQUEST_URI} !index.php
RewriteCond %{REQUEST_FILENAME} !-f [OR]
@ -357,7 +352,7 @@ RewriteRule . {$this->_http_protocol}://{$this->_domain}/site/error [R=404,L]
ErrorDocument 404 {$this->_http_protocol}://{$this->_domain}/site/error
SH;
file_put_contents(__DIR__ . '/frontend/web/.htaccess', $static_htaccess);
file_put_contents(__DIR__ . '/static/.htaccess', $static_htaccess);
}
private function addPermissions() : void
@ -386,7 +381,7 @@ SH;
'languages', 'pages', 'forms', 'links'
];
foreach ($systemModules as $name) {
shell_exec('php ' . __DIR__ . '/yii module/add "' . $name . '"');
shell_exec('php ' . __DIR__ . '/yii module/activate "' . $name . '"');
}
echo Console::log($this->l('Complete'), 'green') . PHP_EOL;
}

Loading…
Cancel
Save