PHP code example of cl / git

1. Go to this page and download the library: Download cl/git library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cl / git example snippets



$git = new \CL\Git\Git($site, $teamId);
$git->set_account("https://git.cse.msu.edu", "cse335", "accesstoken");
$git->set_url_submission("project1", "git");
$ret = $git->connect();
if($ret !== null) {
  // Display error message
  echo $ret;
} else {
  // Display results
  echo $git->present_team();
  echo $git->present_commits();
}