ephpicman/autoloader

A simple and efficient PSR-4-like autoloader for Ephpic ecosystem.

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

pkg:composer/ephpicman/autoloader

1.0 2025-11-06 04:03 UTC

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

  1. Upload the ephpic-autoload folder to /wp-content/plugins/.
  2. Activate Ephpic Autoloader via the WordPress admin dashboard.
  3. Add namespaces and base directories using Autoload::addPrefix($prefix, $baseDir) if needed.
  4. 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

  1. Class names MUST be in PascalCase.
  2. 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.