| 10 |
* has to do. |
* has to do. |
| 11 |
* |
* |
| 12 |
* |
* |
| 13 |
|
* @author Andreas Motl <andreas.motl@ilo.de> |
| 14 |
* @package org.netfrag.glib |
* @package org.netfrag.glib |
| 15 |
* @module DataSource::Locator |
* @module DataSource::Locator |
| 16 |
* |
* |
| 20 |
* $Id$ |
* $Id$ |
| 21 |
* |
* |
| 22 |
* $Log$ |
* $Log$ |
| 23 |
|
* Revision 1.6 2003/03/05 16:10:08 joko |
| 24 |
|
* updated docu (phpDocumentor testing....) |
| 25 |
|
* |
| 26 |
|
* Revision 1.5 2003/03/05 15:40:39 joko |
| 27 |
|
* updated docu (phpDocumentor testing....) |
| 28 |
|
* |
| 29 |
* Revision 1.4 2003/03/05 15:26:23 joko |
* Revision 1.4 2003/03/05 15:26:23 joko |
| 30 |
* updated docu (phpDocumentor testing....) |
* updated docu (phpDocumentor testing....) |
| 31 |
* |
* |
| 52 |
* - Build-AutoLocator: use global constants making up our metadata |
* - Build-AutoLocator: use global constants making up our metadata |
| 53 |
* |
* |
| 54 |
* <b>It can/should contain:</b> |
* <b>It can/should contain:</b> |
| 55 |
|
* |
| 56 |
|
* <pre> |
| 57 |
* (flexible, just some parameters are required for each operation mode) |
* (flexible, just some parameters are required for each operation mode) |
| 58 |
* - an oldschool "dsn"-string (e.g. for rdbms-connection via PEAR) |
* - an oldschool "dsn"-string (e.g. for rdbms-connection via PEAR) |
| 59 |
* + name of a Proxy module to use to *wrap/hide* the connection/transport-layer |
* + name of a Proxy module to use to *wrap/hide* the connection/transport-layer |
| 69 |
* by the DataSource::Generic at runtime |
* by the DataSource::Generic at runtime |
| 70 |
* - names of global constants where to find these informations |
* - names of global constants where to find these informations |
| 71 |
* - datasource-type ('rpc|csv-file|...') <-> datasource-family ('orm|rdbms|odbms') |
* - datasource-type ('rpc|csv-file|...') <-> datasource-family ('orm|rdbms|odbms') |
| 72 |
|
* </pre> |
| 73 |
* |
* |
| 74 |
* |
* |
| 75 |
* <b>It can do</b> |
* <b>It can do</b> |
| 86 |
* Pass an array to the constructor: (e.g.) |
* Pass an array to the constructor: (e.g.) |
| 87 |
* |
* |
| 88 |
* 1. for doing rpc-calls.... |
* 1. for doing rpc-calls.... |
| 89 |
|
* <code> |
| 90 |
* $locator = array( |
* $locator = array( |
| 91 |
* datasource_type => 'rpc', |
* datasource_type => 'rpc', |
| 92 |
* [adapter_type => 'phpHtmlLib',] |
* [adapter_type => 'phpHtmlLib',] |
| 94 |
* ); |
* ); |
| 95 |
* $source = new DataSource::Generic($locator); |
* $source = new DataSource::Generic($locator); |
| 96 |
* $this->set_data_source( &$source ); |
* $this->set_data_source( &$source ); |
| 97 |
|
* </code> |
| 98 |
* |
* |
| 99 |
* 2. [proposal] for common/oldschool datahandles.... |
* 2. [proposal] for common/oldschool datahandles.... |
| 100 |
|
* <code> |
| 101 |
* $locator = array( |
* $locator = array( |
| 102 |
* dsn => 'known dsn markup', |
* dsn => 'known dsn markup', |
| 103 |
* ); |
* ); |
| 104 |
* $source = new DataSource::Generic($locator); |
* $source = new DataSource::Generic($locator); |
| 105 |
* $this->set_data_source( &$source ); |
* $this->set_data_source( &$source ); |
| 106 |
|
* </code> |
| 107 |
* |
* |
| 108 |
* |
* |
| 109 |
* |
* |
| 114 |
* @license GNU LGPL (GNU Lesser General Public License) |
* @license GNU LGPL (GNU Lesser General Public License) |
| 115 |
* @link http://www.gnu.org/licenses/lgpl.txt |
* @link http://www.gnu.org/licenses/lgpl.txt |
| 116 |
* |
* |
|
* @subpackage DataSource |
|
| 117 |
* @name DataSource::Locator |
* @name DataSource::Locator |
| 118 |
* @filesource |
* @filesource |
| 119 |
* |
* |
| 128 |
* using metadata from $_options and some |
* using metadata from $_options and some |
| 129 |
* other presets. |
* other presets. |
| 130 |
* |
* |
| 131 |
* See '_buildLocator' which acts as a dispatcher |
* @see function build, which acts as a dispatcher |
| 132 |
* depending on $_options[datasource]. |
* depending on $_options[datasource]. |
| 133 |
* (main dispatching level) |
* (main dispatching level) |
| 134 |
* |
* |
| 135 |
* The structure of a full blown locator looks like this: |
* The structure of a full blown locator looks like this: |
| 136 |
* |
* |
| 137 |
|
* <code> |
| 138 |
* $locator = array( |
* $locator = array( |
| 139 |
* type => '<your type specifying the datasource-type>', |
* type => '<your type specifying the datasource-type>', |
| 140 |
* metadata => array( |
* metadata => array( |
| 142 |
* ), |
* ), |
| 143 |
* [dsn => '<your dsn markup>'], |
* [dsn => '<your dsn markup>'], |
| 144 |
* ); |
* ); |
| 145 |
|
* </code> |
| 146 |
* |
* |
| 147 |
* Example 1 - data is inside a rdbms, using a dsn to connect to it: |
* Example 1 - data is inside a rdbms, using a dsn to connect to it: |
| 148 |
|
* <code> |
| 149 |
* $locator = array( |
* $locator = array( |
| 150 |
* dsn => 'mysql://username:password@localhost/database', |
* dsn => 'mysql://username:password@localhost/database', |
| 151 |
* ); |
* ); |
| 152 |
|
* </code> |
| 153 |
* |
* |
| 154 |
* Example 2 - data is inside an odbms, reachable by doing remote procedure calls (rpc): |
* Example 2 - data is inside an odbms, reachable by doing remote procedure calls (rpc): |
| 155 |
|
* <code> |
| 156 |
* $locator = array( |
* $locator = array( |
| 157 |
* type => 'rpc', |
* type => 'rpc', |
| 158 |
* metadata => array( |
* metadata => array( |
| 161 |
* Port => '8765', |
* Port => '8765', |
| 162 |
* ) |
* ) |
| 163 |
* ); |
* ); |
| 164 |
|
* </code> |
| 165 |
|
* |
| 166 |
|
* @deprecated |
| 167 |
* |
* |
| 168 |
*/ |
*/ |
| 169 |
|
var $_locator_metadata = NULL; |
|
//var $_locator_metadata = NULL; |
|
| 170 |
|
|
| 171 |
|
|
| 172 |
/** |
/** |
| 173 |
* This var holds the arguments passed in to the constructor. |
* This var holds the arguments passed in to the constructor. |
| 174 |
* We will try to build full blown locator metadata information from that. |
* We will try to build full blown locator metadata information from that. |
| 175 |
* |
* |
| 176 |
*/ |
* @deprecated |
| 177 |
//var $_in = NULL; |
* |
| 178 |
|
*/ |
| 179 |
|
var $_in = NULL; |
| 180 |
|
|
| 181 |
/** |
/** |
| 182 |
* This var holds the locator metadata informations inside |
* This var holds the locator metadata informations inside |
| 183 |
* a single hash. This is returned from '->get()'. |
* a single hash. This is returned from '->get()'. |
| 184 |
* |
* |
| 185 |
*/ |
* @deprecated |
| 186 |
//var $_out = NULL; |
* |
| 187 |
|
*/ |
| 188 |
|
var $_out = NULL; |
| 189 |
|
|
| 190 |
|
|
| 191 |
/** |
/** |
| 209 |
* The constructor is used to pass in the |
* The constructor is used to pass in the |
| 210 |
* locator metadata hash. |
* locator metadata hash. |
| 211 |
* |
* |
| 212 |
* @param LocatorMetadataHash array - layout: array( type => '', metadata => '', dsn => '' ) |
* @param object(DataSource::Locator)|hash optional: a &$locator instance |
|
* @param Query array - layout: array( type => '', metadata => '', dsn => '' ) |
|
| 213 |
*/ |
*/ |
| 214 |
function DataSource_Locator() { |
function DataSource_Locator() { |
| 215 |
$args_multi = func_get_args(); |
$args_multi = func_get_args(); |
| 285 |
|
|
| 286 |
/** |
/** |
| 287 |
* Set the locator metadata hash we will feed *partly* |
* Set the locator metadata hash we will feed *partly* |
| 288 |
* to an encapsulated Data::Driver::Proxy instance. |
* to an encapsulated Data::Driver::Proxy instance |
| 289 |
* |
* |
| 290 |
* @param LocatorMetadataHash array - |
* @param LocatorMetadataHash array - |
| 291 |
* |
* |