1. 解压缩Yii框架
2. 下载Yii for SAE
Download Yii for SAE看里面的README描述
1.下载官方对应的版本。
2.将本压缩包中的framework复制到yii的framework目录下。 上传到SAE平台。
3.在sae中开启memcache。
4.在sae中添加一个名为uploads的storage。
2.将本压缩包中的framework复制到yii的framework目录下。 上传到SAE平台。
3.在sae中开启memcache。
4.在sae中添加一个名为uploads的storage。
这样就可以写Hello World了
3. 重写index.php
根目录下的config.yml内容如下
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.