Example #1
0
 /**
  * Uses the php-github-api library in order to open an issue on github repository
  * @param hash $labels set of labels for github issue
  * @access public
  */
 public function reportOnGithub($labels)
 {
     $config = Configuration::getProjectConfiguration();
     if (!isset($labels)) {
         $labels = array();
     }
     require_once $_SERVER['DOCUMENT_ROOT'] . "resources/library/vendor/autoload.php";
     try {
         $client = new \Github\Client();
         $client->authenticate($config['githubUsername'], $config['githubPassword'], Github\Client::AUTH_HTTP_PASSWORD);
         $issue = $client->api('issue')->create($config['githubUsername'], $config['githubRepositoryName'], array('title' => "Error " . $this->getErrorCode() . ": " . $this->getErrorTitle(), 'body' => $this->getErrorDescription(), 'labels' => $labels));
     } catch (Exception $e) {
         print $e->getMessage();
         print $e->getCode();
     }
 }