]> git.andy128k.dev Git - ipf.git/commitdiff
use composer's autoloader
authorAndrey Kutejko <andy128k@gmail.com>
Tue, 17 Dec 2013 18:29:57 +0000 (20:29 +0200)
committerAndrey Kutejko <andy128k@gmail.com>
Tue, 17 Dec 2013 18:29:57 +0000 (20:29 +0200)
ipf.php

diff --git a/ipf.php b/ipf.php
index 339e84b8b5c181f899d21e103f98ba8e9624ca0e..4f0e8eb95141f718e9e1a6f3d958b2ed26f01caa 100644 (file)
--- a/ipf.php
+++ b/ipf.php
@@ -85,8 +85,8 @@ final class IPF
             return false;
 
         if (!$vendor_path)
-              $vendor_path = $project_path . '/vendor';
-        IPF_ClassLoader::getInstance($vendor_path);
+              $vendor_path = $project_path . '/../vendor';
+        require_once $vendor_path.'/autoload.php';
 
         IPF::$settings['ipf_path'] = dirname(__FILE__);
         IPF::$settings['project_path'] = $project_path;
@@ -154,41 +154,6 @@ final class IPF
     }
 }
 
-class IPF_ClassLoader
-{
-    private $classMap;
-
-    private static $loader = null;
-
-    public static function getInstance($vendor_path)
-    {
-        if (self::$loader == null)
-            self::$loader = new IPF_ClassLoader($vendor_path);
-        return self::$loader;
-    }
-
-    private function __construct($vendor_path)
-    {
-        $includePathsFile = $vendor_path . '/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 $vendor_path . '/composer/autoload_classmap.php';
-
-        spl_autoload_register(array($this, 'load'), true);
-    }
-
-    public function load($class)
-    {
-        if (isset($this->classMap[$class])) {
-            require $this->classMap[$class];
-        }
-    }
-}
-
 function __($str)
 {
     $t = trim($str);