nanjingboy / classloader
Auto loading the missing class while the file's name starts with lowercase char
Installs: 127
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/nanjingboy/classloader
Requires
- php: >=5.4.0
This package is not auto-updated.
Last update: 2025-10-21 07:30:26 UTC
README
ClassLoader:
ClassLoader is a tool to auto loading the missing class while the file's name starts with lowercase char.
Getting Started:
- Create composer.json file in root directory of your application:
{
"require": {
"php": ">=5.4.0",
"nanjingboy/classloader": "*"
}
}
- Install it via composer
Usage Example:
Imagine the following application structure:
application
├── models
│ └─── user.php
If we want to access the class Models\User, we should register a classLoader like this:
<?php require __DIR__ . '/vendor/autoload.php'; $classLoader = new CloassLoader(); $classLoader->addPrefix('Models', __DIR__); $classLoader->register();
License:
MIT