Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Now using a PSR-0-compatible autoloader.

  • Loading branch information...
commit ca799f80fa11559c02273164dafda9b475cc693f 1 parent a10d489
@michelf authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 Readme.php
View
6 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;
Please sign in to comment.
Something went wrong with that request. Please try again.