本帖最后由 jianghu52 于 2013-07-26 11:25:41 编辑

解决方案 »

  1.   

    我明白你的意思,因为默认的cakephp是要写app的tmp文件的,但是sae不支持写文件的,所以如果什么不改就移植的话,会出现问题。我移植了一个版本,将cake要写的文件都写在了Memcache里面了。因此可以跑通。
    我已经将代码上传到了github上了
    https://github.com/jianghu52/sae_cakephp_sample。这个包如果直接上传到sae上就可以打开home页面。但是问题就是。我没有办法实现跳转
    我在pagecontroller里写了一句跳转方法【$this->redirect(array('controller' => 'test', 'action' => 'index'));】。在sae上的表现形式是地址栏可以显示【http://**.sinaapp.com/test】。页面报错为【The requested URL /test was not found on this server.】。也就是说我写的controller没有被解析。不知道问题出在哪里。
      

  2.   

    研究了半天,终于搞明白一件事。就是我对sae本身的文件系统不够了解。
    给的原来的框架里面,只有sae_app_wizard.xml,而不存在config.yaml文件,因此,redirect的跳转依然是向app里的tmp包请求内容,不能成功。添加了config.yaml文件,在里面加这样两句handle:
      - rewrite:if (!is_file() && !is_dir() && path ~ "^app/webroot/(.*)") goto "app/webroot/index.php?url=$1&%{QUERY_STRING}"
      - rewrite:if (!is_file() && !is_dir() && path ~ "(.*)") goto "app/webroot/$1?%{QUERY_STRING}"就可以实现跳转了。