[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7006] merge from bim-branch
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [7006] merge from bim-branch |
Date: |
Wed, 16 Feb 2011 09:30:25 +0000 |
Revision: 7006
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7006
Author: sigurdne
Date: 2011-02-16 09:30:24 +0000 (Wed, 16 Feb 2011)
Log Message:
-----------
merge from bim-branch
Added Paths:
-----------
trunk/bim/inc/class.sobim_repository.inc.php
Copied: trunk/bim/inc/class.sobim_repository.inc.php (from rev 7005,
branches/dev-bim2/property/inc/class.sobim_repository.inc.php)
===================================================================
--- trunk/bim/inc/class.sobim_repository.inc.php
(rev 0)
+++ trunk/bim/inc/class.sobim_repository.inc.php 2011-02-16 09:30:24 UTC
(rev 7006)
@@ -0,0 +1,45 @@
+<?php
+/*
+ * Requires the following to work:
+ * Curl library
+ * HTTP_Request (Pear)
+ */
+
+phpgw::import_class('property.restrequest');
+
+interface sobimrest {
+ public function getRepositoryCountJson();
+}
+
+class sobimrest_impl implements sobimrest{
+ private $baseUrl = "http://localhost:8080/RestTests/rest/repositories";
+
+ public function __construct() {
+ if(!$this->iscurlinstalled()) {
+ throw new Exception("Curl library is required for this
to work!");
+ }
+ }
+ private function iscurlinstalled() {
+ return (in_array ('curl', get_loaded_extensions()));
+ }
+ public function getRepositoryCountJson() {
+
+ $url = $this->baseUrl."/count";
+ $method = "GET";
+ $rest = new RestRequest($url, $method);
+ //$rest->setAcceptType("application/xml");
+ $rest->execute();
+ $output = $rest->getResponseBody();
+ echo $output;
+ }
+
+ public function getRepositoryNames() {
+ $url = $this->baseUrl."/names";
+ $method = "GET";
+ $rest = new RestRequest($url, $method);
+ //$rest->setAcceptType("application/xml");
+ $rest->execute();
+ $output = $rest->getResponseBody();
+ echo $output;
+ }
+}
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7006] merge from bim-branch,
Sigurd Nes <=