Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a settings file for easy configuration.

  • Loading branch information...
commit 625bff384e8c5320483ce08c7543240cc34490f6 1 parent b0d8612
Breyten Ernsting breyten authored
Showing with 12 additions and 4 deletions.
  1. +1 −0  .gitignore
  2. +5 −4 api.php
  3. +6 −0 settings.example.php
1  .gitignore
View
@@ -1 +1,2 @@
cache/
+settings.php
9 api.php
View
@@ -1,22 +1,23 @@
<?php
+include_once 'settings.php';
include_once 'codebasehq.inc.php';
-$cb =& new CodeBaseHQAPI('eduhub', 'breyten', 'lykje2p55l2dgew4fnfkndtv4inqkscu8dpv77x3');
+$cb =& new CodeBaseHQAPI($codebaseAccount, $codebaseUser, $codebaseApikey);
$what = $_GET['f'];
if ($what == 'milestones') {
- $milestones = $cb->get_milestones('www');
+ $milestones = $cb->get_milestones($codebaseMainProject);
echo json_encode($milestones);
}
if ($what == 'statuses') {
- $statuses = $cb->get_statuses('www');
+ $statuses = $cb->get_statuses($codebaseMainProject);
echo json_encode($statuses);
}
if ($what == 'tickets') {
- $tickets = $cb->search_tickets('www', sprintf('milestone:"%s"', $_GET['q']), $_GET['p']);
+ $tickets = $cb->search_tickets($codebaseMainProject, sprintf('sort:priority milestone:"%s"', $_GET['q']), $_GET['p']);
echo json_encode($tickets);
}
6 settings.example.php
View
@@ -0,0 +1,6 @@
+<?php
+
+$codebaseAccount = 'account';
+$codebaseUser = 'user';
+$codebaseApikey = 'apikey';
+$codebaseMainProject = 'project';
Please sign in to comment.
Something went wrong with that request. Please try again.