Changeset 759
- Timestamp:
- 01/14/10 16:59:01 (2 years ago)
- Location:
- trunk/phpbms/modules/api
- Files:
-
- 3 modified
-
apiwrapper.php (modified) (4 diffs)
-
api_json.php (modified) (1 diff)
-
include/apiclass.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpbms/modules/api/apiwrapper.php
r758 r759 66 66 67 67 }//end function 68 69 /* 70 * function ping 71 * @param string $tabledefuuid A tabledef uuid. 72 * 73 * @return array|bool An associative array containing the response, or false if a connection error has occured (in which case see $this->errorMessage). 74 * @returnf string type The type of response. This will either be 'error' or 'message'. 75 * @returnf string message The related message. This will be 'Everything is phpBMSy!' if no errors have occurred and the tabledefuuid is api accessible. 76 */ 77 78 function ping($tabledefuuid) { 79 80 $params["request"][0]["tabledefid"] = $tabledefuuid; 81 $params["request"][0]["command"] = "ping"; 82 $params["request"][0]["data"] = array(); 83 84 $response = $this->_callServer($params); 85 86 if($response !== false) 87 return $response[0]; 88 else 89 return false; 90 91 }//end funciton 68 92 69 93 … … 284 308 /* 285 309 * function runStoredProcedure 286 * 310 * 311 * @param string $tabledefuuid The uuid of an api accessible tabledefinition. 287 312 * @param string $procedureName The stored procedure to be called. 288 313 * … … 292 317 */ 293 318 294 public function runStoredProcedure($ procedureName) {319 public function runStoredProcedure($tabledefuuid, $procedureName) { 295 320 296 321 $params["request"][0]["command"] = "procedure"; 297 322 $params["request"][0]["data"]["name"] = $procedurename; 323 $params["request"][0]["tabledefid"] = $tabledefuuid; 298 324 299 325 $response = $this->_callServer($params); … … 719 745 fclose($sock); 720 746 ob_end_clean(); 721 722 747 list($throw, $response) = explode("\r\n\r\n", $response, 2); 723 748 -
trunk/phpbms/modules/api/api_json.php
r703 r759 37 37 +-------------------------------------------------------------------------+ 38 38 */ 39 40 //Test Information41 //$_POST["phpbmsusername"] = "api";42 //$_POST["phpbmspassword"] = "spiderman";43 //$_POST["request"] = '[44 // {45 // "tabledefid": "tbld:c9ff2c8c-ce1f-659a-9c55-31bca7cce70e",46 // "command" : "insert",47 // "data" : {"name":"FOObar","percentage":"3","inactive":"0","createdby":"2","creationdate":"2009-06-25 14:38:02","modifiedby":"2","modifieddate":"2009-06-25 14:38:02","custom1":null,"custom2":null,"custom3":null,"custom4":null,"custom5":null,"custom6":null,"custom7":null,"custom8":null}48 // }49 //]';50 //$_POST["request"] = '[51 // {52 // "tabledefid": "tbld:c9ff2c8c-ce1f-659a-9c55-31bca7cce70e",53 // "command" : "update",54 // "data" : {"useUuid":false, "id":2, "name":"JOOOOO","percentage":"3","inactive":"0","createdby":"2","creationdate":"2009-06-25 14:38:02","modifiedby":"2","modifieddate":"2009-06-25 14:38:02","custom1":null,"custom2":null,"custom3":null,"custom4":null,"custom5":null,"custom6":null,"custom7":null,"custom8":null}55 // }56 //]';57 //$_POST["request"] = '[58 // {59 // "tabledefid": "tbld:c9ff2c8c-ce1f-659a-9c55-31bca7cce70e",60 // "command" : "get",61 // "data" : {"uuid":"tax:66dd77f5-c68e-74f4-5ce6-64768282b232"}62 // }63 //]';64 //$_POST["request"] = '[65 // {66 // "tabledefid": "tbld:c9ff2c8c-ce1f-659a-9c55-31bca7cce70e",67 // "command" : "inactivate",68 // "data" : [4],69 // "options" : {"useUuid" : false}70 // }71 //]';72 73 //if(isset($_POST["foo"])){74 // var_dump(stripslashes($_POST["request"]));75 // exit;76 //}77 78 39 require("../../include/session.php"); 79 40 require("include/apiclass.php"); -
trunk/phpbms/modules/api/include/apiclass.php
r703 r759 456 456 457 457 switch($request["command"]){ 458 459 case "ping": 460 //====================================================== 461 462 $this->_addToResponse("message", "Everything is phpBMSy!"); 463 464 break; 458 465 459 466 case "insert": … … 636 643 include_once("include/search_class.php"); 637 644 638 //if($useUuid){639 // if(!isset($request["data"]->uuid))640 // $this->sendError("The `uuid` field must be set in request number ".$i, $request["data"], true);641 // else642 // $id = $request["data"]->uuid;643 //644 // }else{645 // if(!isset($request["data"]->id))646 // $this->sendError("The `id` field must be set in request number ".$i, $request["data"], true);647 // else648 // $id = $request["data"]->uuid;649 // }//end if650 651 645 if($hasTableClassOveride){ 652 646