From: Andrey Kutejko Date: Sat, 22 Jun 2013 10:51:09 +0000 (+0300) Subject: fix class loader X-Git-Tag: 0.5~219 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=b3d771f353a399c0be907d02b2041e3bddae7677;p=ipf.git fix class loader --- 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]; } } }