Welcome Guest, Not a member yet? Register   Sign In
Cannot see CI Global object - checkout only invokes CI for 404
#1

[eluser]SaminOz[/eluser]
I'm up against a very strange issue and am hoping someone will have an idea of what is going wrong here.

I have multiple local CI projects running on a local ubuntu machine, normal lamp stack - they are all fine.

I recently took an svn checkout of a project that I have worked on happily before and cannot see any controller/method even though I get http 200 responses for the request.

If I var_dump $this from a method - I get the name of the controller class - not the CI global object.

If I put in a non-existent path - I get the CI 404 page.

Permissions and apache virtual host settings are good.

.htaccess and index.php are working as index.php has been removed from the url and I still can dump strings and natural php functions (like class_exists() etc. ) from a correctly routed controller/method combination. However as soon as the server reaches code that requires CI (such as $this->load->helper() etc. ) processing stops.

I have one small lead - the project that I have checked out works fine for multiple developers where I work. I had to recently rebuild my machine to be native ubuntu 12.04 which before was a wubi virtual box (which died).

In order to var_dump from a controller/method request I had to add a __construct() method to the controller in question in order to be routed to the requested method, otherwise I just get an http 200 response but no var_dump.

The native welcome controller (which still exists in our dev checkout) works in exactly the same manner - in order to var_dump I have to add a __construct() method.

If I add parent::__construct() to the method (in either controller), var_dump no longer works.

My new version of php is 5.3.10-1 with Suhosin v0.9.33. The CI version of the checkout is 2.1.0

So essentially CI is not booting except in the case of a 404. Is there something obvious that anyone can see that I have overlooked?

Thanks.
#2

[eluser]rwestergren[/eluser]
I'd recommend installing a debugger like Xdebug. This will allow you to set a breakpoint and visually see the variables in the current scope and their values. A real debugger is an essential tool.

Also, the controller object IS an instance of the CI global object. If you get_instance within a helper, you'll notice the class is actually an instance of the controller being used.




Theme © iAndrew 2016 - Forum software by © MyBB