From: Andrey Kutejko Date: Tue, 17 Dec 2013 18:34:05 +0000 (+0200) Subject: use composer's autoloader. fix bootstrap file X-Git-Tag: 0.6~220 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=523f256d6b19b9a8220aa0e0caac518bcc2510d7;p=ipf.git use composer's autoloader. fix bootstrap file --- 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;