Skip to content

Commit

Permalink
初始化
Browse files Browse the repository at this point in the history
  • Loading branch information
jianyan74 committed Sep 10, 2018
1 parent 1f7d392 commit 62bbe18
Show file tree
Hide file tree
Showing 1,506 changed files with 373,511 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory" : "vendor/bower-asset"
}
35 changes: 35 additions & 0 deletions .gitignore
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
32 changes: 32 additions & 0 deletions LICENSE.md
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.
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

> 目前为测试版本不建议用于生产环境
## 前言
### 前言

RageFrame项目创建于2016年4月16日,一个基于Yii2高级框架的快速开发引擎,目前正在成长中,目的是为了集成更多的基础功能,不在为相同的基础功能重复制造轮子,开箱即用,让开发变得更加简单。2.0版本在1.0的版本上面进行了重构,更好的面向开发者进行二次开发。

## 特色
### 特色

- 只做基础底层内容,RageFrame不会在上面开发过多的业务内容,满足绝大多数的系统底层开发。
- RBAC权限管理系统
Expand All @@ -19,9 +19,9 @@ RageFrame项目创建于2016年4月16日,一个基于Yii2高级框架的快速
- 整合了第三方支付,目前有微信支付、支付宝支付、银联支付。
- 整合了RESTful API,支持前后端分离接口开发和app接口开发,可直接上手开发业务。

## 思维导图
### 思维导图

## 开始之前
### 开始之前

- 具备 PHP 基础知识
- 具备 Yii2 基础开发知识
Expand All @@ -32,15 +32,11 @@ RageFrame项目创建于2016年4月16日,一个基于Yii2高级框架的快速
- 能查看日志和Debug技能
- 一定要仔细走一遍文档

## Demo
### 文档

http://demo.rageframe.com/backend
[项目文档说明地址](docs/guide-zh-CN/README.md)

账号:demo

密码:1234567

## 特别鸣谢
### 特别鸣谢

感谢以下的项目,排名不分先后

Expand All @@ -50,7 +46,7 @@ Bootstrap:http://getbootstrap.com

EasyWechat:https://easywechat.org/

## 版权信息
### 版权信息

RageFrame遵循Apache2开源协议发布,并提供免费使用。

Expand Down
77 changes: 77 additions & 0 deletions Vagrantfile
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 added addons/.gitignore
Empty file.
133 changes: 133 additions & 0 deletions addons/RfDemo/AddonConfig.php
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';
}

24 changes: 24 additions & 0 deletions addons/RfDemo/AddonMessage.php
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());
}
}
21 changes: 21 additions & 0 deletions addons/RfDemo/api/controllers/IndexController.php
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';
}
}

1 change: 1 addition & 0 deletions addons/RfDemo/assets/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
Loading

0 comments on commit 62bbe18

Please sign in to comment.