From b3d771f353a399c0be907d02b2041e3bddae7677 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Sat, 22 Jun 2013 13:51:09 +0300 Subject: [PATCH] fix class loader --- ipf.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ipf.php b/ipf.php index e4c99e0..fc92ad7 100644 --- a/ipf.php +++ b/ipf.php @@ -184,11 +184,12 @@ class IPF_ClassLoader private function __construct($project_path) { - $dir = $project_path . '/vendor/composer/'; - - $includePaths = require $project_path . '/vendor/composer/include_paths.php'; - array_push($includePaths, get_include_path()); - set_include_path(join(PATH_SEPARATOR, $includePaths)); + $includePathsFile = $project_path . '/vendor/composer/include_paths.php'; + if (is_file($includePathsFile)) { + $includePaths = require $includePathsFile; + array_push($includePaths, get_include_path()); + set_include_path(join(PATH_SEPARATOR, $includePaths)); + } $this->classMap = require $project_path . '/vendor/composer/autoload_classmap.php'; @@ -198,7 +199,7 @@ class IPF_ClassLoader public function load($class) { if (isset($this->classMap[$class])) { - include $this->classMap[$class]; + require $this->classMap[$class]; } } } -- 2.49.0