How to test whether a package or library is installed

Permalink
How do I test whether a package or library is installed/available before trying to load or use it?

What I want to do is something like:
if ( IS_INSTALLED("packagename") && IS_AVAILABLE("libname")){
    Loader::library("libname", "packagename");
    //do stuff that depends on above
    }

JohntheFish
 
12345j replied on at Permalink Best Answer Reply
12345j
http://www.concrete5.org/community/forums/customizing_c5/check-if-block-type-installed-best-practice/