Hello, I'd need to extend CI_Session_files_driver class in order to add my own method.
Example:
PHP Code:
class MY_Session_files_driver extends CI_Session_files_driver
{
public function __construct(array $params = array())
{
parent::__construct($params);
}
public function get_data($key)
{
$keys = explode('/', trim($key, "/"));
if (count($keys) > 1) {
return $this->_get_data_desde_ruta($keys);
}
return isset($_SESSION[$key]) ? $_SESSION[$key] : NULL;
}
The extended driver is loaded correctly but the problem is that I can't access to the new method get_data().
PHP Code:
Fatal error: Call to undefined method CI_Session::get_data()
I guess that the problem is that as get_data() is not part of the interface of CI_Session and
is an instance of CI_Session, it not recognize as an existing method. May be?
Do you know any way to extend the driver adding new methods?