Releases: AntCMS-org/AntLoader
Releases · AntCMS-org/AntLoader
Version 2.0.4
Enhancements
- Various improvements to the code quality.
- Unneeded files are now excluded from the package, reducing the overall size by about 150KB
Version 2.0.3
New Features
- Added a new "memory" classmap option which allows AntLoader to load a classmap and only store it into memory. This is not a very performant option, however it may be useful in some cases due to the fact that the
composer/class-map-generator
package generates a classmap regardless of PSR0 / PSR4
Version 2.0.2
Bug Fixes
- Resolved a few minor issues with the APCu cache implementation.
New Features
- You can now call
pruneClassmap
to prune the classmap of any non-existent classes. This function will return the number of classes that were pruned.
Enhancements
- Test coverage has been enabled in the unit tests, requiring at a minimum 90% coverage.
- Improvements to the existing tests have been done, bringing the test coverage up to 97%.
Version 2.0.1
New Features
- When calling the
register
function, you can now passtrue
to the function to have AntLoader to be prepended to the beginning of the PHP autoloader list. This causes it to be used before any other autoloader that is registered.
Changes
- Rather than using
__DIR__
to create the APCu cache key,__FILE__
is now used. - Minor improvements to the code.
- Readme improvements, including updated benchmark info.
Version 2.0.0
Breaking Changes
addPrefix
has been renamed toaddNamespace
to better fit it's actual use-case.- AntLoader is now configured by passing an array when constructing it.
Example using all available configuration options (all are optional):
$config = [
'mode' => 'auto', // Can be 'auto', 'filesystem', 'apcu', or 'none'.
'path' => '/path/to/save/classmap.php', // Where should AntLoader store the classmap if the file system cache option is used.
'key' => 'customApcuKey', // The APCu key used when storing the classmap. This does not usually need to be overridden.
'ttl' => 3600, // Allows you to set the time to live when using APCu. Value is in seconds.
'stopIfNotFound' => true // Setting this to true will cause AntLoader to stop looking for a class if it is not found in the classmap. By default it will look in the search directories you defined with `addNamespace`.
];
$loader = new AntCMS\AntLoader($config);
New Features
- New support for APCu to allow for storing the classmap in-memory, improving potential speed and responsiveness of the auto loader.
- New function
resetClassMap
to make it easy to remove the current classmap. This is recommended whenever you update your application.
Enhancements
- You can now set
stopIfNotFound
totrue
if you want AntLoader to stop looking for classes if they aren't found using the classmap.
Changes
- Simply passing an empty path to AntLoader will not longer prevent it from using the system file path to cache the classmap. AntLoader will now simply create a unique key and store it in the system's temporary directory. This file will be persistent and re-used until the OS's garbage collection deletes it or you call
resetClassMap
.- To explicitly turn off the classmap functionality, set
mode
tonone
- To explicitly turn off the classmap functionality, set
Version 1.0.2
Bug Fixes
- Fixes a bug / oversight that prevented from you from defining multiple paths for the same prefix / namespace.
Enhancements
- Minor optimizations to to help minimize the number of checks the autoloader performs.
Changes
- Improvements to the readme.
- Written tests that show the classmap offers as high as a 90% decrease in time to instance 1000 classes!
Version 1.0.1
Changes
- Improve the PHPDocs
Bug Fixes
- Fixed a minor bug where AntLoader could write a modified version of a class name to the classmap when using a PSR-0 autoloader.
Initial Release
This is the initial release of AntLoader