BaseDCD gives a simple framework on which all Dynamic Content Drivers should be based. It may be inherited by any Dynamic Content Driver that wishes to pick up its generic methods as a starting point for development.
The driver framework is modelled after the Unix device driver API, which is a simple I/O framework that is easy to understand, and which will already be familiar to many programmers.
There are 3 standard methods used by all drivers:
Although DCDs may define other methods for internal use, only the above three methods can be invoked directly by means of CMS tags. The above three methods may be thought of as the public driver methods.
The BaseDCD defines a set of generic DCD methods that can be
inherited by more advanced DCDs. Generally speaking, the new()
constructor method is generic and may be reused by all DCDs. The
read() method is fairly versatile, and should be adequate for parsing
most URLs and form input. The write() method will almost certainly
need to be replaced with something appropriate to the DCD, as it is
the workhorse method in any CMS environment. The ioctl() method,
while nominally useful here, serves more as an example of ioctl()
programming than as a useful piece of code.
In addition, the BaseDCD class defines a small set of utility functions that have proven to be generally useful for Plug-in development.