diff --git a/build/phar/autoload.php.in b/build/phar/autoload.php.in index 04f7c743..824a5dfb 100644 --- a/build/phar/autoload.php.in +++ b/build/phar/autoload.php.in @@ -21,6 +21,7 @@ spl_autoload_register( Phar::mapPhar('phpdox.phar'); define('PHPDOX_PHAR', 'phpdox.phar'); +define('PHPDOX_HOME', 'phar://' . PHPDOX_PHAR); TheSeer\phpDox\Version::setVersion('___VERSION___'); diff --git a/src/config/GlobalConfig.php b/src/config/GlobalConfig.php index 4bdcf781..76ffbcdc 100644 --- a/src/config/GlobalConfig.php +++ b/src/config/GlobalConfig.php @@ -111,8 +111,8 @@ public function getProjects() { * @throws ConfigException */ protected function runResolver($ctx) { - if (defined('PHPDOX_PHAR')) { - $home = 'phar://' . constant('PHPDOX_PHAR'); + if (defined('PHPDOX_HOME')) { + $home = PHPDOX_HOME; } else { $home = realpath(__DIR__.'/../../'); } diff --git a/src/config/InheritanceConfig.php b/src/config/InheritanceConfig.php index 9a4500e0..dbbadfae 100644 --- a/src/config/InheritanceConfig.php +++ b/src/config/InheritanceConfig.php @@ -55,8 +55,8 @@ public function __construct(CollectorConfig $config, fDOMElement $ctx = NULL) { */ public function getDependencyDirectories() { - if (defined('PHPDOX_PHAR')) { - $home = 'phar://' . constant('PHPDOX_PHAR'); + if (defined('PHPDOX_HOME')) { + $home = PHPDOX_HOME; } else { $home = realpath(__DIR__.'/../../'); } diff --git a/src/generator/engine/html/HtmlConfig.php b/src/generator/engine/html/HtmlConfig.php index 43ce590a..66a7a4b2 100644 --- a/src/generator/engine/html/HtmlConfig.php +++ b/src/generator/engine/html/HtmlConfig.php @@ -40,11 +40,12 @@ class HtmlConfig extends \TheSeer\phpDox\BuildConfig { public function getTemplateDirectory() { - if (defined('PHPDOX_PHAR')) { - $default = sprintf('phar://%s/templates/html', PHPDOX_PHAR); + if (defined('PHPDOX_HOME')) { + $default = PHPDOX_HOME; } else { - $default = __DIR__ . '/../../../../templates/html'; + $default = realpath(__DIR__ . '/../../../..'); } + $default .= '/templates/html'; $node = $this->ctx->queryOne('cfg:template'); if (!$node) { return $default;