postor/yii2-for-sae
最新稳定版本:0.0.5
Composer 安装命令:
composer require postor/yii2-for-sae
包简介
The adapt for Yii2 framework to run on sina app engine.
README 文档
README
This is using saestorage for asset publishing.使用saestorage实现资源发布功能
Installation安装步骤:
The preferred way to install this extension is through composer.推荐使用composer
Either run命令行输入并运行
php composer.phar require "postor/yii2-for-sae" "*"
or add或者在配置文件composer.json中添加
"postor/yii2-for-sae": "*"
to the require section of your composer.json file.
Usage使用方法:
1.create a saestorage domain named 'assets' in SAE admin, this can be another name but need to be configed as assetDomain.
在sae后台开启storage,并建立一个domain叫做‘assets’,如果使用别的名字需要在配置中使用assetDomain来配置
2.config 配置
// config/web.php // change all file operations to db or seastorage or kvdb //修改所有文件操作到数据库,或者saestorage或者kvdb ... 'components' => [ //cache to db缓存到db 'cache' => [ 'class' => 'yii\caching\DbCache', ], //sea mysql配置sae的mysql 'db' => [ 'class' => 'yii\db\Connection', 'dsn' => 'mysql:host='.SAE_MYSQL_HOST_M.';port='.SAE_MYSQL_PORT.';dbname='.SAE_MYSQL_DB, 'username' => SAE_MYSQL_USER, 'password' => SAE_MYSQL_PASS, 'charset' => 'utf8', 'tablePrefix' => 'scd_', ], //use seastorage for assets使用sae发布资源 'assetManager' =>[ 'class'=>'postor\sae\SaeAssetManager', 'assetDomain'=>'assets', 'converter' => [ 'class' => 'yii\web\AssetConverter', ], ], //log to db日志也修改到db 'log' => [ 'traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [ [ 'class' => 'yii\log\DbTarget', 'levels' => ['error', 'warning'], ], ], ], ]
统计信息
- 总下载量: 173
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 28
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2015-05-27