My recommendation for every PHP projects that uses external libraries is to use your own wrapper function/class to minimize contamination of the project.
If you use a framework then try to write all your own code outside of the framework and pass in all needed framework data as arguments to your own classes/functions.