aboutsummaryrefslogtreecommitdiff
path: root/data/config.default.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2014-07-04 07:34:10 +0200
committerChristian Weiske <cweiske@cweiske.de>2014-07-04 07:34:10 +0200
commit227289a8fa6093f468290d4b3b68f6948f1a2b14 (patch)
tree4c16d1fe5572eca303fbe506cf82e3cf284203af /data/config.default.php
parent979fd71983f72991b7b698d0fa57b46213503672 (diff)
downloadphorkie-227289a8fa6093f468290d4b3b68f6948f1a2b14.tar.gz
phorkie-227289a8fa6093f468290d4b3b68f6948f1a2b14.zip
handle default git+workdir in phar files
Diffstat (limited to 'data/config.default.php')
-rw-r--r--data/config.default.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/data/config.default.php b/data/config.default.php
index eb98efd..22bbc4a 100644
--- a/data/config.default.php
+++ b/data/config.default.php
@@ -1,8 +1,16 @@
<?php
+$pharFile = \Phar::running();
+if ($pharFile == '') {
+ $phorkieDir = __DIR__ . '/../';
+} else {
+ //remove phar:// from the path
+ $phorkieDir = dirname(substr($pharFile, 7)) . '/';
+}
+
$GLOBALS['phorkie']['cfg'] = array(
'debug' => false,
- 'gitdir' => __DIR__ . '/../repos/git/',
- 'workdir' => __DIR__ . '/../repos/work/',
+ 'gitdir' => $phorkieDir . 'repos/git/',
+ 'workdir' => $phorkieDir . 'repos/work/',
'tpl' => __DIR__ . '/templates/',
'baseurl' => null,
'avatars' => true,