CodeIgniter Forums
Expanded driver mechanism? - Printable Version

+- CodeIgniter Forums (
+-- Forum: CodeIgniter 4 (
+--- Forum: CodeIgniter 4 Feature Requests (
+--- Thread: Expanded driver mechanism? (/showthread.php?tid=61375)

Expanded driver mechanism? - jlp - 04-11-2015

Should the CI3 driver mechanism be beefed up to support additional kinds of things, like template engines ?
Granted, template engines might be a poor example, as no two have the same interface.
The driver mechanism works well for databases and sessions ... what else could it be used as a pattern for?

Disclaimer: Putting forward an idea without implying any endorsement of it.

RE: Expanded driver mechanism? - ivantcholakov - 04-11-2015

For parsers.


email, translations (file or database based for example), maybe the Image library.

I saw a scheme with added abstraction - something that is called "bridge" between (external?) components. I don't know whether it is sane enough.

I would use for now the term "driver" also for APIs that abstract the application from APIs of external components, installed with Composer or whatever other way. IMO it would be a good rule APIs of the external components with important common purpose (parsers, email) not to be used directly, but through interfaces provided by CodeIgniter. That would make external components replaceable.

RE: Expanded driver mechanism? - mwhitney - 04-13-2015

It would be nice if the pattern were better documented, and perhaps more consistently implemented (and if drivers were more easily extended). It's difficult to see much commonality between the implementation of drivers for the database and for sessions.

I implemented a simple authentication/authorization "driver" system and one to replace the form library for Bonfire (neither of which I ever really got around to integrating into Bonfire). More recently, I implemented a driver system for the library used to convert Markdown/CommonMark documents in Bonfire's docs module.

Almost anything which allows for a (relatively) simple interface, potentially including template libraries, can be implemented like this, it's just a matter of whether it is actually useful for the specific feature and what impact it might have on the overall performance of that feature.