Skip to content

Commit fae5dd4

Browse files
author
tony
committed
导入项目
1 parent 9f35580 commit fae5dd4

14 files changed

+5562
-0
lines changed

.bowerrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory" : "vendor/bower-asset"
3+
}

.gitignore

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# 不要提交这个项目,开发环境才会用到
2+
/xappgii
3+
4+
/a.*
5+
# yii console commands
6+
/yii
7+
/yii.bat
8+
/yii_test
9+
/yii_test.bat
10+
11+
# phpstorm project files
12+
.idea
13+
14+
# netbeans project files
15+
nbproject
16+
17+
# zend studio for eclipse project files
18+
.buildpath
19+
.project
20+
.settings
21+
22+
# windows thumbnail cache
23+
Thumbs.db
24+
25+
# composer vendor dir
26+
#/vendor
27+
28+
# composer itself is not needed
29+
#composer.phar
30+
31+
# Mac DS_Store Files
32+
.DS_Store
33+
34+
# phpunit itself is not needed
35+
phpunit.phar
36+
# local phpunit config
37+
/phpunit.xml
38+
39+
# vagrant runtime
40+
/.vagrant
41+
42+
# ignore generated files
43+
/appback/web/index.php
44+
/appback/web/index-test.php
45+
/appback/web/robots.txt
46+
47+
/appmch/web/index.php
48+
/appmch/web/index-test.php
49+
/appmch/web/robots.txt
50+
51+
/appdemo/web/index.php
52+
/appdemo/web/index-test.php
53+
/appdemo/web/robots.txt
54+
55+
/appapi/web/index.php
56+
/appapi/web/index-test.php
57+
/appapi/web/robots.txt
58+
59+
/apprbapi/web/index.php
60+
/apprbapi/web/index-test.php
61+
/apprbapi/web/robots.txt
62+
63+
/appayapi/web/index.php
64+
/appayapi/web/index-test.php
65+
/appayapi/web/robots.txt

LICENSE.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Copyright © 2008 by Yii Software LLC (http://www.yiisoft.com)
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions
6+
are met:
7+
8+
* Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
* Redistributions in binary form must reproduce the above copyright
11+
notice, this list of conditions and the following disclaimer in
12+
the documentation and/or other materials provided with the
13+
distribution.
14+
* Neither the name of Yii Software LLC nor the names of its
15+
contributors may be used to endorse or promote products derived
16+
from this software without specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21+
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22+
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28+
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29+
POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<p align="center">
2+
<a href="https://github.com/yiisoft" target="_blank">
3+
<img src="https://avatars0.githubusercontent.com/u/993323" height="100px">
4+
</a>
5+
<h1 align="center">Yii 2 Advanced Project Template</h1>
6+
<br>
7+
</p>
8+
9+
Yii 2 Advanced Project Template is a skeleton [Yii 2](http://www.yiiframework.com/) application best for
10+
developing complex Web applications with multiple tiers.
11+
12+
The template includes three tiers: front end, back end, and console, each of which
13+
is a separate Yii application.
14+
15+
The template is designed to work in a team development environment. It supports
16+
deploying the application in different environments.
17+
18+
Documentation is at [docs/guide/README.md](docs/guide/README.md).
19+
20+
[![Latest Stable Version](https://img.shields.io/packagist/v/yiisoft/yii2-app-advanced.svg)](https://packagist.org/packages/yiisoft/yii2-app-advanced)
21+
[![Total Downloads](https://img.shields.io/packagist/dt/yiisoft/yii2-app-advanced.svg)](https://packagist.org/packages/yiisoft/yii2-app-advanced)
22+
[![Build Status](https://travis-ci.com/yiisoft/yii2-app-advanced.svg?branch=master)](https://travis-ci.com/yiisoft/yii2-app-advanced)
23+
24+
DIRECTORY STRUCTURE
25+
-------------------
26+
27+
```
28+
common
29+
config/ contains shared configurations
30+
mail/ contains view files for e-mails
31+
models/ contains model classes used in both appback and appfront
32+
tests/ contains tests for common classes
33+
console
34+
config/ contains console configurations
35+
controllers/ contains console controllers (commands)
36+
migrations/ contains database migrations
37+
models/ contains console-specific model classes
38+
runtime/ contains files generated during runtime
39+
appback
40+
assets/ contains application assets such as JavaScript and CSS
41+
config/ contains appback configurations
42+
controllers/ contains Web controller classes
43+
models/ contains appback-specific model classes
44+
runtime/ contains files generated during runtime
45+
tests/ contains tests for appback application
46+
views/ contains view files for the Web application
47+
web/ contains the entry script and Web resources
48+
appfront
49+
assets/ contains application assets such as JavaScript and CSS
50+
config/ contains appfront configurations
51+
controllers/ contains Web controller classes
52+
models/ contains appfront-specific model classes
53+
runtime/ contains files generated during runtime
54+
tests/ contains tests for appfront application
55+
views/ contains view files for the Web application
56+
web/ contains the entry script and Web resources
57+
widgets/ contains appfront widgets
58+
vendor/ contains dependent 3rd-party packages
59+
environments/ contains environment-based overrides
60+
```

Vagrantfile

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
require 'yaml'
2+
require 'fileutils'
3+
4+
required_plugins = %w( vagrant-hostmanager vagrant-vbguest )
5+
required_plugins.each do |plugin|
6+
exec "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin
7+
end
8+
9+
domains = {
10+
frontend: 'y2aa-frontend.test',
11+
backend: 'y2aa-backend.test'
12+
}
13+
14+
config = {
15+
local: './vagrant/config/vagrant-local.yml',
16+
example: './vagrant/config/vagrant-local.example.yml'
17+
}
18+
19+
# copy config from example if local config not exists
20+
FileUtils.cp config[:example], config[:local] unless File.exist?(config[:local])
21+
# read config
22+
options = YAML.load_file config[:local]
23+
24+
# check github token
25+
if options['github_token'].nil? || options['github_token'].to_s.length != 40
26+
puts "You must place REAL GitHub token into configuration:\n/yii2-app-advanced/vagrant/config/vagrant-local.yml"
27+
exit
28+
end
29+
30+
# vagrant configurate
31+
Vagrant.configure(2) do |config|
32+
# select the box
33+
config.vm.box = 'bento/ubuntu-16.04'
34+
35+
# should we ask about box updates?
36+
config.vm.box_check_update = options['box_check_update']
37+
38+
config.vm.provider 'virtualbox' do |vb|
39+
# machine cpus count
40+
vb.cpus = options['cpus']
41+
# machine memory size
42+
vb.memory = options['memory']
43+
# machine name (for VirtualBox UI)
44+
vb.name = options['machine_name']
45+
end
46+
47+
# machine name (for vagrant console)
48+
config.vm.define options['machine_name']
49+
50+
# machine name (for guest machine console)
51+
config.vm.hostname = options['machine_name']
52+
53+
# network settings
54+
config.vm.network 'private_network', ip: options['ip']
55+
56+
# sync: folder 'yii2-app-advanced' (host machine) -> folder '/app' (guest machine)
57+
config.vm.synced_folder './', '/app', owner: 'vagrant', group: 'vagrant'
58+
59+
# disable folder '/vagrant' (guest machine)
60+
config.vm.synced_folder '.', '/vagrant', disabled: true
61+
62+
# hosts settings (host machine)
63+
config.vm.provision :hostmanager
64+
config.hostmanager.enabled = true
65+
config.hostmanager.manage_host = true
66+
config.hostmanager.ignore_private_ip = false
67+
config.hostmanager.include_offline = true
68+
config.hostmanager.aliases = domains.values
69+
70+
# provisioners
71+
config.vm.provision 'shell', path: './vagrant/provision/once-as-root.sh', args: [options['timezone']]
72+
config.vm.provision 'shell', path: './vagrant/provision/once-as-vagrant.sh', args: [options['github_token']], privileged: false
73+
config.vm.provision 'shell', path: './vagrant/provision/always-as-root.sh', run: 'always'
74+
75+
# post-install message (vagrant console)
76+
config.vm.post_up_message = "Frontend URL: http://#{domains[:frontend]}\nBackend URL: http://#{domains[:backend]}"
77+
end

codeception.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# global codeception file to run tests from all apps
2+
include:
3+
- common
4+
- frontend
5+
- backend
6+
paths:
7+
log: console/runtime/logs
8+
settings:
9+
colors: true

composer.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"name": "yiisoft/yii2-app-advanced",
3+
"description": "Yii 2 Advanced Project Template",
4+
"keywords": [
5+
"yii2",
6+
"framework",
7+
"advanced",
8+
"project template"
9+
],
10+
"homepage": "http://www.yiiframework.com/",
11+
"type": "project",
12+
"license": "BSD-3-Clause",
13+
"support": {
14+
"issues": "https://github.com/yiisoft/yii2/issues?state=open",
15+
"forum": "http://www.yiiframework.com/forum/",
16+
"wiki": "http://www.yiiframework.com/wiki/",
17+
"irc": "irc://irc.freenode.net/yii",
18+
"source": "https://github.com/yiisoft/yii2"
19+
},
20+
"minimum-stability": "stable",
21+
"require": {
22+
"php": ">=5.6.0",
23+
"yiisoft/yii2": "~2.0.14",
24+
"yiisoft/yii2-bootstrap": "~2.0.0",
25+
"yiisoft/yii2-swiftmailer": "~2.0.0 || ~2.1.0",
26+
"linslin/yii2-curl": "dev-master",
27+
"yiisoft/yii2-redis": "^2.0",
28+
"phpgangsta/googleauthenticator": "dev-master"
29+
},
30+
"require-dev": {
31+
"yiisoft/yii2-debug": "~2.1.0",
32+
"yiisoft/yii2-gii": "~2.1.0",
33+
"yiisoft/yii2-faker": "~2.0.0",
34+
"codeception/codeception": "^4.0",
35+
"codeception/module-asserts": "^1.0",
36+
"codeception/module-yii2": "^1.0",
37+
"codeception/module-filesystem": "^1.0",
38+
"codeception/verify": "~0.5.0 || ~1.1.0",
39+
"symfony/browser-kit": ">=2.7 <=4.2.4"
40+
},
41+
"config": {
42+
"process-timeout": 1800,
43+
"fxp-asset": {
44+
"enabled": false
45+
}
46+
},
47+
"repositories": {
48+
"packagist": {
49+
"type": "composer",
50+
"url": "https://mirrors.aliyun.com/composer/"
51+
},
52+
"0": {
53+
"type": "composer",
54+
"url": "https://asset-packagist.org"
55+
}
56+
}
57+
}

0 commit comments

Comments
 (0)