From 4ea404e40b9b439003ab9df3116e0e773c23126d Mon Sep 17 00:00:00 2001 From: Michael Fairchild <mfairchild365@gmail.com> Date: Thu, 3 Jan 2013 11:26:16 -0600 Subject: [PATCH] update the autoload function to include the vendor libs --- configsample.inc.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/configsample.inc.php b/configsample.inc.php index 7c97a73..179af4d 100644 --- a/configsample.inc.php +++ b/configsample.inc.php @@ -1,14 +1,11 @@ <?php -function __autoload($class) +function autoload($class) { - $file = dirname(__FILE__).'/src/'.str_replace('_', DIRECTORY_SEPARATOR, $class).'.php'; - if (file_exists($file)) { - require $file; - return true; - } - return false; + $class = str_replace(array('_', '\\'), '/', $class); + include $class . '.php'; } -spl_autoload_register('__autoload'); +spl_autoload_register('autoload'); +set_include_path(__DIR__ . '/src' . PATH_SEPARATOR . __DIR__ . '/vendor/php'); -- GitLab