Skip to content

Commit

Permalink
Merge pull request #180 from remicollet/fordownstream
Browse files Browse the repository at this point in the history
add PHPDOX_HOME, instead of PHPDOX_PHAR
  • Loading branch information
theseer committed Nov 29, 2014
2 parents edfcd32 + 2d920a9 commit 2f00227
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions build/phar/autoload.php.in
Original file line number Diff line number Diff line change
Expand Up @@ -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___');

Expand Down
4 changes: 2 additions & 2 deletions src/config/GlobalConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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__.'/../../');
}
Expand Down
4 changes: 2 additions & 2 deletions src/config/InheritanceConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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__.'/../../');
}
Expand Down
7 changes: 4 additions & 3 deletions src/generator/engine/html/HtmlConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2f00227

Please sign in to comment.