PHPackages                             corneltek/classmap - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. corneltek/classmap

ActiveLibrary

corneltek/classmap
==================

1.0.2(12y ago)1810.3k1[1 PRs](https://github.com/c9s/ClassMap/pulls)PHPPHP &gt;=5.3.0

Since Nov 8Pushed 8y ago2 watchersCompare

[ Source](https://github.com/c9s/ClassMap)[ Packagist](https://packagist.org/packages/corneltek/classmap)[ RSS](/packages/corneltek-classmap/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

ClassMap Generator
==================

[](#classmap-generator)

ClassMap generator generates classmap hash to improve class loading performance.

Normally, SplClassLoader uses PSR-0 class naming rule and PEAR class naming rule to inspect the class path to autoload class, but this costs a lot when requiring a huge amount of classes.

ClassMap generator generates class file mapping into a pure PHP array file, you can simply require it to find class files.

```
$classMap = require 'class_map.php';
$path = $classMap['PHPUnit'];   // returns path to PHPUnit classfile.
```

We decide to use PHP format as our class map file is that it's pretty easy to include from PHP, and the compiled class map file can be cached by APC.

Requirements
------------

[](#requirements)

- PHP5.3
- Reflection extension.

Install By Composer
-------------------

[](#install-by-composer)

```
$ composer require corneltek/classmap

```

Install By PEAR
---------------

[](#install-by-pear)

```
$ sudo pear install pear.corneltek.com/ClassMap

```

Synopsis
--------

[](#synopsis)

```
$ ./classmap.phar src

```

Which compiles a hash map file like below:

```
