12 |
* $Id$ |
* $Id$ |
13 |
* |
* |
14 |
* $Log$ |
* $Log$ |
15 |
|
* Revision 1.4 2003/03/10 23:25:03 joko |
16 |
|
* + fixed metadata for phpDocumentor |
17 |
|
* |
18 |
|
* Revision 1.3 2003/03/09 15:50:36 joko |
19 |
|
* + additional metadata for Autodia |
20 |
|
* |
21 |
* Revision 1.2 2003/03/05 17:28:43 joko |
* Revision 1.2 2003/03/05 17:28:43 joko |
22 |
* updated docu (phpDocumentor testing....) |
* updated docu (phpDocumentor testing....) |
23 |
* |
* |
162 |
* type => 'rpc', |
* type => 'rpc', |
163 |
* metadata => array( Host => 'localhost', Port => '8765' ), |
* metadata => array( Host => 'localhost', Port => '8765' ), |
164 |
* ); |
* ); |
165 |
* $source = new GenericDataSource($locator); |
* $source = ne w GenericDataSource($locator); |
166 |
* $this->set_data_source( &$source ); |
* $this->set_data_source( &$source ); |
167 |
* </code> |
* </code> |
168 |
* |
* |
172 |
* type => 'mysql', |
* type => 'mysql', |
173 |
* dsn => 'known dsn markup', |
* dsn => 'known dsn markup', |
174 |
* ); |
* ); |
175 |
* $source = new GenericDataSource($locator); |
* $source = ne w GenericDataSource($locator); |
176 |
* $this->set_data_source( &$source ); |
* $this->set_data_source( &$source ); |
177 |
* </code> |
* </code> |
178 |
* |
* |
192 |
* @subpackage DataSource |
* @subpackage DataSource |
193 |
* @name DataSource::Generic |
* @name DataSource::Generic |
194 |
* |
* |
195 |
* @todo |
* @todo this: |
196 |
|
* |
197 |
* <ul> |
* <ul> |
198 |
* o mungle this to be able to be wrapped around phpHtmlLib's own storage-handles |
* o mungle this to be able to be wrapped around phpHtmlLib's own storage-handles |
199 |
* o implement another Data::Driver::Proxy container |
* o implement another Data::Driver::Proxy container |
200 |
* </ul> |
* </ul> |
201 |
* |
* |
202 |
|
* !!!!!!!! THIS IS THE PROBLEM !!!!!!!! |
203 |
// !!!!!!!! THIS IS THE PROBLEM !!!!!!!! |
* !!!!!!!! here is it where we have to break inheritance again !!!!!!!! |
204 |
// !!!!!!!! here is it where we have to break inheritance again !!!!!!!! |
* |
205 |
// |
* THE CONFLICT: Beeing in phpHtmlLib *and* DesignPattern::TransparentProxy |
206 |
// THE CONFLICT: Beeing in phpHtmlLib *and* DesignPattern::TransparentProxy |
* inheritance trees at the same time, which is *not* possible at |
207 |
// inheritance trees at the same time, which is *not* possible at |
* declare-time. We *do* need some runtime-infrastructure to solve this! |
208 |
// declare-time. We *do* need some runtime-infrastructure to solve this! |
* |
209 |
// |
* TODO: move build- and check-locator stuff from ObjectList to this place!!! |
210 |
// TODO: move build- and check-locator stuff from ObjectList to this place!!! |
* |
211 |
// |
* ABOUT: |
212 |
// ABOUT: |
* 1. otherwhere: WebApp - scope: |
213 |
// 1. otherwhere: WebApp - scope: |
* x handles page vs. block vs. widget; dispatches MVC-View |
214 |
// x handles page vs. block vs. widget; dispatches MVC-View |
* 2. here: DataSource - scope: |
215 |
// 2. here: DataSource - scope: |
* x handles bridge to frameworks (e.g. phpHtmlLib) vs. actual data driver libs (PEAR, etc.)) |
216 |
// x handles bridge to frameworks (e.g. phpHtmlLib) vs. actual data driver libs (PEAR, etc.)) |
* o clean implementation using a DesignPattern::AdapterProxy |
217 |
// o clean implementation using a DesignPattern::AdapterProxy |
* |
218 |
// |
* |
219 |
|
*/ |
|
*/ |
|
220 |
class DataSource_Generic extends DesignPattern_AdapterProxy { |
class DataSource_Generic extends DesignPattern_AdapterProxy { |
221 |
|
|
222 |
// !!!!!!!! here is it where we have to break inheritance again !!!!!!!! |
// !!!!!!!! here is it where we have to break inheritance again !!!!!!!! |
332 |
//$this->_locator->_datasource_type = $query[datasource]; |
//$this->_locator->_datasource_type = $query[datasource]; |
333 |
//$locator[_datasource_type] = $query[datasource]; |
//$locator[_datasource_type] = $query[datasource]; |
334 |
|
|
335 |
|
/** |
336 |
|
* <!-- Autodia --> |
337 |
|
* can do: (this is metadata supplied for Autodia, don't delete!) |
338 |
|
* $this->_locator = new DataSource_Locator() |
339 |
|
* |
340 |
|
*/ |
341 |
|
|
342 |
// build master locator |
// build master locator |
343 |
$this->_locator = php::mkComponent('DataSource::Locator', $locator, array( datasource_type => $query[datasource] ) ); |
$this->_locator = php::mkComponent('DataSource::Locator', $locator, array( datasource_type => $query[datasource] ) ); |
344 |
//exit; |
//exit; |
385 |
//exit; |
//exit; |
386 |
|
|
387 |
|
|
388 |
|
/** |
389 |
|
* <!-- Autodia --> |
390 |
|
* can do: (this is metadata supplied for Autodia, don't delete!) |
391 |
|
* $proxy = new DesignPattern_RemoteProxy() |
392 |
|
* |
393 |
|
*/ |
394 |
|
|
395 |
|
|
396 |
// --- Proxy selector/dispatcher ... |
// --- Proxy selector/dispatcher ... |
397 |
|
|
398 |
switch ($this->_locator->_datasource_type) { |
switch ($this->_locator->_datasource_type) { |
488 |
// $this->create_handler(); |
// $this->create_handler(); |
489 |
|
|
490 |
|
|
491 |
|
/** |
492 |
|
* <!-- Autodia --> |
493 |
|
* can do: (this is metadata supplied for Autodia, don't delete!) |
494 |
|
* $adapter = new DataSource_Adapter_phpHtmlLib_DataListSource() |
495 |
|
* |
496 |
|
*/ |
497 |
|
|
498 |
// V1: |
// V1: |
499 |
//$this->create_adapter($adapter_module, $this->function, $this->arguments); |
//$this->create_adapter($adapter_module, $this->function, $this->arguments); |
500 |
|
|