/** * 获到用户GitHub默认的博客Repo * * @return \stdClass */ public static function showDefaultBlogRepo() { $github_user = new \Api\Github\Users(); $user = \Model\User::show(\Yaf_Registry::get('current_uid')); if (!empty($user['metadata']['login'])) { $github_respositories = new \Api\Github\Respositories(); $repo = $github_respositories->getRepos($user['metadata']['login'], self::showDefaultBlogRepoName($user['metadata']['login'])); } return $repo; }
public function indexAction() { var_dump(Api\Github\Respositories::init()->userRepos()); exit; }
/** * 直接向当前用户的博客源删除一个数据 * * @param sting $path 路径 * @param sting $message 注释 * * @return \stdClass */ public static function destroyUserRespos($path, $message) { $user = User::show(); $login = $user['metadata']['login']; $repo = Github::showDefaultBlogRepoName($user['metadata']['login']); $respositories = new \Api\Github\Respositories(); return $respositories->delete($login, $repo, $path, $message); }