Skip to content
This repository
Browse code

Now using a PSR-0-compatible autoloader.

  • Loading branch information...
commit ca799f80fa11559c02273164dafda9b475cc693f 1 parent a10d489
Michel Fortin authored February 03, 2013

Showing 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. 6  Readme.php
6  Readme.php
@@ -4,8 +4,10 @@
4 4
 # through the Markdown filter. You can adapt this sample code in any way
5 5
 # you like.
6 6
 
7  
-# Note: this line is only needed when PSR-0 class autoloading is not in place.
8  
-require_once './Michelf/Markdown.php';
  7
+# Install PSR-0-compatible class autoloader
  8
+spl_autoload_register(function($class){
  9
+	require preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php';
  10
+});
9 11
 
10 12
 # Get Markdown class
11 13
 use \Michelf\Markdown;

0 notes on commit ca799f8

Please sign in to comment.
Something went wrong with that request. Please try again.