CodeIgniter icon indicating copy to clipboard operation
CodeIgniter copied to clipboard

contoller repeat 2times 默认控制器重复执行

Open apsana opened this issue 11 years ago • 12 comments

$route['default_controller'] = "login"; class Login extends CI_Controller {

public function  index()
{ error_log('X',3,'aa.txt');

显示xx,默认控制器。

apsana avatar Jul 19 '14 09:07 apsana

请求的URL是什么?

hex-ci avatar Aug 01 '14 09:08 hex-ci

默认控制器 login 请求URL login/ ;login/index

------------------ 原始邮件 ------------------ 发件人: "Hex";[email protected]; 发送时间: 2014年8月1日(星期五) 下午5:32 收件人: "CodeIgniter-Chinese/CodeIgniter"[email protected]; 抄送: "ygana男孩"[email protected]; 主题: Re: [CodeIgniter] contoller repeat 2times 默认控制器重复执行 (#20)

请求的URL是什么?

— Reply to this email directly or view it on GitHub.

apsana avatar Aug 04 '14 02:08 apsana

那你使用的 CI 版本是?

hex-ci avatar Aug 04 '14 02:08 hex-ci

define('CI_VERSION', '2.2.0');

------------------ 原始邮件 ------------------ 发件人: "Hex"[email protected]; 发送时间: 2014年8月4日(星期一) 上午10:12 收件人: "CodeIgniter-Chinese/CodeIgniter"[email protected]; 抄送: "ygana男孩"[email protected]; 主题: Re: [CodeIgniter] contoller repeat 2times 默认控制器重复执行 (#20)

那你是用的 CI 版本是?

— Reply to this email directly or view it on GitHub.

apsana avatar Aug 04 '14 02:08 apsana

我试了下,没有执行两次,如果你刷新两次浏览器,是会变成XX的,因为 error_log 是追加不是覆盖文件。

hex-ci avatar Aug 04 '14 02:08 hex-ci

就是 我的一直这样,我不是刷新刘爱兰器的,我试了n次

------------------ 原始邮件 ------------------ 发件人: "Hex"[email protected]; 发送时间: 2014年8月4日(星期一) 上午10:25 收件人: "CodeIgniter-Chinese/CodeIgniter"[email protected]; 抄送: "ygana男孩"[email protected]; 主题: Re: [CodeIgniter] contoller repeat 2times 默认控制器重复执行 (#20)

我试了下,没有执行两次,如果你刷新两次浏览器,是会变成XX的,因为 error_log 是追加不是覆盖文件。

— Reply to this email directly or view it on GitHub.

apsana avatar Aug 04 '14 02:08 apsana

那应该是你的其他地方有问题,我这里实测 2.2.0 版本,没有任何异常,另外这种明显BUG也不应该出现在 CI 上。。。。毕竟也是世界级框架了。。。。 你可以把完整的代码发上来,或者说一下你的 PHP 版本什么的信息,CI 不支持 PHP 5.4

hex-ci avatar Aug 04 '14 02:08 hex-ci

php 5.5.12

------------------ 原始邮件 ------------------ 发件人: "Hex"[email protected]; 发送时间: 2014年8月4日(星期一) 上午10:31 收件人: "CodeIgniter-Chinese/CodeIgniter"[email protected]; 抄送: "ygana男孩"[email protected]; 主题: Re: [CodeIgniter] contoller repeat 2times 默认控制器重复执行 (#20)

那应该是你的其他地方有问题,我这里实测 2.2.0 版本,没有任何异常,另外这种明显BUG也不应该出现在 CI 上。。。。毕竟也是世界级框架了。。。。 你可以把完整的代码发上来,或者说一下你的 PHP 版本什么的信息,CI 不支持 PHP 5.4

— Reply to this email directly or view it on GitHub.

apsana avatar Aug 04 '14 02:08 apsana

CI 不支持 PHP 5.5,请使用 PHP 5.3 或 PHP 5.2

hex-ci avatar Aug 04 '14 02:08 hex-ci

恩,好的 ,我待会吧代码提交给你看看,我也觉得好奇怪

------------------ 原始邮件 ------------------ 发件人: "Hex"[email protected]; 发送时间: 2014年8月4日(星期一) 上午10:34 收件人: "CodeIgniter-Chinese/CodeIgniter"[email protected]; 抄送: "ygana男孩"[email protected]; 主题: Re: [CodeIgniter] contoller repeat 2times 默认控制器重复执行 (#20)

那你的PHP没有问题,你这个确实比较奇怪,建议你把代码打包发上来。 你这个原则上是你的服务器的问题。因为我这里无法重现你的问题。

— Reply to this email directly or view it on GitHub.

apsana avatar Aug 04 '14 02:08 apsana

刚才我看错了,正确的应该是 CI 不支持 PHP 5.5,不用尝试了。

hex-ci avatar Aug 04 '14 02:08 hex-ci

恩 好的,谢谢 。

------------------ 原始邮件 ------------------ 发件人: "Hex";[email protected]; 发送时间: 2014年8月4日(星期一) 上午10:34 收件人: "CodeIgniter-Chinese/CodeIgniter"[email protected]; 抄送: "ygana男孩"[email protected]; 主题: Re: [CodeIgniter] contoller repeat 2times 默认控制器重复执行 (#20)

CI 不支持 PHP 5.5,请使用 PHP 5.3 或 PHP 5.2

— Reply to this email directly or view it on GitHub.

apsana avatar Aug 04 '14 02:08 apsana