ephpicman / autoloader
A simple and efficient PSR-4-like autoloader for Ephpic ecosystem.
1.0
2025-11-06 04:03 UTC
Requires
- php: >=8.2
This package is not auto-updated.
Last update: 2025-11-07 20:27:16 UTC
README
A simple and efficient PSR-4-like autoloader for Ephpic ecosystem.
Features
- Namespace-to-directory mapping
- Cache-based resolution for performance
- Fully compatible with WordPress 6.2+ and PHP 8.2+
Installation
- Upload the
ephpic-autoloadfolder to/wp-content/plugins/. - Activate Ephpic Autoloader via the WordPress admin dashboard.
- Add namespaces and base directories using
Autoload::addPrefix($prefix, $baseDir)if needed. - Classes will be autoloaded automatically.
Usage Example
use EphpicMan\Autoloader\Autoload;
// Register a namespace
Autoload::addPrefix('Ephpic\\Core\\', __DIR__ . '/src/core');
// Then you can use any class under that namespace
$service = new \Ephpic\Core\Service();
Naming Rules
- Class names MUST be in PascalCase.
- File names must be in kebab-case.
For example:
Namespace\ClassName resolved to namespace/class-name.php
License
GPL-2.0-or-later — see LICENSE for details.
© 2025 Sina Kuhestani (publishing as Ephpic; ephpic.org)
Support
For questions or issues, please contact sinakuhestani@gmail.com.