CI Determine If Library Is Loaded
I recently needed to determine if a library was loaded in CI form my Model. I have the CI Rest library using the same model for a query and wanted to change the query if the system had a user logged in. I simply wanted to check and see if the Tank Auth library was loaded and grab the user id from it if it was. I ended up using the PHP function class_exists
.
if(class_exists('Ion_auth')) {
//Include user specific query stuff here
}