From 523f256d6b19b9a8220aa0e0caac518bcc2510d7 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Tue, 17 Dec 2013 20:34:05 +0200 Subject: [PATCH] use composer's autoloader. fix bootstrap file --- index.php | 3 ++- ipf.php | 6 +----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index adeedf7..a7cab52 100644 --- a/index.php +++ b/index.php @@ -4,6 +4,7 @@ $here = dirname(__FILE__); $project_path = $here . '/../project'; -require $project_path . '/vendor/andy128k/ipf/ipf.php'; +$vendor_path = $here . '/../vendor'; +require_once $vendor_path.'/autoload.php'; return IPF::setUp($project_path, $here) && IPF_Project::getInstance()->run(); diff --git a/ipf.php b/ipf.php index 4f0e8eb..1920260 100644 --- a/ipf.php +++ b/ipf.php @@ -79,15 +79,11 @@ final class IPF return is_file($path); } - public static function setUp($project_path, $document_root, $vendor_path=null) + public static function setUp($project_path, $document_root) { if (php_sapi_name() === 'cli-server' && IPF::requestedFileExists()) return false; - if (!$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; IPF::$settings['document_root'] = $document_root; -- 2.49.0