PHP Autoloader Changelog

05/17/2011 Markus Malkusch
  • AutoloaderBuildScript scripts/autoloader-build.php

    Added script for deploying an InstantAutoloader in a project.

05/06/2011 Markus Malkusch
  • AutoloaderIndex_File::saveRaw() Autoloader/index/AutoloaderIndex_File.php

    File based index's rights are set readable for everyone.

  • Autoloader::buildIndex() Autoloader/Autoloader.php

    Dominik Niehus reported a bug in Autoloader::buildIndex(). AbstractAutoloader::normalizeClass() should also be used during building the index.

  • AutoloaderConfiguration::setConfigurationFile() Autoloader/AutoloaderConfiguration.php

    You may set a custom configuration file.

  • InstantAutoloader Autoloader/InstantAutoloader.php

    Instant autoloader as independet autoloader which can use an AutoloaderIndex_PHPArrayCode index.

  • AutoloaderIndex_PHPArrayCode Autoloader/index/AutoloaderIndex_PHPArrayCode.php

    Added comments to the generated PHP-array; So the index starts with <?php, which means that reading of the index changed. An index which was generated before that change is not compatible with the new class. It will lead to a fatal error.

04/20/2011 Markus Malkusch
  • AutoloaderFileParser_Tokenizer::getClassesInSource() Autoloader/parser/AutoloaderFileParser_Tokenizer.php

    Volker von Hoesslin reported a bug when using PHP's "use" keyword. It confused the parser. Added a context to know what tokens are part of the namespace.

  • AutoloaderFileParser_RegExp::getClassesInSource() Autoloader/parser/AutoloaderFileParser_RegExp.php

    Fixed small bug when searching for namespaces.

01/30/2011 Markus Malkusch
  • AutoloaderIndex_Memcache Autoloader/index/AutoloaderIndex_Memcache.php

    Implemented a memcache index

09/05/2010 Markus Malkusch
  • AbstractAutoloader::_callClassConstructor() Autoloader/AbstractAutoloader.php

    An exception in a class constructor leads to an uncaught AutoloaderException_Include_ClassConstructor.

  • Autoloader::_initMembers() Autoloader/Autoloader.php

    Default configuration of index and fileparser is read from autoloader.ini.

09/04/2010 Markus Malkusch
  • AbstractAutoloader::autoload() Autoloader/AbstractAutoloader.php

    AbstractAutoloader::autoload() checks also interface_exists() to skip its work.

  • AbstractAutoloader::autoload() Autoloader/AbstractAutoloader.php

    Exceptions are never thrown as this breaks compatibility with functions like class_exists().

  • AutoloaderIndex::setContext() Autoloader/index/AutoloaderIndex.php

    It is possible to define an own context for the index. This is useful if you want to build your index on a different system.

05/27/2010 Markus Malkusch
  • AutoloadAPI Autoloader/autoloadAPI/AutoloadAPI.php

    Before PHP 5.2.11 spl_autoload_functions() didn't return proper callbacks. The callback always contained the class name and a function. The object got lost in the stack. This prevented the Autoloader to work in such an environment. AutoloadAPI::getInstance() returns a wrapper for the spl_autoload methods which would work around this problem.

05/20/2010 Markus Malkusch
  • AbstractAutoloader::CLASS_CONSTRUCTOR Autoloader/AbstractAutoloader.php

    The class constructor __static() is deprecated. The new class constructor is called classConstructor(). A method which is called __static() would violate the PEAR coding standard. Only PHP magic methods should be prefixed with a double underscore. Code which uses the old class constructor will still work. The autoloader would raise an E_USER_DEPRECATED warning for the deprecated class constructor __static().

05/18/2010 Markus Malkusch
  • AbstractAutoloader::loadClass() classes/AbstractAutoloader.php

    The include of the class definition used @ for error suppression. This avoided the useful output of fatal errors.

05/09/2010 Markus Malkusch
  • AutoloaderFileParser_RegExp::getClassesInSource() classes/parser/AutoloaderFileParser_RegExp.php

    AutoloaderFileParser_RegExp has support for Namespaces.

05/08/2010 Markus Malkusch
  • AutoloaderFileParser_Tokenizer::getClassesInSource() classes/parser/AutoloaderFileParser_Tokenizer

    The Autoloader has support for Namespaces. Only the AutoloaderFileParser_Tokenizer is able to determine the namespace of a class. The AutoloaderFileParser_RegExp is yet not able to recognize namespaces. You can use any possible namespace declaration. The AutoloaderFileParser_Tokenizer can handle the braket syntax as well as the non braket syntaxt. Multiple namespace declarations in one file are no problem.

04/25/2010 Markus Malkusch
  • AutoloaderIndexFilter_RelativePath classes/index/filter/AutoloaderIndexFilter_RelativePath.php

    An AutoloaderIndex can filter the paths which are stored or read with an AutoloaderIndexFilter. The AutoloaderIndexFilter_RelativePath stores relative paths in an index. With this filter and Autoloader::buildIndex() you can build an index in your developement environment and deploy the built index into your productive environment.

04/21/2010 Markus Malkusch
  • Autoloader::buildIndex() classes/Autoloader.php

    Autoloader::buildIndex() iterates through all files in the class path and builds an index for all found classes. This index is still not really usable for deployment as it contains absolute paths.

  • AutoloaderFileParser::getClassesInFile() classes/parser/AutoloaderFileParser.php

    The Autoloader parser is able to return the list of found classes in a parsed file. This will be used in future to build an index before deployment in a productive environment.

04/16/2010 Markus Malkusch
  • Autoloader.php Autoloader.php

    Autoloader classes are required only once, even if you have several Autoloader packages in your application. This might happen if you use external libraries which use the Autoloader by them selves in their class paths.

04/15/2010 Markus Malkusch
  • AutoloaderIndex_CSV classes/index/AutoloaderIndex_CSV.php

    Index implementation which produces a human readable CSV file.

04/14/2010 Markus Malkusch
  • AutoloaderIndex_File classes/index/AutoloaderIndex_File.php

    AutoloaderIndex_SerializedHashtable derives from AutoloaderIndex_File. This makes it easier to write a new Index implementation which uses an index file.

  • AutoloaderIndex_PHPArrayCode classes/index/AutoloaderIndex_PHPArrayCode.php

    Index implementation which produces a human readable file in PHP, which produces an array.

  • AutoloaderIndex_IniFile classes/index/AutoloaderIndex_IniFile.php

    Index implementation which produces a human readable file with an array in a PHP ini file style.

04/10/2010 Markus Malkusch
  • Autoloader::__autoload() classes/Autoloader.php

    The search process is divided into first iterating through all indexes and then searching each path in the filesystem. This prevents in a multi Autoloader environment that before the index of a later Autoloader would be used the previous Autoloaders would vainly search their class paths.

  • AutoloaderIndex::getPaths() classes/index/AutoloaderIndex.php

    For debuging the index has to return an indexed array with its indexed paths.

01/09/2010 Markus Malkusch
  • AutoloaderFileIterator_PriorityList classes/fileIterator/AutoloaderFileIterator_PriorityList.php

    The AutoloaderFileIterator_PriorityList prefers *.inc and *.php files. Additionally the prefered files are ordered by the Levenshtein distance to the class name. This is the default iterator.

  • AutoloaderFileIterator_SimpleCached classes/fileIterator/AutoloaderFileIterator_SimpleCached.php

    Once a AutoloaderFileIterator_Simple is completely iterated the found files are cached in an ArrayIterator.

  • Autoloader::setPath() classes/Autoloader.php

    Autoloader::setPath() became private. The path is only set by the constructor. If the constructor is empty, the path will be guessed.

01/08/2010 Markus Malkusch
  • AbstractAutoloader::isRegistered() classes/AbstractAutoloader.php

    Using strict mode to avoid the endless recursion.

  • Autoloader::setFileIterator() classes/Autoloader.php

    The file search is using a dedicated object (AutoloaderFileIterator) for iterating through the filesystem. Therefore the methods addSkipPattern() and setSkipFilesize() are moved into the AutoloaderFileIterator class.

  • Autoloader::setPath() classes/Autoloader.php

    Throws AutoloaderException_ClassPath if realpath() fails.

12/18/2009 Markus Malkusch
  • InternalAutoloader::remove() classes/Autoloader.php

    After removing an Autoloader a previously by normalization removed Autoloader could become activated again.

12/15/2009 Markus Malkusch
  • InternalAutoloader classes/InternalAutoloader.php

    Internal classes needed by the Autoloader itself are handled with the InternalAutolader.

  • Autoloader::registerInternalClass() classes/Autoloader.php

    Autoloader::registerInternalClass() is deprecated and removed. InternalAutoloader::getInstance()->registerClass() is used instead.

  • OldPHPAPI::checkAPI() classes/OldPHPAPI.php

    Some functions are missing in older PHP 5 APIs. If needed, these missing functions are implemented.

12/11/2009 Markus Malkusch
  • Autoloader::setPath() classes/Autoloader.php

    For each class path one single Autoloader instance is responsable. That allows to use individual configurations per class path and to reuse an index for common class paths in different projects. This is a major change which affects other classes and methods.

12/10/2009 Markus Malkusch
  • AutoloaderIndex::getContext() classes/index/AutoloaderIndex.php

    Class paths are sorted for generating the context.

12/09/2009 Markus Malkusch
  • Autoloader::getNormalizeSearchPaths() classes/Autoloader.php

    Class paths are normalized for searching. That means that class paths which are included in other class paths are removed.

12/08/2009 Markus Malkusch
  • Autoloader::searchPath() classes/Autoloader.php

    Each searching for a class definition resets the max_execution_time.

  • AutoloaderFileParser::isClassInFile() classes/parser/AutoloaderFileParser.php

    The path for AutoloaderException_Parser_IO was wrong.

  • AutoloaderFileParser_Tokenizer::isClassInSource() classes/parser/AutoloaderFileParser_Tokenizer.php

    If the tokenizer fails it throws an AutoloaderException_Parser.

11/29/2009 Markus Malkusch
  • AutoloaderException_SearchFailed::getClass() classes/exception/AutoloaderException_SearchFailed.php

    A method for getting the information which class couldn't be found.

11/27/2009 Markus Malkusch
  • AutoloaderIndex_SerializedHashtable::save() classes/index/AutoloaderIndex_SerializedHashtable.php

    Raceconditions were possible during saving the index. Saving is done now atomically.