Skip to content

Instantly share code, notes, and snippets.

@Teino1978-Corp
Forked from nojimage/pear_import.php
Created November 4, 2015 05:25
Show Gist options
  • Save Teino1978-Corp/e436bb9154a103bf1d2f to your computer and use it in GitHub Desktop.
Save Teino1978-Corp/e436bb9154a103bf1d2f to your computer and use it in GitHub Desktop.
PEAR Class Loader for CakePHP
<?php
/**
* PEAR Class Loader for CakePHP
*
* ex. pear_import('Net_DNS');
*
* @param $className
* @return boolean
*/
function pear_import($className) {
$classPath = preg_replace('/_/', DS, $className) . '.php';
return App::import('vendor', $className, array('file' => $classPath));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment