From f93aa6c7aceeb7ed9ea899cfe232b3bd097b2422 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sun, 22 Aug 2010 01:26:30 +0200 Subject: make files use pear directories --- src/SemanticScuttle/header.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/SemanticScuttle/header.php') diff --git a/src/SemanticScuttle/header.php b/src/SemanticScuttle/header.php index ef36e83..bc60088 100644 --- a/src/SemanticScuttle/header.php +++ b/src/SemanticScuttle/header.php @@ -14,9 +14,21 @@ * @license GPL http://www.gnu.org/licenses/gpl.html * @link http://sourceforge.net/projects/semanticscuttle */ -if (!file_exists(dirname(__FILE__) .'/../../data/config.php')) { + +if ('@data_dir@' == '@' . 'data_dir@') { + //non pear-install + $datadir = dirname(__FILE__) . '/../../data/'; +} else { + //pear installation; files are in include path + $datadir = '@data_dir@'; +} + +if (!file_exists($datadir . '/config.php')) { header('HTTP/1.0 500 Internal Server Error'); - die('Please copy "config.php.dist" to "config.php" in data/ folder.'); + die( + 'Please copy "config.php.dist" to "config.php" in data/ folder.' + . "\n" + ); } set_include_path( get_include_path() . PATH_SEPARATOR @@ -24,7 +36,6 @@ set_include_path( ); // 1 // First requirements part (before debug management) -$datadir = dirname(__FILE__) . '/../../data/'; require_once $datadir . '/config.default.php'; require_once $datadir . '/config.php'; -- cgit v1.2.3-54-g00ecf From 8fd5efb7c7fecf91ab850d2f5dfeced4b07e8562 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sun, 22 Aug 2010 01:32:14 +0200 Subject: make test running on installed pear package work: pear run-tests -pu __uri/semanticscuttle --- src/SemanticScuttle/header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/SemanticScuttle/header.php') diff --git a/src/SemanticScuttle/header.php b/src/SemanticScuttle/header.php index bc60088..d1a5c29 100644 --- a/src/SemanticScuttle/header.php +++ b/src/SemanticScuttle/header.php @@ -20,7 +20,7 @@ if ('@data_dir@' == '@' . 'data_dir@') { $datadir = dirname(__FILE__) . '/../../data/'; } else { //pear installation; files are in include path - $datadir = '@data_dir@'; + $datadir = '@data_dir@/SemanticScuttle/'; } if (!file_exists($datadir . '/config.php')) { -- cgit v1.2.3-54-g00ecf