Welcome Guest, Not a member yet? Register   Sign In
Error: Call to undefined method CI_Input::CI_Input
#1

[eluser]Unknown[/eluser]
Hi all wonderful CI people! Smile

I have just upgraded from 1.7.. to 2.0.2 and are moving my old code to the new structure.
I have MY_input witch is modifying header information and I have moved to the core dir.
Can anyone help me figuring out why I get an error?
See below for details.

The error:
Fatal error: Call to undefined method CI_Input::CI_Input() in /xxxx/www/application/core/MY_Input.php on line 7

The code for MY_input:
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class MY_Input extends CI_Input {

    var $_headers = false;

    function MY_Input() {
        parent::CI_Input();
        $this->_headers = $this->_clean_input_data($this->_get_headers());
    }

    function header($index = '', $xss_clean = false) {
        return $this->_fetch_from_array(
            $this->_headers,
            $index,
            $xss_clean
        );
    }

    function _get_headers() {
        if (function_exists('getallheaders')) {
            $headers = $this->_clean_input_data(getallheaders());
        } else {
            $headers = array();

            foreach ($_SERVER as $key => $val) {
                if (preg_match('/^http/i', $key)) {
                    $key = $this->_clean_input_keys(
                        str_replace(
                            ' ',
                            '-',
                            ucwords(
                                str_replace(
                                    array('http_', '_'),
                                    array('', ' '),
                                    strtolower($key)
                                )
                            )
                        )
                    );
                    $val = $this->_clean_input_data($val);
                    $headers[$key] = $val;
                }
            }
        }

        return $headers;
    }

}


Messages In This Thread
Error: Call to undefined method CI_Input::CI_Input - by El Forum - 07-14-2011, 10:05 AM
Error: Call to undefined method CI_Input::CI_Input - by El Forum - 07-14-2011, 10:17 AM
Error: Call to undefined method CI_Input::CI_Input - by El Forum - 07-14-2011, 04:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB