Welcome Guest, Not a member yet? Register   Sign In
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




Theme © iAndrew 2016 - Forum software by © MyBB