Skip to content
This repository
tree: c79ad79cb5
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 69 lines (63 sloc) 2.778 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
<?php
/**
* @author Jonathan Moss <xirisr@gmail.com>
* @copyright Jonathan Moss 2010
*/
Phar::mapPhar();

/**
* Autoloader for the morph package
*
*/
class MorphAutoloader
{

    /**
* A static array of classes
*
* @var array
*/
    private static $classes = array(
        'Morph_Collection' => 'phar://Morph/Collection.php',
        'Morph_Utils' => 'phar://Morph/Utils.php',
        'Morph_Iterator' => 'phar://Morph/Iterator.php',
        'Morph_Compare_NumericProperty' => 'phar://Morph/Compare/NumericProperty.php',
        'Morph_Compare_Property' => 'phar://Morph/Compare/Property.php',
        'Morph_PropertySet' => 'phar://Morph/PropertySet.php',
        'Morph_Query' => 'phar://Morph/Query.php',
        'Morph_Object' => 'phar://Morph/Object.php',
        'Morph_ICompare' => 'phar://Morph/ICompare.php',
        'Morph_Property_HasMany' => 'phar://Morph/Property/HasMany.php',
        'Morph_Property_Date' => 'phar://Morph/Property/Date.php',
        'Morph_Property_ComposeMany' => 'phar://Morph/Property/ComposeMany.php',
        'Morph_Property_HasOne' => 'phar://Morph/Property/HasOne.php',
        'Morph_Property_Enum' => 'phar://Morph/Property/Enum.php',
        'Morph_Property_Integer' => 'phar://Morph/Property/Integer.php',
        'Morph_Property_File' => 'phar://Morph/Property/File.php',
        'Morph_Property_Float' => 'phar://Morph/Property/Float.php',
        'Morph_Property_ComposeOne' => 'phar://Morph/Property/ComposeOne.php',
        'Morph_Property_String' => 'phar://Morph/Property/String.php',
        'Morph_Property_Generic' => 'phar://Morph/Property/Generic.php',
        'Morph_Query_Property' => 'phar://Morph/Query/Property.php',
        'Morph_Storage' => 'phar://Morph/Storage.php',
        'Morph_Format_Collection' => 'phar://Morph/Format/Collection.php',
        'Morph_Enum' => 'phar://Morph/Enum.php',
        'Morph_Exception_ObjectNotFound' => 'phar://Morph/Exception/ObjectNotFound.php',
    );

    /**
* class loader
*
* @param string $className
* @return boolean
*/
    public static function load($className)
    {
        $isLoaded = false;
        if (isset(self::$classes[$className])) {
            include self::$classes[$className];
            $isLoaded = true;
        }
        return $isLoaded;
    }

}

//register the autoloader
spl_autoload_register(array('MorphAutoloader', 'load'));

__HALT_COMPILER();
Something went wrong with that request. Please try again.