-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
166 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
// DP API v1 -- Storage | ||
|
||
//=========================================================================== | ||
// storage/clients/:clientid | ||
|
||
/** @return mixed */ | ||
function api_v1_storage_clients(string $method, array $data, array $query_params) | ||
{ | ||
global $pguser; | ||
|
||
$clientid = $data[":clientid"]; | ||
|
||
$storage = new ApiClientStorage($clientid, $pguser); | ||
if ($method == "GET") { | ||
return json_decode($storage->get()); | ||
} elseif ($method == "PUT") { | ||
$storage->set(json_encode(api_get_request_body())); | ||
return json_decode($storage->get()); | ||
} | ||
} | ||
|
||
function api_v1_storage_clients_delete(string $method, array $data, array $query_params): void | ||
{ | ||
global $pguser; | ||
|
||
$clientid = $data[":clientid"]; | ||
|
||
$storage = new ApiClientStorage($clientid, $pguser); | ||
$storage->delete(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters