Skip to content

Commit bc20df9

Browse files
committed
php 5.6, giiant, db cache
1 parent dc9c1d8 commit bc20df9

File tree

5 files changed

+1713
-682
lines changed

5 files changed

+1713
-682
lines changed

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,34 @@
22

33
Yii2-app is Fast and Ready-to-production advanced project template.
44

5-
**PHP 7.1** because it is really fast.
5+
For you, I downgrade requirement to PHP v5.6. But **PHP 7.1** is better! because it is really fast.
6+
7+
Please, [enable php intl extension](http://php.net/manual/en/intl.installation.php) for better work.
68

79
Default, the template includes three tiers: `frontend`, `backend`, and `console`, each of which is a separate Yii application.
810

911
> **NOTE:** Template is in initial development. Anything may change at any time.
1012
1113

1214
## Features
13-
* Admin template is beautiful and simple bootstrap, compatible with yii2 assets: [yiister/yii2-gentelella](https://github.com/yiister/yii2-gentelella), [Demo](https://colorlib.com/polygon/gentelella/)
15+
* Gentelella Admin template is beautiful and simple bootstrap, compatible with yii2 assets: [yiister/yii2-gentelella](https://github.com/yiister/yii2-gentelella), [Demo](https://colorlib.com/polygon/gentelella/)
1416
* Yii2 User is strong and proved user-module with many features: [dektrium/yii2-user](https://github.com/dektrium/yii2-user) (login `adminus`, password `adminus`)
1517
* Frontend and Backend User Controllers are filtered (by `dektrium/yii2-user`)
16-
* Redis cache is really fast (you may change to DB-cache, but don't forget [create table](https://www.yiiframework.com/doc/api/2.0/yii-caching-dbcache#$cacheTable-detail))
18+
* DB cache, but I recommend Redis Cache - it is really fast
1719
* Yii2 queue (DB table `queue`), but you can use *Redis-queue* or other [yii2-queue docs](https://github.com/yiisoft/yii2-queue/blob/master/docs/guide/README.md)
1820
* Queue Manager with backend (`/queuemanager/default/index`) using [ignatenkovnikita/yii2-queuemanager](https://github.com/ignatenkovnikita/yii2-queuemanager)
1921
* Log DB Target with backend (`/log/index`) - simply view log messages
2022
* .htaccess - config for **pretty urls** (rewrite index.php), *may be later add nginx config*
2123
* **UrlManagerFrontend** for backend app (all url rules in file `frontend/config/urls.php`, hostInfo in `common/config/params.php`)
22-
* i18n translations in `common/messages` with config
24+
* i18n translations in `common/messages` with config (current only English and Russian, language translation are welcome!)
2325
* ContactForm in frontend app is improved: [himiklab/yii2-recaptcha-widget](https://github.com/himiklab/yii2-recaptcha-widget),
2426
all email are saved to DB (`common/models/EmailForm` Model), optionally send message to Viber messenger via bot
2527
(install requirements [Bogdaan/viber-bot-php](https://github.com/Bogdaan/viber-bot-php) and config, uncomment code in Model)
2628
* **postcss** config (`frontend/web/src/pcss//*.css`)
2729
* Gii generator:
2830
1. added **yii2-queue** Jobs generator
2931
2. yii2 migration generator (from existing table) [Insolita/yii2-migrik](https://github.com/Insolita/yii2-migrik)
30-
3. may be later - [schmunk42/yii2-giiant](https://github.com/schmunk42/yii2-giiant) - really steroid, but in development with bugs
32+
3. [schmunk42/yii2-giiant](https://github.com/schmunk42/yii2-giiant) - really steroid, but in development with bugs
3133

3234

3335
## Available modules
@@ -67,6 +69,13 @@ Change in `common/config/main.php`
6769
'language' => 'ru-RU',
6870
'sourceLanguage' => 'en-US',
6971
```
72+
73+
Add your language in `common/messages/config.php`
74+
```
75+
'languages' => [
76+
'ru-RU',
77+
],
78+
```
7079
In shell
7180
```
7281
php yii message/extract common/messages/config.php

common/config/main.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
2+
$hostinfo = require 'params.php';
23
return [
3-
'language' => 'ru-RU',
4+
'language' => 'en-US',
45
'sourceLanguage' => 'en-US',
56
'aliases' => [
67
'@bower' => '@vendor/bower-asset',
@@ -15,18 +16,21 @@
1516
'locale' => 'ru-RU',
1617
'thousandSeparator' => ' ',
1718
'decimalSeparator' => '.',
18-
'numberFormatterOptions' => [
19+
// must enable php intl extension for \NumberFormatter
20+
/*'numberFormatterOptions' => [
1921
\NumberFormatter::MIN_FRACTION_DIGITS => 0,
2022
\NumberFormatter::MAX_FRACTION_DIGITS => 0,
21-
]
23+
]*/
2224
],
2325
'cache' => [
24-
'class' => \yii\redis\Cache::class,
26+
'class' => yii\caching\DbCache::class,
27+
'cacheTable' => '{{%cache}}',
28+
/*'class' => \yii\redis\Cache::class,
2529
'redis' => [
2630
'hostname' => 'localhost',
2731
'port' => 6379,
2832
'database' => 0,
29-
]
33+
]*/
3034
],
3135
'log' => [
3236
'traceLevel' => YII_DEBUG ? 3 : 0,
@@ -41,7 +45,7 @@
4145
'class' => \yii\web\UrlManager::class,
4246
'enablePrettyUrl' => true,
4347
'showScriptName' => false,
44-
'hostInfo' => (require 'params.php')['frontendHost'],
48+
'hostInfo' => $hostinfo['frontendHost'],
4549
'rules' => require __DIR__.'/../../frontend/config/urls.php',
4650
],
4751
'i18n' => [

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"minimum-stability": "stable",
1212
"require": {
13-
"php": ">=7.0.0",
13+
"php": ">=5.6.0",
1414
"yiisoft/yii2": "~2.0.14",
1515
"yiisoft/yii2-bootstrap": "~2.0.0",
1616
"yiisoft/yii2-swiftmailer": "~2.0.0 || ~2.1.0",
@@ -20,7 +20,8 @@
2020
"yiisoft/yii2-queue": "^2.0",
2121
"himiklab/yii2-recaptcha-widget": "^1.2",
2222
"ignatenkovnikita/yii2-queuemanager": "dev-master",
23-
"yiisoft/yii2-jui": "^2.0"
23+
"yiisoft/yii2-jui": "^2.0",
24+
"schmunk42/yii2-giiant": "@dev"
2425
},
2526
"require-dev": {
2627
"yiisoft/yii2-debug": "~2.0.0",

0 commit comments

Comments
 (0)