qycloud/classloader

Auto loading the missing class while the file's name starts with lowercase char

Installs: 950

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/qycloud/classloader

v1.0 2015-05-19 06:37 UTC

This package is not auto-updated.

Last update: 2025-10-25 23:11:15 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": "*"
    }
}

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