/[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.1 by joko, Wed Mar 5 12:04:37 2003 UTC revision 1.3 by joko, Wed Mar 5 15:21:54 2003 UTC
# Line 1  Line 1 
1  <?php  <?php
2  /**  /**
  * --- @about  
  *  
3   * This file contains the DataSource::Locator class.   * This file contains the DataSource::Locator class.
4     *
5   * It acts as a container for DataSource connection   * It acts as a container for DataSource connection
6   * metadata. Think of it as an enhanced dsn.   * metadata. Think of it as an enhanced dsn.
7   *   *
8   * It gets used by DataSource::GenericDataSource   * It gets used by DataSource::Generic
9   * to be informed about the most important stuff it   * to be informed about the most important stuff it
10   * has to do.   * has to do.
11   *   *
12   *   *
  * @author Andreas Motl <andreas.motl@ilo.de>  
13   * @package org.netfrag.glib   * @package org.netfrag.glib
14   * @module DataSource::Locator   * @module DataSource::Locator
15   *   *
# Line 21  Line 19 
19   * $Id$   * $Id$
20   *   *
21   * $Log$   * $Log$
22     * Revision 1.3  2003/03/05 15:21:54  joko
23     * updated docu (phpDocumentor testing....)
24     *
25     * Revision 1.2  2003/03/05 15:01:10  joko
26     * updated docu
27     *
28   * Revision 1.1  2003/03/05 12:04:37  joko   * Revision 1.1  2003/03/05 12:04:37  joko
29   * + initial commit   * + initial commit
30   *   *
# Line 28  Line 32 
32   */   */
33    
34  /**  /**
35   * --- @description   * It helps DataSource::Generic working in different "operation modes".
  *  
  * --- It helps GenericDataSource working in different "operation modes".  
36   *   *
37   *    o Pass-Through-Reference: php Object will get passed through all layers   * o Pass-Through-Reference: php Object will get passed through all layers
38   *    o Pass-Through-Memory: reference to a memory area will get used   * o Pass-Through-Memory: reference to a memory area will get used
39   *    x Build-Locator: build locator from datasource-type and adapter-type   * + Build-Locator: build locator from datasource-type and adapter-type
40   *    o Use-Locator: directly use DataSource::Locator instance passed in   * o Use-Locator: directly use DataSource::Locator instance passed in
41   *    o Merge-Locators: merge metadata of two or more DataSource::Locator instances   * o Merge-Locators: merge metadata of two or more DataSource::Locator instances
42   *    o Build-AutoLocator: use global constants making up our metadata   * o Build-AutoLocator: use global constants making up our metadata
43   *   *
44   *   *
45   * --- It can/should contain (flexible, just some parameters are required for each operation mode)   * <b>It can/should contain (flexible, just some parameters are required for each operation mode)</b>
46   *   *
47   *    o an oldschool "dsn"-string (e.g. for rdbms-connection via PEAR)   * o an oldschool "dsn"-string (e.g. for rdbms-connection via PEAR)
48   *    x 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
49   *       (e.g. DataSource::Proxy::XMLRPC via DesignPattern::RemoteProxy)   *   (e.g. DataSource::Proxy::XMLRPC via DesignPattern::RemoteProxy)
50   *    x 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')
51   *    o an instance of an already instantiated arbitrary datasource handler (e.g. 'source')   * o an instance of an already instantiated arbitrary datasource handler (e.g. 'source')
52   *       this will get propagated (pass-through-mode)   *   this will get propagated (pass-through-mode)
53   *    x a datasource-type (of 'rpc|mysql|csv-file|xml-file')   * + a datasource-type (of 'rpc|mysql|csv-file|xml-file')
54   *        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*
55   *        by the GenericDataSource at runtime   *   by the DataSource::Generic at runtime
56   *    x an adapter-type (of 'phpHtmlLib|pear')   * + an adapter-type (of 'phpHtmlLib|pear')
57   *        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*
58   *        by the GenericDataSource at runtime   *   by the DataSource::Generic at runtime
59   *    o names of global constants where to find these informations   * o names of global constants where to find these informations
60   *    o datasource-type ('rpc|csv-file|...') <-> datasource-family ('orm|rdbms|odbms')   * o datasource-type ('rpc|csv-file|...') <-> datasource-family ('orm|rdbms|odbms')
61   *   *
62   *   *
63   * --- It can do   * --- It can do
64   *    x 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
65   *    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
66   *    o direct fallback mode to some predefined values if just *everything* fails   * o direct fallback mode to some predefined values if just *everything* fails
67   *   *
68   *   *
69   * --- How to use?   * --- How to use?
# Line 77  Line 79 
79   *      [adapter_type => 'phpHtmlLib',]   *      [adapter_type => 'phpHtmlLib',]
80   *      metadata => array( Host => 'localhost', Port => '8765' ),   *      metadata => array( Host => 'localhost', Port => '8765' ),
81   *    );   *    );
82   *    $source = new GenericDataSource($locator);   *    $source = new DataSource::Generic($locator);
83   *    $this->set_data_source( &$source );   *    $this->set_data_source( &$source );
84   *   *
85   *  2. [proposal] for common/oldschool datahandles....   *  2. [proposal] for common/oldschool datahandles....
86   *    $locator = array(   *    $locator = array(
87   *      dsn => 'known dsn markup',   *      dsn => 'known dsn markup',
88   *    );   *    );
89   *    $source = new GenericDataSource($locator);   *    $source = new DataSource::Generic($locator);
90   *    $this->set_data_source( &$source );   *    $this->set_data_source( &$source );
91   *   *
92   *   *
93   *   *
94   * @author Andreas Motl <andreas.motl@ilo.de>   * @author Andreas Motl <andreas.motl@ilo.de>
95     * @link http://www.netfrag.org/~joko/
96   * @copyright (c) 2003 - All Rights reserved.   * @copyright (c) 2003 - All Rights reserved.
  * @license GNU LGPL (GNU Lesser General Public License)  
97   *   *
98   * @author-url http://www.netfrag.org/~joko/   * @license GNU LGPL (GNU Lesser General Public License)
99   * @license-url http://www.gnu.org/licenses/lgpl.txt   * @link http://www.gnu.org/licenses/lgpl.txt
100   *   *
101   * @author Andreas Motl <andreas.motl@ilo.de>   * @subpackage DataSource
102   * @package org.netfrag.glib   * @name DataSource::Locator
103   * @module DataSource::Locator   * @filesource
104   *   *
105   */   */
106    
# Line 171  class DataSource_Locator { Line 173  class DataSource_Locator {
173      // name of an Adapter module      // name of an Adapter module
174      var $_adapter_type;      var $_adapter_type;
175            
176      // additional information required (passed on to the Proxy by GenericDataSource)      // additional information required (passed on to the Proxy by DataSource::Generic)
177      var $_metadata = array();      var $_metadata = array();
178            
179      //var $_dsn;      //var $_dsn;
# Line 285  class DataSource_Locator { Line 287  class DataSource_Locator {
287          $metadata = array(          $metadata = array(
288            //package => 'Data::Driver::Proxy',            //package => 'Data::Driver::Proxy',
289            //package => 'DataSource::Proxy::XMLRPC',            //package => 'DataSource::Proxy::XMLRPC',
290            //package => 'DataSource::GenericDataSource',            //package => 'DataSource::Generic',
291            //package => 'DesignPattern::RemoteProxy',            //package => 'DesignPattern::RemoteProxy',
292            Host => RPC_HOSTNAME,            Host => RPC_HOSTNAME,
293            Port => RPC_PORT,            Port => RPC_PORT,

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

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