how to display all the mothods called in the codeigniter profiler - codeigniter-2

is there any way to display all the methods called in the codeigniter profiler.
Also like to display which method calls which method and which method trigger the query

Unfortunately, your question is not very clear to me. I am not really sure of what you want to do.
there is a PHP command available in later versions called debug-backtrace.
http://php.net/manual/en/function.debug-backtrace.php
this gives you the stack trace of all commands executed to get to a particular method.
The codeigniter profiler is a system library. If there is a feature you really need it is possible to extend the profiler class to have the functionality you require. the CI manual explains how to do this in the section about 'Extending Native Libraries'

Related

Why does a "on a non-object" error occurs with this extension in Magento?

I'm having an Issue with a blog extension in Magento CE 1.6.2.0.
I installed this extension: Neotheme_nBlog.
I created an entry in the administrator.
Then I went to http://www.example.com/index.php/blog/ to see the recently created entry.
What I saw was an error like this:
Fatal error: Call to a member function getName() on a non-object
in /home/example.com/public_html/app/design/frontend/default/caramel/template/magicat/left.phtml
I searched in google the terms: "template/magicat/left.phtml" getName and what I only found is sites having this issue, but no support at all.
Please note: I know what does that error mean in PHP ("unfortunately" I'm not new at that). What I don't understand is what's happening with such [NON/null] object and how to fix it without killing a dozen of kittens.
Question: What can I do to solve it? What is the nature of the error, regarding Magento?(again: not PHP).
Notes: The Magento site (http://magento.stackexchange.com) is somewhat poor and strict to bring support of such nature, so asking there is not an option.
Edit (as answer to comment, and to clarify):
Neotheme is still not responding the request.
Don't know what should I look on such file (instances are not initialized there, but only accessed).
I'm using the default theme (caramel), which has esthetical changes (does not have layout changes).
It's hard to say without seeing your system specifically, but on this
template/magicat/left.phtml
It looks like you've added a template named magicat/left.phtml to your system -- either via an extension or custom development. Somewhere in this file PHP's called getName on a non-object. There's a variety of reasons this could be happening, and without seeing the specific line of code PHP's complaining about in your system, it's hard to say. It'd also be helpful to know if magicat is part of the extension or something else.
The most common reason for this error in a template is code that relies on a block being there that's been removed by another extension (eitehr via layout XML or observer methods)
$this->getLayout()->getBlock('some_block')->getName();
The next most common is people using the registry to communicate between templates and views, but a registry key not being set
Mage::registry('some_item')->getName();
Without knowing the variable and context, it's doubtful anyone will be able to help you.

ngdoc: How to document exceptions and events of the method?

I'm currently writing docs for an AngularJS module. Is there a proper way in the ngdoc to document an exceptions and an events which are thrown by a module's method?
UPD:
In the AngularJS contributing guidelines in the "Applying Code Standards" section is said that ngdoc is just an extended version of the jsdoc format. Does it mean that I could use #fires and #throws syntax to do what I need?
Take a look at https://github.com/angular/angular.js/wiki/Writing-AngularJS-Documentation.
There it is described that an event is declared as
#ngdoc event
You can put different informations to explain in detail what the event does or when it gets fired or something.
And ngdoc is a customized version of jsdoc, so you could use jsdoc-Tags as well but there are not angular specific!

PyroCMS custom libraries and CI SuperObject

It should be simple, but it's not.
I have a library that is hoping to use other libraries, but something ain't jiving.
Both libs live in system/cms/libraries because as far as I can tell, addons/shared_addons/libraries is utterly useless and the libraries need to be autoloaded (it seems that system/cms is essentially system/application but please correct me if wrong). An aside: just for kicks I put a library in shared_addons/libaries just to see if I could call if from a module; I couldn't. Why is it there?
Lib1
-needs db
-needs lib2
Lib2
-needs session
Here's what happens. Controller [module] loads; calls lib1 which calls lib2 which throws an error. Lib1 is to be called by all module controllers. Lib2 uses session data that is set earlier on and is only called by lib1.
In lib2 I use $CI=get_instance() to supposedly enable CI libs (e.g. database, session). However, I can't get past "Fatal error: Call to a member function userdata() on a non-object"; which is called by
//system/cms/libraries/lib2.php
$this->CI =& get_instance();
//$this->load->library('database'); == "can't find class database"
$ekeyLoc = $this->CI->session->userdata('ronery');
now if I run this in a module controller, it works as expected.
So googling that error, a lot of "db not loaded"'s come up. Just to make sure, I tried to load the database, but because eff me, it can't find class 'database' NB: database is being autoloaded.
When you assign CodeIgniter super object, I'm assuming it's grabbing the whole jabloney, right? I thought so. But to make sure, I decided to try and load the database class in a module/controller, which turns out, because eff me, couldn't be found.
I tried looking through the pyroCMS docs to find out about any trickery, but there ain't much, and none helpful to my situation.
Why can't I load a core library from a module controller?
Why can't I load a core library into a custom library in system/cms/libraries?
Why doesn't the CodeIgniter super object I assign contain session/db crap?
Why can't I load a library from /addons/shared_addons/library?
Why would a call to $this->session->userdata() work from a module controller, but not from a library in the system/cms/libraries folder even though CodeIgniter super object has been assigned?
Thanks.
After 2 days with no answer, I find it both frustrating and hilarious that continuing to search for help inevitably leads to this question being the top google result. FML.
First things first:
$this->load->library('database');
That is not valid CodeIgniter code, like their documentation says it should be:
$this->load->database();
As you've already pointed out though this is autoloaded so there is no need to do that anyway.
Why can't I load a core library from a module controller?
You can.
Why can't I load a core library into a custom library in system/cms/libraries?
You can.
Why doesn't the CodeIgniter super object I assign contain session/db crap?
It does.
Why can't I load a library from /addons/shared_addons/library?
This was not possible in 1.3.x but should have been fixed in 1.3.2, if not has been fixed since in 2.0.
I do not know what you are doing or why you are having such problems, but without any example code or a description of what version of PyroCMS you are using I cannot help any further.
If you have been stuck for two days why have you not posted on our forums? If you HAVE posted on our forums (I didn't see anything about it) you should have put a link in this post to your forum thread to help other people answer the questions.
This is not the first time anyone has been stuck on the internet but you act like it is. Come on, you know how this works! :)

How to trace CakePHP's inner workflow

Short description
I'm getting used to CakePHP right now and am wondering about how to get more debug-information about what is happening inside the framework.
Let me please explain my situation a little more detailed
As you know CakePHP does a lot for you without putting you into the need to write additional code. One example is the handling of models.
I just created a model User and added validation-rules (no other methods). As described in the API methods like save will just work.
After that I created the needed controller and view to add a new user. When I try to add a user from the view I just receive the flash-message The user could not be created. Please, try again. No validation-violations are flashed.
I also did set the debug-level to 2: Configure::write('debug', 2); but do not receive any errors. The error.log inside \tmp\logs is also empty.
I really do want to learn how to solve those issues in the future.
So what else can I do to debug / display inner processes of cake?
Thank you very much for your help!
DebugKit is an official plugin that gives you lots of information on the request, queries and variables produced by Cake:
https://github.com/cakephp/debug_kit
You can also use trace() and other methods in the Debugger to show what is being executed in the background:
http://book.cakephp.org/2.0/en/development/debugging.html
Use a PHP IDE with an integrated debugger. That will allow you to follow execution line by line as it is executed and even inspect variable values as you go. Netbeans is a free one.

Is there a way to add global error handler in a visual basic 6.0 application?

VB 6.0 does not have any global handler.To catch runtime errors,we need to add a handler in each method where we feel an error can occur.But, still some places might be left out.So,we end up getting runtime errors.Adding error handler in all the methods of an application,the only way?
No there is no way to add a global error handler in VB6. However, you do not need to add an error handler in every method. You only really need to add an error handler in every event handler. E.g. Every click event,load event, etc
While errors do propogate upwards, VB6 has no way to do a stack trace, so you never know which method raised the error. Unfortunately, if you need this information, you have to add a handler to each method just to log where you were.
Also: errors do propagate upwards: if method X calls methods Y and Z, a single error handler in method X will cover all three methods.
I discovered this tool yesterday:
http://www.everythingaccess.com/simplyvba-global-error-handler.htm
It is a commercial product that enables global error handling in VB6 and VBA applications.
It has its cost but does its job perfectly. I have seen other tools (free though) helping in this VB6 mangle, but none can cover a true real global error handling like "SimplyVB6 Global Error Handler for VB6" does.
With "SimplyVB6 Global Error Handler for VB6", there is no need to change any line of existing code, and no need to number the lines of code (via a plug-in or something).
Just enable Global error handling (one line of code in the main module) and you are all set.
"SimplyVB6 Global Error Handler for VB6":
can show the call stack with real module and function names, as well as display the source code line.
Works only with P-Code compiled VB6 programs.
can work via early or late binding (no DLL Hell).
I am not in any way affiliated to www.everythingaccess.com, just happy to have found it yesterday afternoon, was kind of looking at this problem again as one of my customers was having bugs in our VB6 application. I was able to test the tool yesterday afternoon, exchanging emails with the www.everythingaccess.com support and getting the evaluation product per mail.
Their web side does not allow yet to download the evaluation version of the VB6 product, you have to email them but they are answering in less than an hour.
on error resume next - is kinda close but its been a while.
you might want to look up any caveats

Resources