Skip to content
This repository has been archived by the owner on Jul 15, 2018. It is now read-only.

Commit

Permalink
Fix autoload.php to work with others
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Jun 29, 2012
1 parent b0f9b4b commit 9c2da86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions html.php
Expand Up @@ -22,6 +22,7 @@
<body>
<h1>Youtube</h1>
<?php echo $t->parse('http://youtu.be/gHYfY9lZaRE')->render() ?>
<?php echo $t->parse('http://www.youtube.com/embed/gHYfY9lZaRE')->render() ?>

<h1>Dailymotion</h1>
<?php echo $t->parse('http://www.dailymotion.com/video/xr9av5')->render() ?>
Expand Down
6 changes: 4 additions & 2 deletions src/autoload.php
Expand Up @@ -14,7 +14,7 @@
*
* @author Jérôme Tamarelle <jerome@tamarelle.net>
*/
spl_autoload_register(function($className) {
function autoload_tubelink($className) {
$className = ltrim($className, '\\');
if (0 === strpos($className, 'TubeLink')) {
$fileName = __DIR__ . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $className) . '.php';
Expand All @@ -26,4 +26,6 @@
}

return false;
});
};

spl_autoload_register('autoload_tubelink');

0 comments on commit 9c2da86

Please sign in to comment.