[resolved] Undefined class controller |
Guru master
|
Did you start debugging from that file? If you haven't specified a default file to run in the project properties it will attempt to execute the file that is currently opened (& selected)
As you don't have any includes/requires before the class definition the error is exactly what it says. The controller class isn't known and thus it's impossible to inherit from. Setting a file to run or opening the file you want to start debugging from should solve the issue I think |
||||||||||||
|
|
Ok.. when I start debugging from index.php, the debugging goes smoothly. But the debugger reaches my controller class after ages!! It goes through lots of library classes and CI base classes and then reaches my controller class. Is there a way to directly jump to my controller and auto include all the necessary base classes before hand? |
||||||||||||||
|
Guru master
|
If you have the "stop on the 1st line enabled" (which it is by default), start a debug session as normal (F9 or the play button with the D on).
You'll see blue dots in front of the lines that contain executable code. Open your Blog-class file and click in the ruler on the line number of the line you wish to stop on, normally the line will turn red to indicate it is a breakpoint. Then press the debug button (or F9) again to start running the code, it should stop on the indicated line. I prefer setting the breakpoint after the debug-session started, but you can set it in advance as well. What also is a handy thing is the DebugBreak() function. Put that line anywhere in your code and then browse the site normally with a browser (or debug it). When one of those function calls is encountered a debug session will be triggered automatically (or an existing session will break/stop like a normal breakpoint). I usually put those lines in areas that should never get executed under normal circumstances. Watch out with this approach though, if you forget to remove them when you upload the files to your production environment they will break your program. If you don't have the debugger module included (as usually is the case on a production server), the function is unknown! I usually add this kind of extra code in my production file:
|
||||||||||||||
|
|
Ok... I followed your steps. The debugger doesn't stop at the breakpoint. When I press F9 the second time, the output tab opens up -> I navigate to the function where the breakpoint is set for e.g. http://localhost/myapp/Blog/login, where 'Blog' is the controller and 'login' is a function and the breakpoint is set inside the login function. Any idea wats goin on?? |
||||||||||||||||
|
Guru master
|
If you set a breakpoint on a non executable line (like on a function definition) it will be moved to the first line that can be executed. So make sure that you set it on an actual piece of code, not on a class or function statement.
You might want to check out the phped manual and read the section about debugging. There is plenty of information in there. It's not a technical problem as your debugging works, so you should manage to get it working with what is written in there. Just got to Help > PhpED Manual and read the "Debugging and Profiling" chapter |
||||||||||||
|
|
Take a look at the screen shot. BTW, I've noticed that the debug session end after I hit F9 the 2nd time |
||||||||||||||
|
Guru master
|
That is a login function as you said, but wouldn't that be called only if you actually log in? I don't know what you are debugging, but usually the first time you display a site you aren't logged in. You then enter your user details, press submit and then the login process starts (eventually calling the function you show here I assume). Is it possible that it's that what is going on here? If so, it's pretty normal the debugger doens't break, as the piece of code isn't executed.
Normally the debug session etc is maintained between pageviews, so submitting the form should continue the session and land you at that line. |
||||||||||||
|
[resolved] Undefined class controller |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by