]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
make files use pear directories
authorChristian Weiske <cweiske@cweiske.de>
Sat, 21 Aug 2010 23:26:30 +0000 (01:26 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Sat, 21 Aug 2010 23:26:30 +0000 (01:26 +0200)
build.xml
src/SemanticScuttle/header.php
tests/prepare.php
www/www-header.php

index 389dfd4f7365a31b18e2759f195fd49858056599..accae3b40d4f56b533c00c061ba717e3325be61b 100644 (file)
--- a/build.xml
+++ b/build.xml
      <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
index ef36e83d39f1d4036d55f8e4e56dac5eb88e7cb2..bc60088b673f8e19e51c5e40468f7e6d61dd5177 100644 (file)
  * @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';
 
index ce9cd1cddb388f651e3b8b981b55f4660ee60c36..6afc284341a5f102c6e77a14046dca9bdc44e09d 100644 (file)
 $_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';
 
index 0688b7150d4ce2411076a479242e6d49208a062a..cc5a5ae8cfa9f62404b9574a62c0a735d17735a5 100644 (file)
  * @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