From 3692f5201ea11a064fd85bf3532c474c7a79eda3 Mon Sep 17 00:00:00 2001 From: Yahnis Elsts Date: Thu, 22 Dec 2016 18:49:51 +0200 Subject: [PATCH] Fix autoloading of files in the "vendor" subdirectory. I was using the wrong directory path, oops. --- Puc/v4/Autoloader.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Puc/v4/Autoloader.php b/Puc/v4/Autoloader.php index 2067531..8376537 100644 --- a/Puc/v4/Autoloader.php +++ b/Puc/v4/Autoloader.php @@ -3,6 +3,7 @@ class Puc_v4_Autoloader { private $prefix = ''; private $rootDir = ''; + private $libraryDir = ''; private $staticMap; @@ -11,6 +12,7 @@ class Puc_v4_Autoloader { $nameParts = explode('_', __CLASS__, 3); $this->prefix = $nameParts[0] . '_' . $nameParts[1] . '_'; + $this->libraryDir = realpath($this->rootDir . '../..') . '/'; $this->staticMap = array( 'PucReadmeParser' => 'vendor/readme-parser.php', 'Parsedown' => 'vendor/ParsedownLegacy.php', @@ -23,9 +25,9 @@ class Puc_v4_Autoloader { } public function autoload($className) { - if ( isset($this->staticMap[$className]) && file_exists($this->rootDir . $this->staticMap[$className]) ) { + if ( isset($this->staticMap[$className]) && file_exists($this->libraryDir . $this->staticMap[$className]) ) { /** @noinspection PhpIncludeInspection */ - include ($this->rootDir . $this->staticMap[$className]); + include ($this->libraryDir . $this->staticMap[$className]); return; }