12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- define('BASE_PATH', realpath(dirname(__FILE__)));
- function my_autoloader($class)
- {
- $file = str_replace("\\", DIRECTORY_SEPARATOR, strtolower($class)) . ".php";
- echo $class . ' -> ' . $file . "\n";
- require_once BASE_PATH . DIRECTORY_SEPARATOR . $file;
- }
- spl_autoload_register('my_autoloader');
- try {
- $client = new \Client\GogsAPI(API_URL, API_TOKEN);
- $me = $client->user();
- $other = $client->user("bje007");
- $repos = $me->get("/repos")->load();
- for($repo = $repos->current(); $repo != false; $repo = $repos->next())
- var_dump($repo);
- } catch (\Lib\NotAutorizedException $e) {
- die($e->getMessage());
- }
- ?>
|