作者:ik人生如梦场 | 来源:互联网 | 2018-07-15 21:33
下面我们一起来看一篇关于SAE 上安装 Wecenter 错误问题处理例子,希望这篇文章能够帮助到各位朋友。
今天其实想搭建个社区,专门为 Zephir/Phalcon/Yaf/Docker/Swoole 建设一个社区, 专门为 C 语言的PHP框架和 C 语言扩展做一个,刚开始挺高兴的,直接用 wecenter 搭建多好,而且官网说支持 SAE,我就信心满满的去了,结果不行,坑爹呀,新浪那么大字,mysql 不支持 host:port 没看吗? 稍微修改一下就可以了。
0x01
修改 system\Zend\Db\Adapter\Mysqli.php ,搜索找到 // Suppress connection warnings here. ,然后在上边加入以下代码:
代码如下 |
|
//修复SAE上连接错误 BUG add by widuu 2015/4/23
if (defined('IN_SAE')){
$host = $this->_config['host'];
$this->_config['host'] = strstr($host,':',true);
$port = trim(strstr($host,':'),':');
}
// end by widuu
|
修改 system\Zend\Db\Adapter\Pdo\Abstract.php,搜索一下代码:
代码如下 |
|
return $this->_pdoType . ':' . implode(';', $dsn);
|
然后替换成如下这样:
代码如下 |
|
//修复SAE上连接错误 BUG add by widuu 2015/4/23
if (defined('IN_SAE')){
$host = $dsn['host'];
$dsn['host'] = strstr($host,':',true);
$dsn['port'] = 'port='.trim(strstr($host,':'),':');
}
// end by widuu
return $this->_pdoType . ':' . implode(';', $dsn);
0x02
|
伪静态不管用,大哥你知道吗,最好看看官方的 API,然后伪静态变成如下就可以了:
name: 你的应用名称
version: 你的版本
handle:
代码如下 |
|
- rewrite: if (!-d && !-f) goto "/index.php?%{QUERY_STRING}"
|
好就到这里,明天预告,更新 Phalcon 的东西,我也想更新 YAF 的知识,当然一个一个慢慢来。然后是 Zephir。