2017 © Pedro Peláez
 

library loader

Mozart Class Loader

image

mozart/loader

Mozart Class Loader

  • Monday, September 16, 2013
  • by faizalpribadi
  • Repository
  • 0 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Mozart - Class Loader

Latest Stable Version - Build Status, (*1)

Mozart Class Loader Extending API Core Component Of "ClassLoader" From Symfony2, (*2)

installation with composer

$ curl -s http://getcomposer.org/installer | php
$ php composer.phar require mozart/loader   // next typing "dev-master"

installation with git

$ git clone https://github.com/FaizalPribadi/Loader.git /path/to/your-vendor/Loader

usage

<?php
function findFile($file)
{
    if (file_exists($file)) {
        return @include $file;
    }

    throw new \Exception(sprintf('The file "%s" not found', $file));
}

findFile(__DIR__ . '/Framework/Mozart/Library/Loader/ClassLoader.php');
findFile(__DIR__ . '/Vendors/Symfony/Component/ClassLoader/UniversalClassLoader.php');

use Mozart\Library\Loader\ClassLoader;
use Doctrine\Common\Annotations\AnnotationRegistry;
use Mozart\Library\Cache\Driver\OpCache\Apc;

$loader = ClassLoader::bootstrap();
$loader->mapClass(array(
        'Mozart'        => __DIR__ . '/Framework',
        'Doctrine'      => __DIR__ . '/Vendors',
        'Symfony'       => __DIR__ . '/Vendors',
        'Psr'           => __DIR__ . '/Vendors',
        'Monolog'       => __DIR__ . '/Vendors',
        'Metadata'      => __DIR__ . '/Vendors/JMS/Metadata/src',
    ));
$loader->register();
$loader->setCache(new \Mozart\Library\Cache\Cache(new Apc()));
$loader->enableCache(true);


//TODO enable annotations parsing
AnnotationRegistry::registerLoader(function($class) use ($loader) {
        $loader->findClassFile($class);

        return class_exists($class, true);
    });
AnnotationRegistry::registerFile(__DIR__ . '/Vendors/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');

The Versions

16/09 2013

dev-master

9999999-dev http://faizalpribadi.github/Loader

Mozart Class Loader

  Sources   Download

MIT

The Requires

 

loader namespace class-loader

05/07 2013

v0.1.1

0.1.1.0 http://faizalpribadi.github/Loader

Mozart Class Loader

  Sources   Download

MIT

The Requires

 

loader namespace class-loader

18/06 2013

v0.1.0

0.1.0.0 http://faizalpribadi.github/Loader

Mozart Class Loader

  Sources   Download

MIT

The Requires

  • php >=5.3.10

 

The Development Requires

loader namespace class-loader