CodeIgniter Forums

Full Version: [Q] how can I quicly determine if a given CI library is loaded
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

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

El Forum

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


El Forum

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)