v5:userguide:learn_extensions:new_driver
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
v5:userguide:learn_extensions:new_driver [2016/03/19 01:36] – ↷ Page moved and renamed from v5:userguide:extending to v5:userguide:learn_extensions:new_driver mnewnham | v5:userguide:learn_extensions:new_driver [2020/01/15 03:47] – [Understanding The Data Provider] mnewnham | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | <- v5: | + | <- ^ v5: |
~~NOTOC~~ | ~~NOTOC~~ | ||
====== Creating A New Driver ====== | ====== Creating A New Driver ====== | ||
Line 34: | Line 34: | ||
* The driver **must** be located in the ADODB_DIR directory. Take care that the driver is not lost when upgrading | * The driver **must** be located in the ADODB_DIR directory. Take care that the driver is not lost when upgrading | ||
* No other action is required, simply enter the name of the new driver in the newAdoConnection() statement. | * No other action is required, simply enter the name of the new driver in the newAdoConnection() statement. | ||
+ | |||
+ | ===== Understanding The Data Provider ===== | ||
+ | Because ADOdb V5 is not truly Object Orientated, an extended driver does not necessarily extend the required parent. One might expect to see the following chain of code: | ||
+ | |||
+ | <code php> | ||
+ | |||
+ | class ADOnewConnection | ||
+ | class mysql extends ADOnewConnection | ||
+ | class mysqli extends mysql | ||
+ | |||
+ | </ | ||
+ | But if we look at the source code of the [[v5: | ||
+ | |||
+ | <code php> | ||
+ | |||
+ | class ADODB_mysqli extends ADOConnection { | ||
+ | var $databaseType = ' | ||
+ | var $dataProvider = ' | ||
+ | |||
+ | </ | ||
+ | |||
+ | So the class extends the connector, but much of the MySQL specific functionality is found in the **// | ||
+ | |||
+ | <code php> | ||
+ | class ADODB_mydriver extends ADOConnection { | ||
+ | var $databaseType = ' | ||
+ | var $dataProvider = ' | ||
+ | |||
+ | </ | ||
+ | ===== Base Level Classes ===== | ||
+ | If we look at say, the [[v5: | ||
+ | |||
+ | <code php> | ||
+ | class ADODB_mssqlnative extends ADOConnection { | ||
+ | var $databaseType = ' | ||
+ | var $dataProvider = ' | ||
+ | |||
+ | </ | ||
+ | |||
+ | In this case, the **$databaseType** and the **$dataProvider** are the same. This means that all of the functionality of the driver is provided by the named driver (**drivers/ | ||
v5/userguide/learn_extensions/new_driver.txt · Last modified: 2020/01/15 04:13 by mnewnham