init
This commit is contained in:
4
config/aliases.php
Normal file
4
config/aliases.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
\Yii::setAlias('images_folder', '/data/uploads');
|
||||
|
||||
56
config/console.php
Normal file
56
config/console.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
$params = require __DIR__ . '/params.php';
|
||||
$db = require __DIR__ . '/db.php';
|
||||
|
||||
$config = [
|
||||
'id' => 'basic-console',
|
||||
'basePath' => dirname(__DIR__),
|
||||
'bootstrap' => ['log'],
|
||||
'controllerNamespace' => 'app\commands',
|
||||
'aliases' => [
|
||||
'@bower' => '@vendor/bower-asset',
|
||||
'@npm' => '@vendor/npm-asset',
|
||||
],
|
||||
'components' => [
|
||||
'authManager' => [
|
||||
'class' => 'yii\rbac\DbManager',
|
||||
'defaultRoles' => ['guest', 'user'],
|
||||
],
|
||||
'cache' => [
|
||||
'class' => 'yii\caching\FileCache',
|
||||
],
|
||||
'log' => [
|
||||
'targets' => [
|
||||
[
|
||||
'class' => 'yii\log\FileTarget',
|
||||
'levels' => ['error', 'warning'],
|
||||
],
|
||||
],
|
||||
],
|
||||
'urlManager' => [
|
||||
'showScriptName' => false,
|
||||
'class' => 'yii\web\UrlManager',
|
||||
'scriptUrl' => "/index.php"
|
||||
],
|
||||
'db' => $db,
|
||||
],
|
||||
'params' => $params,
|
||||
/*
|
||||
'controllerMap' => [
|
||||
'fixture' => [ // Fixture generation command line.
|
||||
'class' => 'yii\faker\FixtureController',
|
||||
],
|
||||
],
|
||||
*/
|
||||
];
|
||||
|
||||
if (YII_ENV_DEV) {
|
||||
// configuration adjustments for 'dev' environment
|
||||
$config['bootstrap'][] = 'gii';
|
||||
$config['modules']['gii'] = [
|
||||
'class' => 'yii\gii\Module',
|
||||
];
|
||||
}
|
||||
|
||||
return $config;
|
||||
14
config/db.php
Normal file
14
config/db.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'class' => 'yii\db\Connection',
|
||||
'dsn' => 'mysql:host=localhost;dbname=intops',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'charset' => 'utf8',
|
||||
|
||||
// Schema cache options (for production environment)
|
||||
//'enableSchemaCache' => true,
|
||||
//'schemaCacheDuration' => 60,
|
||||
//'schemaCache' => 'cache',
|
||||
];
|
||||
5
config/params.php
Normal file
5
config/params.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'adminEmail' => 'admin@example.com',
|
||||
];
|
||||
42
config/test.php
Normal file
42
config/test.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
$params = require __DIR__ . '/params.php';
|
||||
$db = require __DIR__ . '/test_db.php';
|
||||
|
||||
/**
|
||||
* Application configuration shared by all test types
|
||||
*/
|
||||
return [
|
||||
'id' => 'basic-tests',
|
||||
'basePath' => dirname(__DIR__),
|
||||
'aliases' => [
|
||||
'@bower' => '@vendor/bower-asset',
|
||||
'@npm' => '@vendor/npm-asset',
|
||||
],
|
||||
'language' => 'en-US',
|
||||
'components' => [
|
||||
'db' => $db,
|
||||
'mailer' => [
|
||||
'useFileTransport' => true,
|
||||
],
|
||||
'assetManager' => [
|
||||
'basePath' => __DIR__ . '/../web/assets',
|
||||
],
|
||||
'urlManager' => [
|
||||
'showScriptName' => true,
|
||||
],
|
||||
'user' => [
|
||||
'identityClass' => 'app\models\User',
|
||||
],
|
||||
'request' => [
|
||||
'cookieValidationKey' => 'test',
|
||||
'enableCsrfValidation' => false,
|
||||
// but if you absolutely need it set cookie domain to localhost
|
||||
/*
|
||||
'csrfCookie' => [
|
||||
'domain' => 'localhost',
|
||||
],
|
||||
*/
|
||||
],
|
||||
],
|
||||
'params' => $params,
|
||||
];
|
||||
6
config/test_db.php
Normal file
6
config/test_db.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
$db = require __DIR__ . '/db.php';
|
||||
// test database! Important not to run tests on production or development databases
|
||||
$db['dsn'] = 'mysql:host=localhost;dbname=yii2_basic_tests';
|
||||
|
||||
return $db;
|
||||
152
config/web.php
Normal file
152
config/web.php
Normal file
@@ -0,0 +1,152 @@
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
$params = require __DIR__ . '/params.php';
|
||||
$db = require __DIR__ . '/db.php';
|
||||
|
||||
$config = [
|
||||
'id' => 'basic',
|
||||
'homeUrl' => ['/dashboard'],
|
||||
'name' => 'BeetInnovators ANPR',
|
||||
'defaultRoute' => 'dashboard',
|
||||
'basePath' => dirname(__DIR__),
|
||||
'bootstrap' => ['log'],
|
||||
'timeZone' => 'Asia/Ho_Chi_Minh',
|
||||
'language' => 'vi-VN',
|
||||
'aliases' => [
|
||||
'@bower' => '@vendor/bower-asset',
|
||||
'@npm' => '@vendor/npm-asset',
|
||||
],
|
||||
'modules' => [
|
||||
'rbac' => [
|
||||
'class' => 'yii2mod\rbac\Module',
|
||||
],
|
||||
],
|
||||
'components' => [
|
||||
'authManager' => [
|
||||
'class' => 'yii\rbac\DbManager', //'app\components\CacheRbacDbManager',
|
||||
'defaultRoles' => ['guest', 'user'],
|
||||
],
|
||||
'mongodb' => [
|
||||
'class' => '\yii\mongodb\Connection',
|
||||
'dsn' => 'mongodb://localhost:27017/human',
|
||||
],
|
||||
'view' => [
|
||||
'theme' => [
|
||||
'pathMap' => [
|
||||
'@app/views' => '@vendor/dmstr/yii2-adminlte-asset/example-views/yiisoft/yii2-app'
|
||||
],
|
||||
],
|
||||
'defaultExtension' => 'tpl',
|
||||
'renderers' => [
|
||||
'tpl' => [
|
||||
'class' => 'yii\smarty\ViewRenderer',
|
||||
//'cachePath' => '@runtime/Smarty/cache',
|
||||
],
|
||||
],
|
||||
],
|
||||
'assetManager' => [
|
||||
'bundles' => [
|
||||
'dmstr\web\AdminLteAsset' => [
|
||||
'skin' => 'skin-blue',
|
||||
],
|
||||
],
|
||||
],
|
||||
'request' => [
|
||||
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
|
||||
'cookieValidationKey' => 'eqHsmuZKxCrVYfeBbpt5suJvVHafnK7O',
|
||||
'enableCsrfValidation' => false,
|
||||
'parsers' => [
|
||||
'application/json' => 'yii\web\JsonParser',
|
||||
]
|
||||
],
|
||||
'cache' => [
|
||||
'class' => 'yii\caching\FileCache',
|
||||
],
|
||||
'user' => [
|
||||
'identityClass' => 'app\models\User',
|
||||
'enableAutoLogin' => true,
|
||||
],
|
||||
'errorHandler' => [
|
||||
'errorAction' => 'site/error',
|
||||
],
|
||||
'mailer' => [
|
||||
'class' => 'yii\swiftmailer\Mailer',
|
||||
'view' => [
|
||||
'defaultExtension' => 'tpl',
|
||||
'renderers' => [
|
||||
'tpl' => [
|
||||
'class' => 'yii\smarty\ViewRenderer',
|
||||
'cachePath' => '@runtime/Smarty/cache',
|
||||
],
|
||||
],
|
||||
],
|
||||
'viewPath' => '@app/mail',
|
||||
'transport' => [
|
||||
'class' => 'Swift_SmtpTransport',
|
||||
'host' => 'smtp.gmail.com',
|
||||
'username' => 'sunrise.media.apps@gmail.com',
|
||||
'password' => 'admin@123456',
|
||||
'port' => '587',
|
||||
'encryption' => 'tls', //ssl use post 465
|
||||
],
|
||||
'useFileTransport' => false,
|
||||
],
|
||||
'i18n' => [
|
||||
'translations' => [
|
||||
'app*' => [
|
||||
'class' => 'yii\i18n\PhpMessageSource',
|
||||
'basePath' => '@app/messages',
|
||||
//'sourceLanguage' => 'en-US',
|
||||
'fileMap' => []
|
||||
],
|
||||
],
|
||||
],
|
||||
'log' => [
|
||||
'traceLevel' => YII_DEBUG ? 3 : 0,
|
||||
'targets' => [
|
||||
[
|
||||
'class' => 'yii\log\FileTarget',
|
||||
'levels' => ['error', 'warning'],
|
||||
],
|
||||
],
|
||||
],
|
||||
'db' => $db,
|
||||
'urlManager' => [
|
||||
'enablePrettyUrl' => true,
|
||||
'showScriptName' => false,
|
||||
'enableStrictParsing' => false,
|
||||
'rules' => [
|
||||
],
|
||||
],
|
||||
],
|
||||
'params' => $params,
|
||||
];
|
||||
|
||||
if (YII_ENV_DEV) {
|
||||
// configuration adjustments for 'dev' environment
|
||||
$config['bootstrap'][] = 'debug';
|
||||
$config['modules']['debug'] = [
|
||||
'class' => 'yii\debug\Module',
|
||||
// 'allowedIPs' => ['127.0.0.1', '::1'],
|
||||
'allowedIPs' => ['*'],
|
||||
];
|
||||
|
||||
$config['bootstrap'][] = 'gii';
|
||||
$config['modules']['gii'] = [
|
||||
'class' => 'yii\gii\Module',
|
||||
// 'allowedIPs' => ['127.0.0.1', '::1'],
|
||||
'allowedIPs' => ['*'],
|
||||
'generators' => [
|
||||
'crud' => [
|
||||
'class' => 'yii\gii\generators\crud\Generator',
|
||||
'templates' => [
|
||||
'adminlte' => '@vendor/dmstr/yii2-adminlte-asset/gii/templates/crud/simple',
|
||||
]
|
||||
]
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
return $config;
|
||||
Reference in New Issue
Block a user