Changeset 27 for php/trunk/rdfa.php


Ignore:
Timestamp:
Jul 13, 2011, 1:46:00 AM (14 years ago)
Author:
cla
Message:

rdfint

  • reworked library setup for samples and unittests
File:
1 edited

Legend:

Unmodified
Added
Removed
  • php/trunk/rdfa.php

    r2 r27  
    1818 */
    1919
    20 // --- load ARC
    21 if (!defined( 'ARC2'))
    22         die( 'error: ARC2 not defined !');
    23 require_once( ARC2.'/ARC2.php');
    24 
    25 // --- load and initialize fDebug
    26 // if not defined, load dummy class
    27 if (defined( 'fDebug'))
    28   require_once( fDebug.'/server/php/fdebug.lib.php');
    29 else
    30   require_once( RDFINT.'/classes/fdebug.php');
    31 
    3220// --- load classes of this library
    33 if(!defined('RDFINT'))
    34         die( 'error: RDFINT not defined !');
     21if (!defined( 'RDFINT'))
     22  define( 'RDFINT', getenv( 'PHP_LIBROOT_RDFINT'));
     23if (RDFINT == '')
     24        die( 'error: environment variable PHP_LIBROOT_RDFINT not defined !');
    3525require_once( RDFINT.'/classes/rdfa_Data.php');
    3626require_once( RDFINT.'/classes/rdfa_Projection.php');
     
    3828require_once( RDFINT.'/classes/rdfa_SparqlQuery.php');
    3929
     30// --- load ARC
     31define( 'ARC2', getenv( 'PHP_LIBROOT_ARC2'));
     32if( ARC2 == '')
     33        die( 'error:environment variable PHP_LIBROOT_ARC2 not defined !');
     34require_once( ARC2.'/ARC2.php');
     35
     36// --- load fDebug
     37define( 'fDebug', getenv( 'PHP_LIBROOT_FDEBUG'));
     38$locationStub = RDFINT.'/classes/fdebug.php';
     39$locationLib1 = fDebug.'/server/php/fdebug.lib.php';
     40$locationLib2 = fDebug.'/fdebug.lib.php';
     41if (fDebug == '') {
     42  $location = $locationStub;
     43} else {
     44  $location = $locationLib1;
     45  if (!file_exists( $location))
     46    $location = locationLib2;
     47  if (!file_exists( $location))
     48    $location = $locationStub;
     49}
     50require_once( $location);
     51
     52// --- configure fDebug
     53$fdebug = \fDebug::getInstance();
     54If (isset( $_SERVER[ "SERVER_NAME"]))
     55  $fdebug->setSession( $_SERVER[ "SERVER_NAME"]);
     56else {
     57  $unittest_name = str_replace( '_', ' ', basename( getcwd()));
     58  if (defined( 'SAMPLE_NAME'))
     59    $fdebug->setSession( 'localhost', SAMPLE_NAME . ' ' . $unittest_name);
     60}
     61$fdebug->openSocket( '127.0.0.1');
     62$fdebug->sendSource( '<?xml version="1.0" ?><emptysource/>');
    4063
    4164?>
Note: See TracChangeset for help on using the changeset viewer.