Инициализировано Yii2 приложение, выпилены лишние части, накинуты чуточку нужных

This commit is contained in:
ErickSkrauch
2016-01-02 16:43:18 +03:00
commit 841303b8ab
134 changed files with 3394 additions and 0 deletions

2
console/config/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
main-local.php
params-local.php

View File

@@ -0,0 +1 @@
<?php

25
console/config/main.php Normal file
View File

@@ -0,0 +1,25 @@
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
return [
'id' => 'app-console',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'controllerNamespace' => 'console\controllers',
'components' => [
'log' => [
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
],
'params' => $params,
];

View File

@@ -0,0 +1,4 @@
<?php
return [
'adminEmail' => 'admin@example.com',
];

View File

View File

@@ -0,0 +1,34 @@
<?php
use yii\db\Schema;
use yii\db\Migration;
class m130524_201442_init extends Migration
{
public function up()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
}
$this->createTable('{{%user}}', [
'id' => $this->primaryKey(),
'username' => $this->string()->notNull()->unique(),
'auth_key' => $this->string(32)->notNull(),
'password_hash' => $this->string()->notNull(),
'password_reset_token' => $this->string()->unique(),
'email' => $this->string()->notNull()->unique(),
'status' => $this->smallInteger()->notNull()->defaultValue(10),
'created_at' => $this->integer()->notNull(),
'updated_at' => $this->integer()->notNull(),
], $tableOptions);
}
public function down()
{
$this->dropTable('{{%user}}');
}
}

1
console/models/.gitkeep Normal file
View File

@@ -0,0 +1 @@
*

2
console/runtime/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore