forked from jianyan74/rageframe2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jianyan74
committed
Sep 10, 2018
1 parent
1f7d392
commit 62bbe18
Showing
1,506 changed files
with
373,511 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"directory" : "vendor/bower-asset" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# yii console commands | ||
/yii | ||
/yii_test | ||
/yii_test.bat | ||
|
||
# phpstorm project files | ||
.idea | ||
|
||
# netbeans project files | ||
nbproject | ||
|
||
# zend studio for eclipse project files | ||
.buildpath | ||
.project | ||
.settings | ||
|
||
# windows thumbnail cache | ||
Thumbs.db | ||
|
||
# composer vendor dir | ||
# /vendor | ||
|
||
# composer itself is not needed | ||
# composer.phar | ||
|
||
# Mac DS_Store Files | ||
.DS_Store | ||
|
||
# phpunit itself is not needed | ||
phpunit.phar | ||
# local phpunit config | ||
/phpunit.xml | ||
|
||
# vagrant runtime | ||
/.vagrant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
The Yii framework is free software. It is released under the terms of | ||
the following BSD License. | ||
|
||
Copyright © 2008 by Yii Software LLC (http://www.yiisoft.com) | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions | ||
are met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in | ||
the documentation and/or other materials provided with the | ||
distribution. | ||
* Neither the name of Yii Software LLC nor the names of its | ||
contributors may be used to endorse or promote products derived | ||
from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
require 'yaml' | ||
require 'fileutils' | ||
|
||
required_plugins = %w( vagrant-hostmanager vagrant-vbguest ) | ||
required_plugins.each do |plugin| | ||
exec "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin | ||
end | ||
|
||
domains = { | ||
frontend: 'y2aa-frontend.test', | ||
backend: 'y2aa-backend.test' | ||
} | ||
|
||
config = { | ||
local: './vagrant/config/vagrant-local.yml', | ||
example: './vagrant/config/vagrant-local.example.yml' | ||
} | ||
|
||
# copy config from example if local config not exists | ||
FileUtils.cp config[:example], config[:local] unless File.exist?(config[:local]) | ||
# read config | ||
options = YAML.load_file config[:local] | ||
|
||
# check github token | ||
if options['github_token'].nil? || options['github_token'].to_s.length != 40 | ||
puts "You must place REAL GitHub token into configuration:\n/yii2-app-advanced/vagrant/config/vagrant-local.yml" | ||
exit | ||
end | ||
|
||
# vagrant configurate | ||
Vagrant.configure(2) do |config| | ||
# select the box | ||
config.vm.box = 'bento/ubuntu-16.04' | ||
|
||
# should we ask about box updates? | ||
config.vm.box_check_update = options['box_check_update'] | ||
|
||
config.vm.provider 'virtualbox' do |vb| | ||
# machine cpus count | ||
vb.cpus = options['cpus'] | ||
# machine memory size | ||
vb.memory = options['memory'] | ||
# machine name (for VirtualBox UI) | ||
vb.name = options['machine_name'] | ||
end | ||
|
||
# machine name (for vagrant console) | ||
config.vm.define options['machine_name'] | ||
|
||
# machine name (for guest machine console) | ||
config.vm.hostname = options['machine_name'] | ||
|
||
# network settings | ||
config.vm.network 'private_network', ip: options['ip'] | ||
|
||
# sync: folder 'yii2-app-advanced' (host machine) -> folder '/app' (guest machine) | ||
config.vm.synced_folder './', '/app', owner: 'vagrant', group: 'vagrant' | ||
|
||
# disable folder '/vagrant' (guest machine) | ||
config.vm.synced_folder '.', '/vagrant', disabled: true | ||
|
||
# hosts settings (host machine) | ||
config.vm.provision :hostmanager | ||
config.hostmanager.enabled = true | ||
config.hostmanager.manage_host = true | ||
config.hostmanager.ignore_private_ip = false | ||
config.hostmanager.include_offline = true | ||
config.hostmanager.aliases = domains.values | ||
|
||
# provisioners | ||
config.vm.provision 'shell', path: './vagrant/provision/once-as-root.sh', args: [options['timezone']] | ||
config.vm.provision 'shell', path: './vagrant/provision/once-as-vagrant.sh', args: [options['github_token']], privileged: false | ||
config.vm.provision 'shell', path: './vagrant/provision/always-as-root.sh', run: 'always' | ||
|
||
# post-install message (vagrant console) | ||
config.vm.post_up_message = "Frontend URL: http://#{domains[:frontend]}\nBackend URL: http://#{domains[:backend]}" | ||
end |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
<?php | ||
namespace addons\RfDemo; | ||
|
||
/** | ||
* Class Addon | ||
* @package addons\RfDemo | ||
*/ | ||
class AddonConfig | ||
{ | ||
/** | ||
* 配置信息 | ||
* | ||
* @var array | ||
*/ | ||
public $info = [ | ||
'name' => 'RfDemo', | ||
'title' => 'Demo管理', | ||
'brief_introduction' => 'demo的功能示例', | ||
'description' => '基础demo,可直接拷贝使用', | ||
'author' => '简言', | ||
'version' => '1.0.0', | ||
]; | ||
|
||
/** | ||
* 参数配置 | ||
* | ||
* @var bool | ||
*/ | ||
public $isSetting = true; | ||
|
||
/** | ||
* 钩子 | ||
* | ||
* @var bool | ||
*/ | ||
public $isHook = true; | ||
|
||
/** | ||
* 小程序 | ||
* | ||
* @var bool | ||
*/ | ||
public $isMiniProgram = true; | ||
|
||
/** | ||
* 规则管理 | ||
* | ||
* @var bool | ||
*/ | ||
public $isRule = true; | ||
|
||
/** | ||
* 类别 | ||
* | ||
* @var string | ||
* [ | ||
* 'plug' => "功能插件", | ||
* 'business' => "主要业务", | ||
* 'customer' => "客户关系", | ||
* 'activity' => "营销及活动", | ||
* 'services' => "常用服务及工具", | ||
* 'biz' => "行业解决方案", | ||
* 'h5game' => "H5游戏", | ||
* 'other' => "其他", | ||
* ] | ||
*/ | ||
public $group = 'plug'; | ||
|
||
/** | ||
* 微信接收消息类别 | ||
* | ||
* @var array | ||
* 例如 : ['image','voice','video','shortvideo'] | ||
*/ | ||
public $wechatMessage = ['image','voice','video','shortvideo']; | ||
|
||
/** | ||
* 后台菜单 | ||
* | ||
* 例如 | ||
* public $menu = [ | ||
* [ | ||
* 'title' => '基本表格', | ||
* 'route' => 'curd-base/index', | ||
* 'icon' => '' | ||
* ] | ||
* ] | ||
* @var array | ||
*/ | ||
public $menu = [ | ||
[ | ||
'title' => 'Curd', | ||
'route' => 'curd/index', | ||
'icon' => '' | ||
], | ||
]; | ||
|
||
/** | ||
* 同menu上 | ||
* | ||
* @var array | ||
*/ | ||
public $cover = [ | ||
[ | ||
'title' => '首页导航', | ||
'route' => 'index/index', | ||
], | ||
]; | ||
|
||
/** | ||
* 保存在当前模块的根目录下面 | ||
* | ||
* 例如 public $install = 'install.php'; | ||
* 安装SQL,只支持php文件 | ||
* @var string | ||
*/ | ||
public $install = 'install.php'; | ||
|
||
/** | ||
* 卸载SQL | ||
* | ||
* @var string | ||
*/ | ||
public $uninstall = 'uninstall.php'; | ||
|
||
/** | ||
* 更新SQL | ||
* | ||
* @var string | ||
*/ | ||
public $upgrade = 'upgrade.php'; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
namespace addons\RfDemo; | ||
|
||
use Yii; | ||
use backend\interfaces\WechatMessageInterface; | ||
|
||
/** | ||
* AddonMessage | ||
* | ||
* Class AddonMessage | ||
* @package addons\RfDemo | ||
*/ | ||
class AddonMessage implements WechatMessageInterface | ||
{ | ||
/** | ||
* @param $message | ||
* @return string | ||
* @throws \yii\base\InvalidConfigException | ||
*/ | ||
public function run($message) | ||
{ | ||
return '示例模块' . Yii::$app->formatter->asDatetime(time()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
namespace addons\RfDemo\api\controllers; | ||
|
||
use Yii; | ||
use common\controllers\AddonsBaseController; | ||
|
||
/** | ||
* Class IndexController | ||
* @package addons\RfDemo\api\controllers | ||
*/ | ||
class IndexController extends AddonsBaseController | ||
{ | ||
/** | ||
* 首页 | ||
*/ | ||
public function actionIndex() | ||
{ | ||
return Yii::$app->params['addonInfo']['name'] . ' api demo'; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* |
Oops, something went wrong.