• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Split library into 2 versions, 'light' and 'complete', then call functions from either using just 1 library name.

#1
[eluser]tical[/eluser]
I have a library that is quite large in size and when loaded uses about 1.2mb of memory.

Most of functions in the library are rarely needed, whilst others are often used on every page.

To reduce the wasted memory usage, I want to split the library into 2 new libraries, a 'Light' version containing the common functions, and then another version that extends the light version with the remaining functions.

I can obviously do this by just simply creating 2 library files and calling the version I need on each page.
I have tried doing this and it reduces the memory usage to only 0.4mb for the Light version - exactly what I was looking to do.

However, a problem that occurred, is that it can start to get confusing as to which library contains what functions when calling them.

Provided that the correct library is initialised in the first place, for example:
Code:
$this->load->library('my_light_library');
or
Code:
$this->load->library('my_complete_library');

Is it possible to call functions from them using the same library name?
Code:
$this->my_library->my_function()


Messages In This Thread
Split library into 2 versions, 'light' and 'complete', then call functions from either using just 1 library name. - by El Forum - 03-03-2011, 02:01 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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