Download the PHP package kodhe/driver without Composer
On this page you can find all versions of the php package kodhe/driver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package driver
Kodhe Driver Library - PSR-4 Compatible Driver System for CodeIgniter 3
A refactored, modular driver library system for CodeIgniter 3 with PSR-4 autoloading and modern design patterns.
๐ Structure
โจ Features
- PSR-4 Autoloading - Namespace
Kodhe\Driver\ - PSR-12 Coding Standards - Clean code style
- Design Patterns:
- Registry Pattern (instance caching)
- Factory Pattern (driver instantiation)
- Proxy/Delegation Pattern (magic methods)
- Template Method Pattern (abstract driver)
- Null Object Pattern (fallback driver)
- Dependency Injection - Resolver and registry are injected via the constructor
- Performance Optimized:
- Path caching for file lookup
- Instance caching per request
- Lazy loading drivers
- 100% Backward Compatible - The CI3 API keeps working
๐ง Installation
Or add it to composer.json:
๐ Usage
Creating a Multi-Driver Library
Creating a Driver
Using It in a Controller
๐ฏ Design Patterns
Registry Pattern
Null Object Pattern
Dependency Injection
๐งช Testing
๐ Comparison
| Area | Before (CI3 native) | After (Kodhe\Driver) |
|---|---|---|
| Structure | 2 monolithic classes | Modular (8+ components) |
| Namespace | None | PSR-4 Kodhe\Driver\ |
| Testing | Hard (hardcoded paths) | Easy (DI + interfaces) |
| Caching | Manual per library | Built-in registry |
| Extensibility | Hard | Easy (implement an interface) |
| PSR compliance | None | PSR-4, PSR-12 |
๐ Backward Compatibility
All features of the CI3 driver system keep working:
- โ
extends CI_Driver_Libraryโextends DriverLibrary - โ
extends CI_Driverโextends AbstractDriver - โ
$this->lib->driver_name->method() - โ
$this->parent->method()from within a driver - โ
The
valid_driversandlib_nameproperties - โ
Magic methods
__get,__call
Class aliases are available for full backward compatibility:
๐ License
MIT License - see LICENSE for details.
All versions of driver with dependencies
PHP Build Version
Package Version
Requires
php Version
^7.4 || ^8.0
The package kodhe/driver contains the following files
Loading the files please wait ...