[2012/4/25] SAE平台迁移 yii-sae正式版。基于Yii framework 1.1.10

[color="#8B0000"]使用方法[/color]


/framework为框架目录。 使用上与原生yii一样。

如果未接触过YII,创建应用请参考:http://www.yiiframework.com/doc/guide/1.1/zh_cn/quickstart.installation

原有项目迁移到SAE上,只需要将 /framework 覆盖原来的 framework目录。

yiisae框架会根据是否定义 SAE_TMP_PATH,来判断是否启用sae的一些设置。

/demos 是YII官方自带的几个实例。

/requirements 是Yii配置需求检查

/bootstrap index.html docs.css 为 介绍页面

Version 1.1.10 2012年3月1日


  • 1.整理了framework/sae目录的结构

  • 2.数据库读写分离. 并且在SAE平台强制使用SAE提供的mysql用户名和密码

  • 3.固定使用memcache. 使用缓存,能有效提高yii的加载速度.

  • 4.固定了一个url rule. 通过assetManager发布的文件,都会通过 index.php/_assets/xxxxx 访问.

  • 5.配置变少很多. 相对自由性就弱啦.╮(╯_╰)╭

SAE url重写示例


name: yiidemo

version: 2

URL重写

handle:

  • rewrite: if(!is_dir() && !is_file() && path ~ "/demos/blog/") goto "/demos/blog/index.php?%{QUERY_STRING}"

  • rewrite: if(!is_dir() && !is_file() && path ~ "/demos/hangman/") goto "/demos/hangman/index.php?%{QUERY_STRING}"

  • rewrite: if(!is_dir() && !is_file() && path ~ "/demos/helloworld/") goto "/demos/helloworld/index.php?%{QUERY_STRING}"

  • rewrite: if(!is_dir() && !is_file() && path ~ "/demos/phonebook/") goto "/demos/phonebook/index.php?%{QUERY_STRING}"

  • expire: if(path ~ ".js$") time 8640000

  • expire: if(path ~ ".css$") time 8640000

  • compress: if(out_header["Content-Type"] == "text/html") compress

[color="#8B0000"]DEMO地址:[/color] 官方实例

遇到问题,可以先查看文档,再在google上搜索是否已经有相同问题的解决方案。

如果YIISAE在SAE平台上遇到bug,可以联系我~

看上去 不错

我已经写了简单的文档:

http://haotushu.sinaapp.com/sort/yiisae

还做了一个小应用:

http://wg580.sinaapp.com/

这个要顶 不错 应用做的 速度也可以 :lol: