wrapper element for config.xml

darcs-hash:20081230212202-84dde-d6439ad7061a56c9de0168ced3d95436ca20cb59.gz
This commit is contained in:
Evan Prodromou 2008-12-30 16:22:02 -05:00
parent 76d91a358b
commit d57c06b417
5 changed files with 11 additions and 12 deletions

View File

@ -110,4 +110,6 @@ Evan Prodromou <evan@prodromou.name>**20081230210114]
[implement the api/laconica/config method
Evan Prodromou <evan@prodromou.name>**20081230211444]
[better serialization of arrays and booleans in config output
Evan Prodromou <evan@prodromou.name>**20081230211957]
Evan Prodromou <evan@prodromou.name>**20081230211957]
[wrapper element for config.xml
Evan Prodromou <evan@prodromou.name>**20081230212202]

View File

@ -115,6 +115,7 @@ class TwitapilaconicaAction extends TwitterapiAction
switch ($apidata['content-type']) {
case 'xml':
$this->init_document('xml');
common_element_start('config');
// XXX: check that all sections and settings are legal XML elements
foreach ($keys as $section => $settings) {
common_element_start($section);
@ -131,6 +132,7 @@ class TwitapilaconicaAction extends TwitterapiAction
}
common_element_end($section);
}
common_element_end('config');
$this->end_document('xml');
break;
case 'json':

View File

@ -1,11 +1,4 @@
hunk ./actions/twitapilaconica.php 122
- common_element($setting, null, common_config($section, $setting));
+ $value = common_config($section, $setting);
+ if (is_array($value)) {
+ $value = implode(',', $value);
+ } else if ($value === false) {
+ $value = 'false';
+ } else if ($value === true) {
+ $value = 'true';
+ }
+ common_element($setting, null, $value);
hunk ./actions/twitapilaconica.php 118
+ common_element_start('config');
hunk ./actions/twitapilaconica.php 135
+ common_element_end('config');

View File

@ -115,6 +115,7 @@ class TwitapilaconicaAction extends TwitterapiAction
switch ($apidata['content-type']) {
case 'xml':
$this->init_document('xml');
common_element_start('config');
// XXX: check that all sections and settings are legal XML elements
foreach ($keys as $section => $settings) {
common_element_start($section);
@ -131,6 +132,7 @@ class TwitapilaconicaAction extends TwitterapiAction
}
common_element_end($section);
}
common_element_end('config');
$this->end_document('xml');
break;
case 'json':