• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How does CI handle multiple attempts to load the same file?

#1
[eluser]gunnarflax[/eluser]
If I load a library in my controller and then later also loads it within a model, does CI load it twice or abort the second attempt because it can see that it is already loaded?

#2
[eluser]jmadsen[/eluser]
aborts

#3
[eluser]davidbehler[/eluser]
CI loads libraries only once, no matter how often you use $this->load->library();. When ever a library is already loaded and you try to load it again an entry will be added to the log file that says so, this helps you find places in your code with unneeded function calls.

#4
[eluser]gunnarflax[/eluser]
Great! Thank you for the elaborate answer!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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