Skip to content

Commit

Permalink
Revert "remove autoloading composer will take care "
Browse files Browse the repository at this point in the history
This reverts commit 58706d6.
  • Loading branch information
znarf committed Aug 22, 2014
1 parent 7496bc7 commit d0f2e78
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion lib/Eyeem.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,23 @@ class Eyeem
protected $_ressources = array(
'user', 'album', 'photo', 'comment', 'app'
);


public static function autoload()
{
spl_autoload_register(array('self', 'loader'));
}

public static function loader($className)
{
if (strpos($className, 'Eyeem') === 0) {
$filename = __DIR__ . '/' . str_replace('_', '/', $className) . '.php';
if (file_exists($filename)) {
require_once $filename;
return true;
}
}
}

public function getApiUrl($endpoint)
{
$url = $this->baseUrl . $endpoint;
Expand Down

0 comments on commit d0f2e78

Please sign in to comment.