Skip to content

Commit 72e03f7

Browse files
committed
removed the services/caches/capabilities method
1 parent 3cc9245 commit 72e03f7

File tree

5 files changed

+19
-31
lines changed

5 files changed

+19
-31
lines changed

okapi/core/OkapiServiceRunner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class OkapiServiceRunner
3333
'services/caches/search/by_urls',
3434
'services/caches/search/save',
3535
'services/caches/shortcuts/search_and_retrieve',
36-
'services/caches/capabilities',
36+
// 'services/caches/capabilities',
3737
'services/caches/edit',
3838
'services/caches/geocache',
3939
'services/caches/geocaches',

okapi/services/apisrv/installation/WebService.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,8 @@ public static function call(OkapiRequest $request)
3131
$result['image_max_upload_size'] = Settings::get('IMAGE_MAX_UPLOAD_SIZE');
3232
$result['image_rcmd_max_pixels'] = Settings::get('IMAGE_MAX_PIXEL_COUNT');
3333
$result['has_image_positions'] = Settings::get('OC_BRANCH') == 'oc.de';
34-
35-
# 'geocache_passwd_max_length' was replaced by 'password_max_length'
36-
# in the new services/caches/capabilities method. It had never been
37-
# in use at OCPL sites (services/caches/edit was never called).
38-
# We leave it here as undocumented OCDE field, until we can verify
39-
# if it was in use there. If no - drop it. If yes - document it as a
40-
# deprecated OCDE-only field.
41-
42-
# Note that for backward compatibility with a former Db::field_length()
43-
# bug, the OCDE field is of type string, while the OCPL field was
44-
# (as intended) numeric.
45-
46-
if (Settings::get('OC_BRANCH') == 'oc.de')
47-
$result['geocache_passwd_max_length'] = (string)Db::field_length('caches', 'logpw');
34+
$result['has_ratings'] = Settings::get('OC_BRANCH') == 'oc.pl';
35+
$result['geocache_passwd_max_length'] = Db::field_length('caches', 'logpw');
4836

4937
return Okapi::formatted_response($request, $result);
5038
}

okapi/services/apisrv/installation/docs.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,16 @@
9797
<p><b>has_image_positions</b> - boolean, <b>true</b> if this
9898
installations supports arbitrary ordering of uploaded images.</p>
9999
</li>
100+
<li>
101+
<p><b>has_ratings</b> - boolean, <b>true</b> if this installation
102+
can store geocache quality ratings. Use the
103+
<a href='%OKAPI:methodargref:services/logs/capabilities%'>services/logs/capabilities</a>
104+
method to find out if a given geocache can be rated.</p>
105+
</li>
106+
<li>
107+
<p><b>geocache_passwd_max_length</b> - the maximum length
108+
of geocache log passwords.</p>
109+
</li>
100110
</ul>
101111
</returns>
102112
</xml>

okapi/services/caches/edit/docs.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
If you supply an empty string, the password will be cleared, i.e.
1515
the geocache will not require a log password.</p>
1616
<p>You may query the maximum accepted password length for the OC site by
17-
<a href='%OKAPI:methodargref:services/caches/capabilities%'>services/caches/capabilities</a>.
17+
<a href='%OKAPI:methodargref:services/apisrv/installation%'>services/apisrv/installation</a>.
1818
There may also be installation-dependent restrictions on which
1919
geocaches may have passwords. <b>success</b> will be <b>false</b> and
2020
an explanation message will be returned if a password is rejected.</p>

okapi/services/caches/search/all/docs.xml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@
1818
</desc>
1919
<opt name='type'>
2020
<p>Pipe-separated list of cache type codes. If given, the results will be
21-
limited to the given cache types. For a list of available type codes,
22-
see the <b>types</b> return field of
23-
<a href='%OKAPI:methodargref:services/caches/capabilities%'>services/caches/capabilities</a>.
24-
For more information on cache types, see
25-
<a href='%OKAPI:methodargref:services/caches/geocache%'>services/caches/geocache</a>.</p>
21+
limited to the given cache types. For a list of known types, see the
22+
<a href='%OKAPI:methodargref:services/caches/geocache%'>services/caches/geocache</a>
23+
<b>type</b> field.</p>
2624

2725
<p><b>Note:</b> If you want to include all cache types <b>except</b>
2826
the given ones, prepend your list with the "-" sign.</p>
@@ -38,9 +36,7 @@
3836
<li><b>Archived</b> - Cache is permanently unavailable (moved to the archives).</li>
3937
</ul>
4038
<p>More statuses are in use at OC sites and may be implemented in future
41-
OKAPI versions (see <a href="https://github.com/opencaching/okapi/issues/565">discussion</a>).
42-
The <a href='%OKAPI:methodargref:services/caches/capabilities%'>services/caches/capabilities</a>
43-
method returns a list of statuses that can be searched for.</p>
39+
OKAPI versions (see <a href="https://github.com/opencaching/okapi/issues/565">discussion</a>).</p>
4440
</opt>
4541
<opt name='owner_uuid'>
4642
<p>Pipe-separated list of user IDs. If given, the list of returned caches
@@ -101,12 +97,6 @@
10197
included. The codes are: 'none', 'nano', 'micro', 'small', 'regular',
10298
'large', 'xlarge', 'other'.</p>
10399

104-
<p><b>Note:</b> Not all OC servers use all of these. The <b>sizes</b>
105-
field of <a href='%OKAPI:methodargref:services/caches/capabilities%'>services/caches/capabilities</a>
106-
tells which types are currently available at this installation. You
107-
may also search for sizes which are unavailable here; then the result
108-
will be empty.</p>
109-
110100
<p><b>Note:</b> If you want to include all cache sizes <b>except</b>
111101
the given ones, prepend your list with the "-" sign.</p>
112102
</opt>
@@ -124,7 +114,7 @@
124114

125115
<p><b>Note:</b> Not all Opencaching installations provide ratings for their
126116
geocaches. The <b>has_ratings</b> field of
127-
<a href='%OKAPI:methodargref:services/caches/capabilities%'>services/caches/capabilities</a>
117+
<a href='%OKAPI:methodargref:services/apisrv/installation%'>services/apisrv/installation</a>
128118
tells if ratings are available. If not, this parameter will be ignored.</p>
129119
</opt>
130120
<opt name='min_rcmds'>

0 commit comments

Comments
 (0)