ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Fatal Memory Error

November 05, 2009 3:55am

Subscribe [2]
  • #16 / Nov 06, 2009 12:32pm

    BrianDHall

    760 posts

    Also take care in your model constructors with loading the database. I have found I use the database so much, for sessions and such, that it makes more sense to just autoload the database. Then you don’t have to worry about making calls to load it.

    For extra memory security in such instances, you might try something like this:

    if (! is_set($CI->myModel))
    {
       $CI->load->model( 'myModel' );
    }

    This way you guarantee you aren’t loading something twice, leaving no chance things are being loaded more times than you want.

    And as you code notes, in models be sure to make use of the CI super-object on loading so each model doesn’t itself end up with its own sub-model and you end up with dozens of duplicates flying around.

    Glad you got to the bottom of your problem!

  • #17 / Nov 06, 2009 5:25pm

    iFadey

    53 posts

    Hey Brian thank you so much. You gave some really good advices.
    Yeah I am also glad that it’s solved and thanks again to both of you because it won’t be possible without your support 😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases