Queries in CI profiler

edited June 2011 in Bug Reports
I turned on the profiler in MY_Config.php, but the query section always shows 'No queries were run'.
I'm pretty sure many queries are executed though.
They do show up on a fresh CodeIgniter application, but not in Fuel.
Anyway to turn them on?

Comments

  • edited 7:16AM
    This happens because of around line 140-141 in fuel/application/core/MY_Model.php, we clone the DB object onto the model instead of just using the CI->db object. The reason for this was to prevent active record query issues across models. However, in most cases you may not need to clone it. If you remove those lines, you'll see the queries.

    We currently don't have a MY_Profiler fix for it, but if you come up with something, I'd love to know.
  • edited 7:16AM
    OK, thanks for the explanation!
    I'll take a look at it if I have some time left.
  • edited 7:16AM
    Tried to do something about it, hope it works:

    https://github.com/daylightstudio/FUEL-CMS/pull/95
  • edited 7:16AM
    nice , I was just about to dig into profiling , glad that someone did it !

    the only question I have is how should i output the profiling ? if using $this->_render , I can see the profiling output if I use the this->load->view.
  • edited 7:16AM
    Are you saying you are having issues viewing the output in the admin? $this->_render in Fuel_base_controller uses $this->load->view to render as well, it just loads the fuel_header and fuel_footer files as well.
  • edited 7:16AM
    mmmm more like if I have build adv module with custom controller , I won't be able to see the profiling info , even though I m extend from the Fuel_base_controller.
  • edited 7:16AM
    Where are you seeing this problem? If you view source, do you see the code (it may be hidden by how the CSS is setup)?
  • edited 7:16AM
    nope I don't see it on source , it happen for module which not routing to FUEL_FOLDER.'/module' , that's why i wonder am i missing something.
  • edited 7:16AM
    The profiling should be outputted automatically if you set the 'enable_profiler' value in MY_config. CI's Output class takes care of the output and isn't something specific to FUEL. FUEL has just set up a convenient post_controller hook in fuel/application/hooks/Fuel_hooks.php to take care of enabling it on the Output class.
Sign In or Register to comment.