Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
 
3
/**
4
 * Establishes the include_path, DSN's and connection $options
5
 *
6
 * If this file is named "setup.inc.cvs," it is the original one from CVS.
7
 * Please do the following:
8
 *   1) Make a copy of this file named "setup.inc".
9
 *   2) Then, in the copy, edit the $dsns array as appropriate for your
10
 *      environment.
11
 *   3) At least one element of the $dsns array needs to be uncommented.
12
 *
13
 * PHP versions 4 and 5
14
 *
15
 * LICENSE: This source file is subject to version 3.0 of the PHP license
16
 * that is available through the world-wide-web at the following URI:
17
 * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
18
 * the PHP License and are unable to obtain it through the web, please
19
 * send a note to license@php.net so we can mail you a copy immediately.
20
 *
21
 * @category   Database
22
 * @package    DB
23
 * @author     Daniel Convissor <danielc@php.net>
24
 * @copyright  1997-2005 The PHP Group
25
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
26
 * @version    $Id: setup.inc.cvs,v 1.6 2005/02/14 23:33:20 danielc Exp $
27
 * @link       http://pear.php.net/package/DB
28
 */
29
 
30
if (!defined('PATH_SEPARATOR')) {
31
    if (stristr(PHP_OS, 'WIN')) {
32
        /**
33
         * The string used to delimit elements of the path.
34
         */
35
        define('PATH_SEPARATOR', ';');
36
    } else {
37
        /**
38
         * The string used to delimit elements of the path.
39
         */
40
        define('PATH_SEPARATOR', ':');
41
    }
42
}
43
 
44
/*
45
 * If the path to your PEAR installation is found in the left hand
46
 * portion of the if() expression below, that means this file has
47
 * come from the PEAR installer.  Therefore, let's use the
48
 * installed version of DB, which should be found via the
49
 * computer's default include_path.  Add '.' to the include_path
50
 * to ensure '.' is in there.
51
 *
52
 * If the path has not been substituted in the if() expression,
53
 * this file has likely come from a CVS checkout or a .tar file.
54
 * Therefore, we'll assume the tests should use the version of
55
 * DB that has come from there as well.
56
 */
57
if ('@include_path@' != '@'.'include_path'.'@') {
58
    ini_set('include_path', ini_get('include_path')
59
            . PATH_SEPARATOR . '.'
60
    );
61
} else {
62
    ini_set('include_path', realpath(dirname(__FILE__) . '/../..')
63
            . PATH_SEPARATOR . '.' . PATH_SEPARATOR
64
            . ini_get('include_path')
65
    );
66
}
67
 
68
/**
69
 * Grab the PEAR DB classes.
70
 */
71
require_once 'DB.php';
72
 
73
// Options used when connecting
74
$options = array(
75
    //'optimize' => 'portability',
76
    'portability' => DB_PORTABILITY_ALL,
77
    'debug' => 2,
78
);
79
 
80
$dbasedsn = array(
81
    'phptype'  => 'dbase',
82
    'database' => '/path/and/name/of/dbase/file',
83
    'mode'     => 2,
84
    'fields'   => array(
85
        array('a', 'N', 5, 0),
86
        array('b', 'C', 40),
87
        array('c', 'C', 255),
88
        array('d', 'C', 20),
89
    ),
90
);
91
 
92
/*
93
 * Uncomment at least one of the following elements.
94
 * When running the .phpt tests, the first uncommented element is used.
95
 * When running the multiconnect.php test, all uncommented elements are used.
96
 */
97
$dsns = array(
98
    // 'dbase'    => $dbasedsn,
99
    // 'fbsql'    => 'fbsql://_system:@/db',
100
    // 'firebird' => 'ibase(firebird)://SYSDBA:masterkey@//opt/interbase/examples/employee.gdb?dialect=3',
101
    // 'ifx'      => 'ifx://user:pw@localhost/db',
102
    // 'msql'     => 'msql:///db',
103
 
104
    // It's advisable to use only one of the following at a time:
105
    // 'mssql'    => 'mssql://sa@somehost/pubs',
106
    // 'sybase'   => 'sybase://sa@somehost/pubs',
107
 
108
    // 'mysql'    => 'mysql://root@localhost/test',
109
    // 'mysqli'   => 'mysqli://root@localhost/test',
110
    // 'oci8'     => 'oci8://system:manager@',
111
    // 'access'   => 'odbc(access)://admin@/SystemDsnName',
112
    // 'db2'      => 'odbc(db2)://db2inst1:XXXX@/SAMPLE',
113
    // 'pgsql'    => 'pgsql://postgres@localhost/test',
114
    // 'sqlite'   => 'sqlite://dummy:@localhost/' . getcwd() . DIRECTORY_SEPARATOR . 'test.db?mode=0644',
115
);