aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2010-08-22 01:26:30 +0200
committerChristian Weiske <cweiske@cweiske.de>2010-08-22 01:26:30 +0200
commitf93aa6c7aceeb7ed9ea899cfe232b3bd097b2422 (patch)
tree8ea92787b9b24f7345db8a8ca33f4384aefd0a02
parentaba3327b5b8beffea75687a11ccf034f5e0d0969 (diff)
downloadsemanticscuttle-f93aa6c7aceeb7ed9ea899cfe232b3bd097b2422.tar.gz
semanticscuttle-f93aa6c7aceeb7ed9ea899cfe232b3bd097b2422.tar.bz2
make files use pear directories
-rw-r--r--build.xml17
-rw-r--r--src/SemanticScuttle/header.php17
-rw-r--r--tests/prepare.php8
-rw-r--r--www/www-header.php8
4 files changed, 45 insertions, 5 deletions
diff --git a/build.xml b/build.xml
index 389dfd4..accae3b 100644
--- a/build.xml
+++ b/build.xml
@@ -113,6 +113,23 @@
<ignore>scripts/**</ignore>
<ignore>src/php-gettext/examples/**</ignore>
<ignore>src/php-gettext/bin/**</ignore>
+ <ignore>*.tgz</ignore>
+
+ <replacement
+ path="src/SemanticScuttle/header.php"
+ type="pear-config"
+ from="@data_dir@" to="data_dir"
+ />
+ <replacement
+ path="www/www-header.php"
+ type="pear-config"
+ from="@data_dir@" to="data_dir"
+ />
+ <replacement
+ path="tests/prepare.php"
+ type="pear-config"
+ from="@data_dir@" to="data_dir"
+ />
<changelog version="0.97" date="2010-06-09" license="GPL">
- Many SQL optimizations - SemanticScuttle shows bookmarks 4 times faster now
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';
diff --git a/tests/prepare.php b/tests/prepare.php
index ce9cd1c..6afc284 100644
--- a/tests/prepare.php
+++ b/tests/prepare.php
@@ -19,7 +19,13 @@
$_SERVER['HTTP_HOST'] = 'http://localhost/';
define('UNIT_TEST_MODE', true);
-require_once dirname(__FILE__) . '/../src/SemanticScuttle/header.php';
+if ('@data_dir@' == '@' . 'data_dir@') {
+ //non pear-install
+ require_once dirname(__FILE__) . '/../src/SemanticScuttle/header.php';
+} else {
+ //pear installation; files are in include path
+ require_once 'SemanticScuttle/header.php';
+}
require_once dirname(__FILE__) . '/TestBase.php';
require_once dirname(__FILE__) . '/TestBaseApi.php';
diff --git a/www/www-header.php b/www/www-header.php
index 0688b71..cc5a5ae 100644
--- a/www/www-header.php
+++ b/www/www-header.php
@@ -15,5 +15,11 @@
* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
-require_once dirname(__FILE__) . '/../src/SemanticScuttle/header.php';
+if ('@data_dir@' == '@' . 'data_dir@') {
+ //non pear-install
+ require_once dirname(__FILE__) . '/../src/SemanticScuttle/header.php';
+} else {
+ //pear installation; files are in include path
+ require_once 'SemanticScuttle/header.php';
+}
?> \ No newline at end of file