Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
XML_Query2XML
2
=============
3
Version: $Id: README 257890 2008-04-19 09:36:04Z lukasfeiler $
4
 
5
1. Overview
6
2. Contents of this package
7
3. Testing
8
4. ChangeLog
9
5. About the author
10
6. Copyright Notice
11
 
12
 
13
1. Overview
14
-----------
15
XML_Query2XML allows you to transform the records retrieved
16
with one or more SQL SELECT queries into XML data. Very simple
17
to highly complex transformations are supported. Is was written
18
with performance in mind and can handel large amounts of data.
19
 
20
Another thing you will find useful is XML_Query2XML's capabilities
21
of Profiling and Performance Tuning.
22
 
23
 
24
2. Contents of this package
25
---------------------------
26
+---cases ............... Case studies; will be installed in $PHP_PEAR_DOC_DIR
27
¦   +---case01 .......... Case 01: simple SELECT with getFlatXML
28
¦   +---case02 .......... Case 02: LEFT JOIN
29
¦   +---case03 .......... Case 03: Two SELECTs instead of a LEFT JOIN
30
¦   +---case04 .......... Case 04: Case 03 with all the bells and whistles
31
¦   +---case05 .......... Case 05: three LEFT JOINs
32
|   +---case06 .......... Case 06: BIG join over 10 tables
33
|   +---case07 .......... Case 07: Case 03 revisited: Simplifications with
34
|   |                     Asterisk Shortcuts
35
|   +---case08 .......... Case 08: Case 06 revisited: Making use of Mappers
36
+---XML ................. CONTAINS THE ACTUAL Query2XML.php that
37
|                         will be installed in $PHP_PEAR_INSTALL_DIR/XML/
38
+---tests ............... contains 239 phpt unit tests; all will be installed
39
                          in $PHP_PEAR_TEST_DIR/XML_Query2XML/tests. Please
40
                          see 3. Testing.
41
 
42
 
43
3. Testing
44
----------
45
XML_Query2XML can be tested with different drivers and different data sources
46
(databases and LDAP directories). The most straightforward way to run the unit
47
tests is by using the following command:
48
 
49
 `pear run-tests -p XML_Query2XML'
50
 
51
This will use the MDB2 driver with an SQLite 2 database. For LDAP functionality
52
the Net_LDAP2 driver will be used to access an LDAP directory on
53
localhost, port=389, version=3, starttls=0 without a binddn or bindpw.
54
 
55
To change the above mentioned behaviour you can use the following environment variables.
56
(Note: make sure the php.ini setting 'variables_order' also contains 'E' for Environment.)
57
- PHP_PEAR_XML_QUERY2XML_TEST_DBLAYER: the name of the database abstraction layer
58
  (and corresponding driver) to use. Valid values are 'MDB2', 'DB', 'PDO', 'ADOdbDefault',
59
  'ADOdbException' and 'ADOdbPEAR'. The default is 'MDB2'.
60
- PHP_PEAR_XML_QUERY2XML_TEST_DSN: the DSN to connect to the database. Please see
61
  http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php for the format
62
  to use. Examples would be
63
  * mysql://root@localhost/Query2XML_Tests
64
  * pgsql://postgres:test@localhost/query2xml_tests
65
  * sqlite:///$PHP_PEAR_TEST_DIR/XML_Query2XML/tests/Query2XML_Tests.sq2
66
  The default is the last mentioned example - this should work out of the box
67
  on most systems.
68
- PHP_PEAR_XML_QUERY2XML_TEST_LDAPLAYER: whether to use PEAR Net_LDAP or
69
  PEAR Net_LDAP2. Valid values are 'LDAP' and 'LDAP2'. The default is 'LDAP2'.
70
- PHP_PEAR_XML_QUERY2XML_TEST_LDAPCONFIG: a comma separated list of key
71
  value pairs that specify how to connect to the LDAP directory. Please
72
  see http://pear.php.net/manual/en/package.networking.net-ldap.connecting.php
73
  for a list of valid keys. The default is
74
  host=localhost,port=389,version=3,starttls=0,binddn=,bindpw=
75
 
76
If you want to run the unit tests with MySQL or PostgreSQL, you need to:
77
- run the MySQL DDL from $PHP_PEAR_TEST_DIR/XML_Query2XML/tests/Query2XML_Tests.sql:
78
   `mysql -u root -p < $PHP_PEAR_TEST_DIR/XML_Query2XML/tests/Query2XML_Tests.sql`
79
  or the PostgreSQL DDL from $PHP_PEAR_TEST_DIR/XML_Query2XML/tests/Query2XML_Tests.psql:
80
   `psql -U postgres < $PHP_PEAR_TEST_DIR/XML_Query2XML/tests/Query2XML_Tests.psql`
81
- Set the environment variable PHP_PEAR_XML_QUERY2XML_TEST_DSN (see above).
82
 
83
After installation $PHP_PEAR_TEST_DIR/XML_Query2XML/tests will contain the following
84
(all paths relative to $PHP_PEAR_TEST_DIR/XML_Query2XML/tests):
85
 
86
./Query2XML_Tests.sql ........... the MySQL DDL required to run the unit tests
87
./Query2XML_Tests.psql .......... the PosgreSQL DDL required to run the unit tests
88
./Query2XML_Tests.sq2 ........... the SQLite 2 database used by default
89
./XML_Query2XML_ISO9075Mapper ... unit tests for XML_Query2XML_ISO9075Mapper
90
./XML_Query2XML/ ................ phpt unit tests for XML_Query2XML
91
./XML_Query2XML/AllDBLayers ..... phpt unit tests for XML_Query2XML using database
92
                                  related drivers
93
./XML_Query2XML/LDAP ............ phpt unit tests for XML_Query2XML using Net_LDAP
94
                                  or Net_LDAP2
95
./XML_Query2XML/NoDBLayer ....... phpt unit tests not using any driver
96
 
97
Each of the ./XML_Query2XML/*/ directories contains subdirectories named
98
like the class methods; the directories contain phpt unit tests for
99
the respective method.
100
 
101
If a specific database or LDAP directory abstraction layer
102
(MDB2/DB/ADOdb/PDO/Net_LDAP/Net_LDAP2) is not installed
103
the respective tests will be skipped. If I18N_UnicodeString is not installed
104
all tests for XML_Query2XML_ISO9075Mapper will be skipped. Also all tests
105
that require a database or LDAP connection will be skipped if the connection
106
fails.
107
 
108
 
109
4. ChangeLog
110
------------
111
Beginning with v0.6.0 the development of XML_Query2XML was moved from sourceforge.net
112
to cvs.php.net. Therefore you will find two ChangeLog files:
113
 
114
ChangeLog-until-v0.6.0 ....... ChangeLog entries from cvs.sourceforge.net
115
                               (until v0.6.0)
116
ChangeLog .................... ChangeLog entries from cvs.php.net
117
 
118
 
119
5. About the author
120
-------------------
121
Please see http://www.lukasfeiler.com or write to lukas.feiler@lukasfeiler.com.
122
 
123
 
124
6. Copyright Notice
125
-------------------
126
Copyright 2006 Lukas Feiler
127
 
128
LICENSE:
129
This source file is subject to version 2.1 of the LGPL
130
that is bundled with this package in the file LICENSE.