Welcome Guest, Not a member yet? Register   Sign In
Problems moving from old CI 2.0 (BETA?) to CI 2.0 reactor
#1

[eluser]Juris Malinens[/eluser]
site url: http://wap4.org (nobody uses it so I enabled displaying errors)


this is my controller
Code:
class Welcome extends CI_Controller {

    function __construct()
    {
        parent::__construct();
                $this->load->library('ffmpeg');
                $this->config->load('ffmpeg');
                $this->load->model('site_model');
        
                if (!$this->ion_auth->logged_in())
                $this->max_kb = $this->site_model->get_setting('file_size_unregistered')*1024;
                else
                $this->max_kb = $this->site_model->get_setting('file_size_registered')*1024;
                parse_str($_SERVER['QUERY_STRING'], $_GET);
    }

    function index()
    {
                $uniqid                = uniqid();
                $this->data['allowed'] = "'".implode("','", $this->config->item('ffmpeg_allowed'))."'";
                $this->data['uniqid']  = $uniqid;
                $this->data['message'] = '';
                $this->data['users']   = '';
                $this->data['attr']    = array('id' => 'conv');
                $this->data['formats'] = $this->ffmpeg->ffmpeg_formats;
                $this->data['max']         = $this->max_kb;
                $this->data['navigation'] = $this->config->item('navigation');
                $this->data['lang'] = $this->lang->lang();
                $this->load->view('includes/header', $this->data);
        //$this->load->view('main_menu', $this->data);
                $this->load->view('includes/footer', $this->data);
    }
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */


Error doesn't help me to find mistake...
#2

[eluser]MVUG[/eluser]
Can you explain what isn't working? Do you use htaccess rewrites?
What php version do you use? And ion-auth is not loaded?
#3

[eluser]Juris Malinens[/eluser]
ion_auth is loaded by autoload.php

Code:
$autoload['libraries'] = array('ion_auth','session','database');

$autoload['helper'] = array('url','language','form','wap4');


$autoload['config'] = array('site');

$autoload['language'] = array('site','ffmpeg');


phpinfo (php 5.2.10):

http://wap4.org/phpinfo.php


my .htaccess (for multi-language):

Code:
RewriteEngine On
RewriteCond $1 !^(index\.php|phpinfo\.php|images|downloads|rat|youtube|files|img|ffmpeg|css|js|xampp|robots\.txt)
RewriteRule ^(.+)$ index.php?$1 [L]
<FilesMatch “^index.php$”>
AcceptPathInfo On
</FilesMatch>

<FilesMatch "\.(amr|3gp|mp4|mp3)$">
  ForceType application/octet-stream
  Header set Content-Disposition attachment
</FilesMatch>

EDIT:

even I get this error on basic controller like:

http://wap4.org/en/about/index

class About extends CI_Controller {

Code:
function index()
    {
                $this->load->helper('wap4');
                load_settings();

        // you might want to just autoload these two helpers
                $data['content'] = lang("about.content");
                
                if(!irAjax())
                $this->load->view('includes/header', $this->data);
                
        $this->load->view('about', $data);
                
                if(!irAjax())
                $this->load->view('includes/footer', $this->data);
    }
}
#4

[eluser]Twisted1919[/eluser]
Go old fashion way:
After you load a library put var_dump($this->lib_name) then exit() the script, if you have a valid object, move forward and do it for the models or for the next library.
Somewhere on the way it has to show you what object is not instantiated but you still call it .
#5

[eluser]Juris Malinens[/eluser]
I simply gave up debugging and started from fresh Codeigniter 2.0 reactor download and aded files one by one and I changed

for some controllers there were problems construct
function __construct() {
parent::__construct();
}

in I have some extended file in application/core and it seems CI 2.0 reactor also asks for onstruct to work properly (in the 2.0 beta I used it did not require me to do so):
function __construct() {
parent::__construct();
}

http://test.wap4.org- here is more or less working example (only language switching doesn't seem to work yet...)...

EDIT: fixed also MY_Lang.php Smile


EDIT2:

but I have little problems with input so I extended it and disabled by adding My_Input.php because COdeIgniter don't like jquery ajax requests with parameters...:

Code:
function _clean_input_keys($str)
    {
        if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str))
        {
            //exit('Disallowed Key Characters.');
        }

        // Clean UTF-8 if supported
        if (UTF8_ENABLED === TRUE)
        {
            $str = $this->uni->clean_string($str);
        }

        return $str;
    }




Theme © iAndrew 2016 - Forum software by © MyBB