php - Gitonomy cannot access my remote repository -
i testing out gitonomy library within php , cannot put finger on. have created small application found here class uses repository class library list available branches on github remote reposictory. below class:
namespace lusoft\library{ use gitonomy\git\repository remoterepositroy; class repository { public function getbranches($repository) { if(!is_string($repository)){ throw new exception("reposotory must in form of string."); } $rr = new remoterepositroy($repository); $branches = []; foreach($rr->getreferences()->getbranches() $branch){ $branches[] = $branch->getname(); } $rr->run('fetch', array('--all')); return $branches; } } }
i have followed example here. below how call class in index.php page.
require_once "vendor/autoload.php"; use lusoft\library\repository; $repository = new repository(); try{ var_dump($repository->getbranches(__dir__)); }catch(\exception $e){ echo "exception :" . $e->getmessage(); }
below error get:
exception :error while getting list of references: '"git"' not recognized internal or external command, operable program or batch file.
i using application testing branches , if things went on correctly suppose seeing master.
can please explain me how library work in simplest form?
nb: index.php on same folder level of application git has been initialized.
Comments
Post a Comment