Skip to content

Commit

Permalink
Add autoloader
Browse files Browse the repository at this point in the history
  • Loading branch information
mlocati committed Jan 28, 2015
1 parent 6d96e3f commit d8abc09
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/autoloader.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
spl_autoload_register(
function ($class) {
if (strpos($class, 'C5TL\\') !== 0) {
return;
}
$file = __DIR__ . str_replace('\\', DIRECTORY_SEPARATOR, substr($class, strlen('C5TL'))) . '.php';
if (is_file($file)) {
require_once $file;
}
}
);

0 comments on commit d8abc09

Please sign in to comment.