| Current Path : /var/www/html/audit/backend/modules/installer/ |
| Current File : /var/www/html/audit/backend/modules/installer/SiteBootstrap.php |
<?php
namespace backend\modules\installer;
use Yii;
use yii\base\Component;
use yii\helpers\Url;
/**
* Check If site needs installation.
*
* Class SiteBootstrap
* @package awsaf\installer
*/
class SiteBootstrap extends Component {
public function init() {
parent::init();
if(Yii::$app->params['installed']) {
} else {
if(strpos($_SERVER['REQUEST_URI'], 'installer') === false) {
$url = Url::to(['/installer/default/index']);
if(!strpos($_SERVER['REQUEST_URI'], 'admin')) {
$url = Url::to(['/admin/installer/default/index']);
}
die(header('Location: ' . $url));
}
}
}
}