Skip to content

Commit

Permalink
added configs
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Aug 13, 2016
1 parent 1c2bb1e commit 247b676
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 3 deletions.
24 changes: 21 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,32 @@
"homepage": "http://hiqdev.com/"
}
],
"require": {
"php": "^5.6|^7.0",
"yiisoft/yii2": "^2.0",
"hiqdev/composer-config-plugin": "<2.0 || dev-master"
},
"require-dev": {
"hiqdev/hidev-php": "<2.0 || dev-master",
"hiqdev/hidev-hiqdev": "<2.0 || dev-master"
},
"autoload": {
"psr-4": {
"hisite\\": "src",
"hiqdev\\hisite\\core\\": "src"
"hisite\\": "src"
}
},
"extra": {
"config-plugin": {
"params": "src/config/params.php",
"hisite": "src/config/hisite.php",
"hidev": "src/config/hidev.php"
}
},
"minimum-stability": "dev",
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
}
]
}
93 changes: 93 additions & 0 deletions src/config/hisite.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?php

/*
* HiPanel core package
*
* @link https://hipanel.com/
* @package hipanel-core
* @license BSD-3-Clause
* @copyright Copyright (c) 2014-2016, HiQDev (http://hiqdev.com/)
*/

$config = [
'id' => 'hisite',
'name' => 'HiSite',
'basePath' => dirname(__DIR__),
'viewPath' => '@hisite/views',
'vendorPath' => '@root/vendor',
'runtimePath' => '@root/runtime',
'controllerNamespace' => 'hisite\controllers',
'bootstrap' => ['log', 'themeManager', 'language', 'menuManager'],
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
'@vendor/bower' => '@vendor/bower-asset',
'@vendor/npm' => '@vendor/npm-asset',
],
'components' => [
'request' => [
'enableCsrfCookie' => true, /// XXX TO BE DISABLED
'cookieValidationKey' => $params['cookieValidationKey'],
],
'mailer' => [
'class' => \yii\swiftmailer\Mailer::class,
'viewPath' => '@hisite/mail',
],
'log' => [
'traceLevel' => defined('YII_DEBUG') && YII_DEBUG ? 3 : 0,
'targets' => [
'default' => [
'class' => \yii\log\FileTarget::class,
'levels' => ['error', 'warning'],
],
],
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'urlManager' => [
'class' => \yii\web\UrlManager::class,
'enablePrettyUrl' => true,
'showScriptName' => false,
'enableStrictParsing' => false,
'rules' => [
'<_c:[\w\-]+>/<id:\d+>' => '<_c>/view',
'<_c:[\w\-]+>' => '<_c>/index',
'<_c:[\w\-]+>/<_a:[\w\-]+>/<id:\d+>' => '<_c>/<_a>',
],
],
'themeManager' => [
'class' => \hiqdev\thememanager\ThemeManager::class,
],
'menuManager' => [
'class' => \hiqdev\menumanager\MenuManager::class,
'items' => [
'sidebar' => [
'items' => [],
],
'breadcrumbs' => [
'saveToView' => 'breadcrumbs',
],
],
],
],
'modules' => [
'language' => [
'class' => \hiqdev\yii2\language\Module::class,
'languages' => [
'en' => 'English',
'ru' => 'Русский',
]
],
],
];

if (defined('YII_DEBUG') && YII_DEBUG) {
$config['bootstrap']['debug'] = 'debug';
$config['modules']['debug'] = [
'class' => \yii\debug\Module::class,
'allowedIPs' => $params['debug_allowed_ips'],
];
}

return $config;
18 changes: 18 additions & 0 deletions src/config/params.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

/*
* HiPanel core package
*
* @link https://hipanel.com/
* @package hipanel-core
* @license BSD-3-Clause
* @copyright Copyright (c) 2014-2016, HiQDev (http://hiqdev.com/)
*/

return [
'orgUrl' => '',
'adminEmail' => 'admin@example.com',

'cookieValidationKey' => '',
'debug_allowed_ips' => [],
];

0 comments on commit 247b676

Please sign in to comment.