implement api/laconica/version method
darcs-hash:20081230205939-84dde-4b6096859c6b44169dd3d809442fab15337061b2.gz
This commit is contained in:
parent
2047c68d71
commit
a3f601cd4e
@ -102,4 +102,6 @@ Evan Prodromou <evan@prodromou.name>**20081230202019]
|
|||||||
[add laconica-specific methods to htaccess.sample
|
[add laconica-specific methods to htaccess.sample
|
||||||
Evan Prodromou <evan@prodromou.name>**20081230202513]
|
Evan Prodromou <evan@prodromou.name>**20081230202513]
|
||||||
[add laconica methods to unauthed ones
|
[add laconica methods to unauthed ones
|
||||||
Evan Prodromou <evan@prodromou.name>**20081230203747]
|
Evan Prodromou <evan@prodromou.name>**20081230203747]
|
||||||
|
[implement api/laconica/version method
|
||||||
|
Evan Prodromou <evan@prodromou.name>**20081230205939]
|
Binary file not shown.
@ -53,6 +53,8 @@ class TwitapilaconicaAction extends TwitterapiAction
|
|||||||
*
|
*
|
||||||
* Returns a version number for this version of Laconica, which
|
* Returns a version number for this version of Laconica, which
|
||||||
* should make things a bit easier for upgrades.
|
* should make things a bit easier for upgrades.
|
||||||
|
* URL: http://identi.ca/api/laconica/version.(xml|json)
|
||||||
|
* Formats: xml, json
|
||||||
*
|
*
|
||||||
* @param array $args Web arguments
|
* @param array $args Web arguments
|
||||||
* @param array $apidata Twitter API data
|
* @param array $apidata Twitter API data
|
||||||
@ -65,7 +67,18 @@ class TwitapilaconicaAction extends TwitterapiAction
|
|||||||
function version($args, $apidata)
|
function version($args, $apidata)
|
||||||
{
|
{
|
||||||
parent::handle($args);
|
parent::handle($args);
|
||||||
common_server_error(_('API method under construction.'), 501);
|
switch ($apidata['content-type']) {
|
||||||
|
case 'xml':
|
||||||
|
$this->init_document('xml');
|
||||||
|
common_element('version', null, LACONICA_VERSION);
|
||||||
|
$this->end_document('xml');
|
||||||
|
case 'json':
|
||||||
|
$this->init_document('json');
|
||||||
|
print '"'.LACONICA_VERSION.'"';
|
||||||
|
$this->end_document('json');
|
||||||
|
default:
|
||||||
|
$this->client_error(_('API method not found!'), $code=404);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
hunk ./actions/api.php 120
|
hunk ./actions/twitapilaconica.php 56
|
||||||
- 'help/downtime_schedule');
|
+ * URL: http://identi.ca/api/laconica/version.(xml|json)
|
||||||
+ 'help/downtime_schedule',
|
+ * Formats: xml, json
|
||||||
+ 'laconica/version',
|
hunk ./actions/twitapilaconica.php 70
|
||||||
+ 'laconica/config',
|
- common_server_error(_('API method under construction.'), 501);
|
||||||
+ 'laconica/wadl');
|
+ switch ($apidata['content-type']) {
|
||||||
|
+ case 'xml':
|
||||||
|
+ $this->init_document('xml');
|
||||||
|
+ common_element('version', null, LACONICA_VERSION);
|
||||||
|
+ $this->end_document('xml');
|
||||||
|
+ case 'json':
|
||||||
|
+ $this->init_document('json');
|
||||||
|
+ print '"'.LACONICA_VERSION.'"';
|
||||||
|
+ $this->end_document('json');
|
||||||
|
+ default:
|
||||||
|
+ $this->client_error(_('API method not found!'), $code=404);
|
||||||
|
+ }
|
||||||
|
@ -53,6 +53,8 @@ class TwitapilaconicaAction extends TwitterapiAction
|
|||||||
*
|
*
|
||||||
* Returns a version number for this version of Laconica, which
|
* Returns a version number for this version of Laconica, which
|
||||||
* should make things a bit easier for upgrades.
|
* should make things a bit easier for upgrades.
|
||||||
|
* URL: http://identi.ca/api/laconica/version.(xml|json)
|
||||||
|
* Formats: xml, json
|
||||||
*
|
*
|
||||||
* @param array $args Web arguments
|
* @param array $args Web arguments
|
||||||
* @param array $apidata Twitter API data
|
* @param array $apidata Twitter API data
|
||||||
@ -65,7 +67,18 @@ class TwitapilaconicaAction extends TwitterapiAction
|
|||||||
function version($args, $apidata)
|
function version($args, $apidata)
|
||||||
{
|
{
|
||||||
parent::handle($args);
|
parent::handle($args);
|
||||||
common_server_error(_('API method under construction.'), 501);
|
switch ($apidata['content-type']) {
|
||||||
|
case 'xml':
|
||||||
|
$this->init_document('xml');
|
||||||
|
common_element('version', null, LACONICA_VERSION);
|
||||||
|
$this->end_document('xml');
|
||||||
|
case 'json':
|
||||||
|
$this->init_document('json');
|
||||||
|
print '"'.LACONICA_VERSION.'"';
|
||||||
|
$this->end_document('json');
|
||||||
|
default:
|
||||||
|
$this->client_error(_('API method not found!'), $code=404);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user