Integrating Cloudinary into CodeIgniter The Easy Way
As I found out on a project just a little while ago, CodeIgniter 3 does not play nice with custom “libraries” that use PHP namespaces and are directly loaded via the “libraries” folder.
If you try to load and use Cloudinary’s PHP library the normal way in CodeIgniter, it breaks due to the heavy use of namespaces both to setup the API connection and throughout the library itself.
To resolve this issue, I wrote an easy to use solution that indirectly loads Cloudinary’s library via a dummy library file. The API library keeps using it’s namespaces and everything is right with the world again. 🙂
It’s easy to implement and the method will work with any library that makes use of namespaces.