DB
[ class tree: DB ] [ index: DB ] [ all elements ]

Source for file include.inc

Documentation is available at include.inc

  1. <?php
  2.  
  3. /**
  4.  * Sets the include_path, error_reporting and PATH_SEPARATOR for tests
  5.  * in the DB/tests directory
  6.  *
  7.  * PHP versions 4 and 5
  8.  *
  9.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  10.  * that is available through the world-wide-web at the following URI:
  11.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  12.  * the PHP License and are unable to obtain it through the web, please
  13.  * send a note to license@php.net so we can mail you a copy immediately.
  14.  *
  15.  * @category   Database
  16.  * @package    DB
  17.  * @author     Daniel Convissor <danielc@php.net>
  18.  * @copyright  1997-2005 The PHP Group
  19.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  20.  * @version    $Id: include.inc,v 1.5 2005/02/03 05:49:44 danielc Exp $
  21.  * @link       http://pear.php.net/package/DB
  22.  */
  23.  
  24.  
  25. if (!defined('PATH_SEPARATOR')) {
  26.     if (stristr(PHP_OS'WIN')) {
  27.         /**
  28.          * Define the path separator for windows
  29.          */
  30.         define('PATH_SEPARATOR'';');
  31.     else {
  32.         /**
  33.          * Define the path separator for other systems
  34.          */
  35.         define('PATH_SEPARATOR'':');
  36.     }
  37. }
  38.  
  39. /*
  40.  * If the path to your PEAR installation is found in the left hand
  41.  * portion of the if() expression below, that means this file has
  42.  * come from the PEAR installer.  Therefore, let's use the
  43.  * installed version of DB, which should be found via the
  44.  * computer's default include_path.  Add '.' to the include_path
  45.  * to ensure '.' is in there.
  46.  * 
  47.  * If the path has not been substituted in the if() expression,
  48.  * this file has likely come from a CVS checkout or a .tar file.
  49.  * Therefore, we'll assume the tests should use the version of
  50.  * DB that has come from there as well.
  51.  */
  52. if ('@include_path@' != '@'.'include_path'.'@'{
  53.     ini_set('include_path'ini_get('include_path')
  54.             . PATH_SEPARATOR . '.'
  55.     );
  56. else {
  57.     ini_set('include_path'realpath(dirname(__FILE__'/..')
  58.             . PATH_SEPARATOR . '.' PATH_SEPARATOR
  59.             . ini_get('include_path')
  60.     );
  61. }

Documentation generated on Tue, 20 Mar 2007 05:30:36 -0500 by phpDocumentor 1.3.0. PEAR Logo Copyright © PHP Group 2004.