Codeigniter 3控制器请求两次

时间:2015-09-17 12:38:36

标签: php codeigniter codeigniter-3

我使用codeigniter 3为应用程序制作web服务。随机结果是一个致命的错误:

Severity: Core Warning --> Module 'tidy' already loaded Unknown 0

从我在日志中看到的内容看起来是两次请求。

INFO - 2015-09-17 15:20:25 --> Config Class Initialized
INFO - 2015-09-17 15:20:25 --> Hooks Class Initialized
DEBUG - 2015-09-17 15:20:25 --> UTF-8 Support Enabled
INFO - 2015-09-17 15:20:25 --> Utf8 Class Initialized
INFO - 2015-09-17 15:20:25 --> URI Class Initialized
INFO - 2015-09-17 15:20:25 --> Router Class Initialized
INFO - 2015-09-17 15:20:25 --> Output Class Initialized
INFO - 2015-09-17 15:20:25 --> Security Class Initialized
DEBUG - 2015-09-17 15:20:25 --> Global POST, GET and COOKIE data sanitized
INFO - 2015-09-17 15:20:25 --> Input Class Initialized
INFO - 2015-09-17 15:20:25 --> Language Class Initialized
DEBUG - 2015-09-17 15:20:25 --> START API CALL
INFO - 2015-09-17 15:20:25 --> Loader Class Initialized
DEBUG - 2015-09-17 15:20:25 --> Config file loaded: /application/config/site.php
INFO - 2015-09-17 15:20:25 --> Helper loaded: url_helper
INFO - 2015-09-17 15:20:25 --> Helper loaded: form_helper
INFO - 2015-09-17 15:20:25 --> Helper loaded: ai_helper
INFO - 2015-09-17 15:20:25 --> Helper loaded: security_helper
INFO - 2015-09-17 15:20:25 --> Helper loaded: language_helper
INFO - 2015-09-17 15:20:25 --> Language file loaded: language/english/admin_lang.php
DEBUG - 2015-09-17 15:20:25 --> Config file loaded: /application/config/ion_auth.php
INFO - 2015-09-17 15:20:25 --> Email Class Initialized
INFO - 2015-09-17 15:20:25 --> Language file loaded: language/english/ion_auth_lang.php
INFO - 2015-09-17 15:20:25 --> Helper loaded: cookie_helper
INFO - 2015-09-17 15:20:25 --> Session: Class initialized using 'files' driver.
INFO - 2015-09-17 15:20:25 --> Model Class Initialized
INFO - 2015-09-17 15:20:25 --> Model Class Initialized
INFO - 2015-09-17 15:20:25 --> Database Driver Class Initialized
INFO - 2015-09-17 15:20:25 --> Helper loaded: date_helper
INFO - 2015-09-17 15:20:25 --> Form Validation Class Initialized
INFO - 2015-09-17 15:20:25 --> Controller Class Initialized
INFO - 2015-09-17 15:20:25 --> Language file loaded: language/english/form_validation_lang.php
INFO - 2015-09-17 15:20:25 --> Model Class Initialized
INFO - 2015-09-17 15:20:25 --> Model Class Initialized
INFO - 2015-09-17 15:20:25 --> Final output sent to browser
DEBUG - 2015-09-17 15:20:25 --> Total execution time: 0.0221
DEBUG - 2015-09-17 15:20:25 --> END API
ERROR - 2015-09-17 15:20:25 --> Severity: Core Warning --> Module 'tidy' already loaded Unknown 0
INFO - 2015-09-17 15:20:25 --> Config Class Initialized
INFO - 2015-09-17 15:20:25 --> Hooks Class Initialized
DEBUG - 2015-09-17 15:20:25 --> UTF-8 Support Enabled
INFO - 2015-09-17 15:20:25 --> Utf8 Class Initialized
INFO - 2015-09-17 15:20:25 --> URI Class Initialized
INFO - 2015-09-17 15:20:25 --> Router Class Initialized
INFO - 2015-09-17 15:20:25 --> Output Class Initialized
INFO - 2015-09-17 15:20:25 --> Security Class Initialized
DEBUG - 2015-09-17 15:20:25 --> Global POST, GET and COOKIE data sanitized
INFO - 2015-09-17 15:20:25 --> Input Class Initialized
INFO - 2015-09-17 15:20:25 --> Language Class Initialized
DEBUG - 2015-09-17 15:20:25 --> START API CALL
INFO - 2015-09-17 15:20:25 --> Loader Class Initialized
DEBUG - 2015-09-17 15:20:25 --> Config file loaded: /application/config/site.php
INFO - 2015-09-17 15:20:25 --> Helper loaded: url_helper
INFO - 2015-09-17 15:20:25 --> Helper loaded: form_helper
INFO - 2015-09-17 15:20:25 --> Helper loaded: ai_helper
INFO - 2015-09-17 15:20:25 --> Helper loaded: security_helper
INFO - 2015-09-17 15:20:25 --> Helper loaded: language_helper
INFO - 2015-09-17 15:20:25 --> Language file loaded: language/english/admin_lang.php
DEBUG - 2015-09-17 15:20:25 --> Config file loaded: /application/config/ion_auth.php
INFO - 2015-09-17 15:20:25 --> Email Class Initialized
INFO - 2015-09-17 15:20:25 --> Language file loaded: language/english/ion_auth_lang.php
INFO - 2015-09-17 15:20:25 --> Helper loaded: cookie_helper
INFO - 2015-09-17 15:20:25 --> Session: Class initialized using 'files' driver.
INFO - 2015-09-17 15:20:25 --> Model Class Initialized
INFO - 2015-09-17 15:20:25 --> Model Class Initialized
INFO - 2015-09-17 15:20:25 --> Database Driver Class Initialized
INFO - 2015-09-17 15:20:25 --> Helper loaded: date_helper
INFO - 2015-09-17 15:20:25 --> Form Validation Class Initialized
INFO - 2015-09-17 15:20:25 --> Controller Class Initialized
INFO - 2015-09-17 15:20:25 --> Language file loaded: language/english/form_validation_lang.php
INFO - 2015-09-17 15:20:25 --> Model Class Initialized
INFO - 2015-09-17 15:20:25 --> Model Class Initialized
INFO - 2015-09-17 15:20:25 --> Final output sent to browser
DEBUG - 2015-09-17 15:20:25 --> Total execution time: 0.0135
DEBUG - 2015-09-17 15:20:25 --> END API

START API CALL显示在控制器的构造函数中

END API显示在_return_output函数

$this->output->set_header("Pragma: no-cache");
$this->output->set_header("Cache-Control: no-store, no-cache");
$this->output->set_status_header(200);
$this->output->set_content_type('application/json')->set_output(json_encode($content));
$this->output->_display();
log_message('debug', 'END API');
exit(); 

知道如何防止控制器被请求两次吗?

由于

修改

Api电话:

http://domain.dev/api/v1/init
http://domain.dev/api/v1/get_articles

路线:

$route['api/v1/(:any)'] = '/api/api/$1';

0 个答案:

没有答案
相关问题