CodeIgniter Forums
[Q] how can I quicly determine if a given CI library is loaded - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: [Q] how can I quicly determine if a given CI library is loaded (/thread-11502.html)



[Q] how can I quicly determine if a given CI library is loaded - El Forum - 09-10-2008

[eluser]vlad_ci[/eluser]
I want to programmatically detect if a given CI library
is already loaded and if not loaded, load it.

Is this something I should do, or simply attempt to load it
and CI will figure out internally that it was already loaded

?

thank you


[Q] how can I quicly determine if a given CI library is loaded - El Forum - 09-10-2008

[eluser]Randy Casburn[/eluser]
Use the php function class_exists('class'); If it has been defined it will tell you.

Randy


[Q] how can I quicly determine if a given CI library is loaded - El Forum - 09-10-2008

[eluser]vlad_ci[/eluser]
thank you.

I also put a test printout in the constructor of the library
and I am seeing that the constructor being called only once,
so may be, by design I can load it as many times as I want

but CI will keep only the first version
(and the first set of arguments passed in)