在SAE上使用Yii框架

1. 解压缩Yii框架

 

2. 下载Yii for SAE

  Download Yii for SAE看里面的README描述

1.下载官方对应的版本。
2.将本压缩包中的framework复制到yii的framework目录下。 上传到SAE平台。
3.在sae中开启memcache。
4.在sae中添加一个名为uploads的storage。
这样就可以写Hello World了
3. 重写index.php
 根目录下的config.yml内容如下
name: bellinirestaurant
version: 1
handle:
- rewrite: if( !is_file() && !is_dir()) goto "index.php?%{QUERY_STRING}"
 4. 使用SAEDisk类上传文件
5. 发送EMAIL使用SaeMailer
6. Ajax存储数据时提示:
SAE_DEBUG: 
2013/04/21 10:46:58 [warning] [application] Failed to set unsafe attribute "background_id" of "Background". in /data1/www/htdocs/596/bellinirestaurant/1/protected/controllers/ajax/BackgroundController.php (29) in /data1/www/htdocs/596/bellinirestaurant/1/index.php (14) 
2013/04/21 10:46:58 [warning] [application] Failed to set unsafe attribute "filename" of "Background". in /data1/www/htdocs/596/bellinirestaurant/1/protected/controllers/ajax/BackgroundController.php (29) in /data1/www/htdocs/596/bellinirestaurant/1/index.php (14) in yii/framework/sae/logging/CFileLogRoute.php on line 145
 原因是:$model->attributes直接赋值导致的,要么不要设置attributes属性,要么设置model类属性为safe.
 
 
 
 
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值