]> git.andy128k.dev Git - ipf.git/commitdiff
fix class loader
authorAndrey Kutejko <andy128k@gmail.com>
Sat, 22 Jun 2013 10:51:09 +0000 (13:51 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Sat, 22 Jun 2013 10:51:09 +0000 (13:51 +0300)
ipf.php

diff --git a/ipf.php b/ipf.php
index e4c99e0399667a8764a647ab0f4a0ad9e6b33199..fc92ad77e62bc05adb2d8d9bbd1bf71087f2c3f3 100644 (file)
--- 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];
         }
     }
 }