/[cvs]/nfo/php/libs/org.netfrag.glib/DataSource/Locator.php
ViewVC logotype

Diff of /nfo/php/libs/org.netfrag.glib/DataSource/Locator.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by joko, Wed Mar 5 15:21:54 2003 UTC revision 1.6 by joko, Wed Mar 5 16:10:08 2003 UTC
# Line 10  Line 10 
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   *   *
# Line 19  Line 20 
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
30     * updated docu (phpDocumentor testing....)
31     *
32   * Revision 1.3  2003/03/05 15:21:54  joko   * Revision 1.3  2003/03/05 15:21:54  joko
33   * updated docu (phpDocumentor testing....)   * updated docu (phpDocumentor testing....)
34   *   *
# Line 34  Line 44 
44  /**  /**
45   * It helps DataSource::Generic working in different "operation modes".   * It helps DataSource::Generic working in different "operation modes".
46   *   *
47   * o Pass-Through-Reference: php Object will get passed through all layers   * - Pass-Through-Reference: php Object will get passed through all layers
48   * o Pass-Through-Memory: reference to a memory area will get used   * - Pass-Through-Memory: reference to a memory area will get used
49   * + Build-Locator: build locator from datasource-type and adapter-type   * + Build-Locator: build locator from datasource-type and adapter-type
50   * o Use-Locator: directly use DataSource::Locator instance passed in   * - Use-Locator: directly use DataSource::Locator instance passed in
51   * o Merge-Locators: merge metadata of two or more DataSource::Locator instances   * - Merge-Locators: merge metadata of two or more DataSource::Locator instances
52   * o 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>
55   * <b>It can/should contain (flexible, just some parameters are required for each operation mode)</b>   *
56   *   * <pre>
57   * o an oldschool "dsn"-string (e.g. for rdbms-connection via PEAR)   * (flexible, just some parameters are required for each operation mode)
58     * - 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
60   *   (e.g. DataSource::Proxy::XMLRPC via DesignPattern::RemoteProxy)   *   (e.g. DataSource::Proxy::XMLRPC via DesignPattern::RemoteProxy)
61   * + metadata (a hash) directly describing *where* to connect to (e.g. 'Host', 'Port')   * + metadata (a hash) directly describing *where* to connect to (e.g. 'Host', 'Port')
62   * o an instance of an already instantiated arbitrary datasource handler (e.g. 'source')   * - an instance of an already instantiated arbitrary datasource handler (e.g. 'source')
63   *   this will get propagated (pass-through-mode)   *   this will get propagated (pass-through-mode)
64   * + a datasource-type (of 'rpc|mysql|csv-file|xml-file')   * - a datasource-type (of 'rpc|mysql|csv-file|xml-file')
65   *   this will be mapped to a module name and used as a *Proxy*   *   this will be mapped to a module name and used as a *Proxy*
66   *   by the DataSource::Generic at runtime   *   by the DataSource::Generic at runtime
67   * + an adapter-type (of 'phpHtmlLib|pear')   * + an adapter-type (of 'phpHtmlLib|pear')
68   *   this will be mapped to a module name and used as an *Adapter*   *   this will be mapped to a module name and used as an *Adapter*
69   *   by the DataSource::Generic at runtime   *   by the DataSource::Generic at runtime
70   * o names of global constants where to find these informations   * - names of global constants where to find these informations
71   * o 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   * --- It can do   * <b>It can do</b>
76   * + builds a larger locator from a minimum of information passed in via constructor-arguments   * + builds a larger locator from a minimum of information passed in via constructor-arguments
77   * o direct fallback mode to some predefined constant names if locator is empty and above method fails   * o direct fallback mode to some predefined constant names if locator is empty and above method fails
78   * o direct fallback mode to some predefined values if just *everything* fails   * o direct fallback mode to some predefined values if just *everything* fails
79   *   *
80   *   *
81   * --- How to use?   * <b>How to use?</b>
82   *   *
83   * Pass an array holding "locator metadata" to the constructor.   * Pass an array holding "locator metadata" to the constructor.
84   * This module takes care of the rest.   * This module takes care of the rest.
# Line 74  Line 86 
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',]
# Line 81  Line 94 
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   *   *
# Line 98  Line 114 
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   *   *
# Line 113  class DataSource_Locator { Line 128  class DataSource_Locator {
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(
# Line 126  class DataSource_Locator { Line 142  class DataSource_Locator {
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(
# Line 141  class DataSource_Locator { Line 161  class DataSource_Locator {
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          /**          /**
# Line 183  class DataSource_Locator { Line 209  class DataSource_Locator {
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();
# Line 260  class DataSource_Locator { Line 285  class DataSource_Locator {
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       *       *

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.6

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed