• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Libraries, config data and memory usage

#1
[eluser]Dave Stewart[/eluser]
Hi All,
I'm working on a Library at the moment that accesses config data, stored in a config file:

Code:
/application
    /config
        nav.php
    /libraries
        nav.php

The deal with config files is that if they are named identically to your library, the data will be passed automatically to the constructor.

However, the config data I'm passing is quite a large hierarchical array, so if it gets passed in to become an instance variable, is the data effectively repeated in two places?

Or is the array a reference to the original array, stored in the CI superobject, or is it a copy?

Should I be referencing (and potentially updating) $this->CI->config->item('nav'), or can I happily work on the passed variable?

Any help would be appreciated.

Cheers,
Dave


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.