Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged cache-capabilities; closes #398
- Loading branch information
Showing
12 changed files
with
252 additions
and
74 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
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,31 @@ | ||
<?php | ||
|
||
namespace okapi\services\caches\capabilities; | ||
|
||
use okapi\core\Db; | ||
use okapi\core\Exception\InvalidParam; | ||
use okapi\core\Okapi; | ||
use okapi\core\Request\OkapiRequest; | ||
use okapi\Settings; | ||
|
||
class WebService | ||
{ | ||
public static function options() | ||
{ | ||
return array( | ||
'min_auth_level' => 1 | ||
); | ||
} | ||
|
||
public static function call(OkapiRequest $request) | ||
{ | ||
$result = array(); | ||
|
||
$result['types'] = Okapi::get_local_okapi_cache_types(); | ||
$result['sizes'] = Okapi::get_local_cache_sizes(); | ||
$result['has_ratings'] = (Settings::get('OC_BRANCH') == 'oc.pl'); | ||
$result['password_max_length'] = Db::field_length('caches', 'logpw') + 0; | ||
|
||
return Okapi::formatted_response($request, $result); | ||
} | ||
} |
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,40 @@ | ||
<xml> | ||
<brief>Get information on available geocache properties</brief> | ||
<issue-id>TODO</issue-id> | ||
<desc> | ||
<p>This method tells which geocache properties are available at this | ||
OKAPI installation.</p> | ||
|
||
<p>Using this method is mostly optional. You never need to know about | ||
differences between OKAPI installations when searching for or | ||
retrieving geocaches. But this method may help to improve user | ||
interfaces, e.g. by hiding unnecessary search options.</p> | ||
</desc> | ||
<common-format-params/> | ||
<returns> | ||
<p>A dictionary of the following structure:</p> | ||
<ul> | ||
<li> | ||
<p><b>types</b> - list of the cache types which are currently | ||
available at this installation. See the | ||
<a href='%OKAPI:methodargref:services/caches/geocache%'>services/caches/geocache</a> | ||
method for more information on cache types.</p> | ||
</li> | ||
<li> | ||
<p><b>sizes</b> - list of the cache sizes which are currently | ||
available at this installation.</p> | ||
</li> | ||
<li> | ||
<p><b>has_ratings</b> - boolean, <b>true</b> if this installation | ||
can store geocache quality ratings. OKAPI provides methods to | ||
submit and retrieve ratings, and to search for geocaches by | ||
rating.</p> | ||
</li> | ||
<li> | ||
<p><b>password_max_length</b> - the maximum length of | ||
a password that will be accepted by | ||
<a href='%OKAPI:methodargref:services/caches/edit%'>services/caches/edit</a>.</p> | ||
</li> | ||
</ul> | ||
</returns> | ||
</xml> |
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
Oops, something went wrong.