From ca799f80fa11559c02273164dafda9b475cc693f Mon Sep 17 00:00:00 2001 From: Michel Fortin Date: Sun, 3 Feb 2013 16:14:12 -0500 Subject: [PATCH] Now using a PSR-0-compatible autoloader. --- Readme.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Readme.php b/Readme.php index 52cf880..75e23e0 100644 --- a/Readme.php +++ b/Readme.php @@ -4,8 +4,10 @@ # through the Markdown filter. You can adapt this sample code in any way # you like. -# Note: this line is only needed when PSR-0 class autoloading is not in place. -require_once './Michelf/Markdown.php'; +# Install PSR-0-compatible class autoloader +spl_autoload_register(function($class){ + require preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php'; +}); # Get Markdown class use \Michelf\Markdown;