[geeklog-cvs] Geeklog-1.x/system lib-webservices.php,1.41,1.42
Dirk Haun
dhaun at qs1489.pair.com
Sun Jul 27 14:11:28 EDT 2008
Update of /cvsroot/geeklog/Geeklog-1.x/system
In directory qs1489.pair.com:/tmp/cvs-serv16921
Modified Files:
lib-webservices.php
Log Message:
Made the namespace URLs constants - no changes in functionality
Index: lib-webservices.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/system/lib-webservices.php,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** lib-webservices.php 26 Jul 2008 11:18:00 -0000 1.41
--- lib-webservices.php 27 Jul 2008 18:11:26 -0000 1.42
***************
*** 12,15 ****
--- 12,16 ----
// | |
// | Authors: Ramnath R Iyer - rri AT silentyak DOT com |
+ // | Dirk Haun - dirk AT haun-online DOT de |
// +---------------------------------------------------------------------------+
// | |
***************
*** 36,46 ****
}
$WS_PLUGIN = '';
$WS_INTROSPECTION = false;
$WS_TEXT = '';
- $WS_ATOM_NS = 'http://www.w3.org/2005/Atom';
- $WS_APP_NS = 'http://www.w3.org/2007/app';
- $WS_APP_NS2 = 'http://purl.org/atom/app#';
- $WS_EXTN_NS = 'http://www.geeklog.net/xmlns/app/gl';
// Set = true to enable verbose logging (in error.log)
--- 37,48 ----
}
+ define('WS_ATOM_NS', 'http://www.w3.org/2005/Atom');
+ define('WS_APP_NS', 'http://www.w3.org/2007/app');
+ define('WS_APP_NS2', 'http://purl.org/atom/app#');
+ define('WS_EXTN_NS', 'http://www.geeklog.net/xmlns/app/gl');
+
$WS_PLUGIN = '';
$WS_INTROSPECTION = false;
$WS_TEXT = '';
// Set = true to enable verbose logging (in error.log)
***************
*** 151,156 ****
function WS_post()
{
! global $WS_PLUGIN, $WS_ATOM_NS, $WS_APP_NS, $WS_EXTN_NS, $WS_VERBOSE,
! $_CONF;
if ($WS_VERBOSE) {
--- 153,157 ----
function WS_post()
{
! global $_CONF, $WS_PLUGIN, $WS_VERBOSE;
if ($WS_VERBOSE) {
***************
*** 201,208 ****
$atom_doc = new DOMDocument('1.0', 'utf-8');
! $entry_elem = $atom_doc->createElementNS($WS_ATOM_NS, 'atom:entry');
$atom_doc->appendChild($entry_elem);
! $atom_doc->createAttributeNS($WS_APP_NS, 'app:entry');
! $atom_doc->createAttributeNS($WS_EXTN_NS, 'gl:entry');
WS_arrayToEntryXML($out, $svc_msg['output_fields'], $entry_elem, $atom_doc);
--- 202,209 ----
$atom_doc = new DOMDocument('1.0', 'utf-8');
! $entry_elem = $atom_doc->createElementNS(WS_ATOM_NS, 'atom:entry');
$atom_doc->appendChild($entry_elem);
! $atom_doc->createAttributeNS(WS_APP_NS, 'app:entry');
! $atom_doc->createAttributeNS(WS_EXTN_NS, 'gl:entry');
WS_arrayToEntryXML($out, $svc_msg['output_fields'], $entry_elem, $atom_doc);
***************
*** 221,226 ****
function WS_put()
{
! global $WS_PLUGIN, $WS_ATOM_NS, $WS_APP_NS, $WS_EXTN_NS, $WS_VERBOSE,
! $_CONF;
if ($WS_VERBOSE) {
--- 222,226 ----
function WS_put()
{
! global $_CONF, $WS_PLUGIN, $WS_VERBOSE;
if ($WS_VERBOSE) {
***************
*** 262,267 ****
function WS_get()
{
! global $WS_PLUGIN, $WS_INTROSPECTION, $WS_ATOM_NS, $WS_APP_NS, $WS_EXTN_NS,
! $WS_VERBOSE, $_CONF, $_PLUGINS;
if ($WS_VERBOSE) {
--- 262,266 ----
function WS_get()
{
! global $_CONF, $WS_PLUGIN, $WS_INTROSPECTION, $WS_VERBOSE, $_PLUGINS;
if ($WS_VERBOSE) {
***************
*** 296,303 ****
$atom_doc = new DOMDocument('1.0', 'utf-8');
! $root_elem = $atom_doc->createElementNS($WS_APP_NS, 'app:service');
$atom_doc->appendChild($root_elem);
! $atom_doc->createAttributeNS($WS_ATOM_NS, 'atom:service');
! $atom_doc->createAttributeNS($WS_EXTN_NS, 'gl:service');
$workspace = $atom_doc->createElement('app:workspace');
--- 295,302 ----
$atom_doc = new DOMDocument('1.0', 'utf-8');
! $root_elem = $atom_doc->createElementNS(WS_APP_NS, 'app:service');
$atom_doc->appendChild($root_elem);
! $atom_doc->createAttributeNS(WS_ATOM_NS, 'atom:service');
! $atom_doc->createAttributeNS(WS_EXTN_NS, 'gl:service');
$workspace = $atom_doc->createElement('app:workspace');
***************
*** 367,374 ****
$atom_doc = new DOMDocument('1.0', 'utf-8');
! $entry_elem = $atom_doc->createElementNS($WS_ATOM_NS, 'atom:entry');
$atom_doc->appendChild($entry_elem);
! $atom_doc->createAttributeNS($WS_APP_NS, 'app:entry');
! $atom_doc->createAttributeNS($WS_EXTN_NS, 'gl:entry');
WS_arrayToEntryXML($out, $svc_msg['output_fields'], $entry_elem, $atom_doc);
--- 366,373 ----
$atom_doc = new DOMDocument('1.0', 'utf-8');
! $entry_elem = $atom_doc->createElementNS(WS_ATOM_NS, 'atom:entry');
$atom_doc->appendChild($entry_elem);
! $atom_doc->createAttributeNS(WS_APP_NS, 'app:entry');
! $atom_doc->createAttributeNS(WS_EXTN_NS, 'gl:entry');
WS_arrayToEntryXML($out, $svc_msg['output_fields'], $entry_elem, $atom_doc);
***************
*** 378,385 ****
$atom_doc = new DOMDocument('1.0', 'utf-8');
! $feed_elem = $atom_doc->createElementNS($WS_ATOM_NS, 'atom:feed');
$atom_doc->appendChild($feed_elem);
! $atom_doc->createAttributeNS($WS_APP_NS, 'app:feed');
! $atom_doc->createAttributeNS($WS_EXTN_NS, 'gl:feed');
$feed_id = $atom_doc->createElement('atom:id', $_CONF['site_name']);
--- 377,384 ----
$atom_doc = new DOMDocument('1.0', 'utf-8');
! $feed_elem = $atom_doc->createElementNS(WS_ATOM_NS, 'atom:feed');
$atom_doc->appendChild($feed_elem);
! $atom_doc->createAttributeNS(WS_APP_NS, 'app:feed');
! $atom_doc->createAttributeNS(WS_EXTN_NS, 'gl:feed');
$feed_id = $atom_doc->createElement('atom:id', $_CONF['site_name']);
***************
*** 426,431 ****
function WS_delete()
{
! global $WS_PLUGIN, $WS_ATOM_NS, $WS_APP_NS, $WS_EXTN_NS, $WS_VERBOSE,
! $_CONF;
if ($WS_VERBOSE) {
--- 425,429 ----
function WS_delete()
{
! global $_CONF, $WS_PLUGIN, $WS_VERBOSE;
if ($WS_VERBOSE) {
***************
*** 510,514 ****
function WS_xmlToArgs(&$args)
{
! global $_USER, $WS_EXTN_NS, $WS_ATOM_NS, $WS_APP_NS, $WS_APP_NS2;
/* Previous data in args is NOT deleted */
--- 508,512 ----
function WS_xmlToArgs(&$args)
{
! global $_USER;
/* Previous data in args is NOT deleted */
***************
*** 526,530 ****
/* Get the action, if it exists */
! $action_element = $entry_element->getElementsByTagNameNS($WS_EXTN_NS, 'action')->item(0);
$action = '';
if ($action_element != null) {
--- 524,528 ----
/* Get the action, if it exists */
! $action_element = $entry_element->getElementsByTagNameNS(WS_EXTN_NS, 'action')->item(0);
$action = '';
if ($action_element != null) {
***************
*** 538,545 ****
$node = $nodes->item($index);
! if (($node->namespaceURI != $WS_ATOM_NS) &&
! ($node->namespaceURI != $WS_APP_NS) &&
! ($node->namespaceURI != $WS_APP_NS2) &&
! ($node->namespaceURI != $WS_EXTN_NS)) {
continue;
}
--- 536,543 ----
$node = $nodes->item($index);
! if (($node->namespaceURI != WS_ATOM_NS) &&
! ($node->namespaceURI != WS_APP_NS) &&
! ($node->namespaceURI != WS_APP_NS2) &&
! ($node->namespaceURI != WS_EXTN_NS)) {
continue;
}
***************
*** 551,555 ****
$args['author_name'] = (string)($author_name_element->firstChild->nodeValue);
}
! $author_uid_element = $node->getElementsByTagNameNS($WS_EXTN_NS, 'uid')->item(0);
if ($author_uid_element != null) {
$args['uid'] = (string)($author_uid_element->firstChild->nodeValue);
--- 549,553 ----
$args['author_name'] = (string)($author_name_element->firstChild->nodeValue);
}
! $author_uid_element = $node->getElementsByTagNameNS(WS_EXTN_NS, 'uid')->item(0);
if ($author_uid_element != null) {
$args['uid'] = (string)($author_uid_element->firstChild->nodeValue);
***************
*** 642,646 ****
function WS_arrayToEntryXML($arr, $extn_elements, &$entry_elem, &$atom_doc)
{
! global $WS_PLUGIN, $WS_ATOM_NS, $WS_APP_NS, $WS_EXTN_NS, $_CONF;
/* Standard Atom elements */
--- 640,644 ----
function WS_arrayToEntryXML($arr, $extn_elements, &$entry_elem, &$atom_doc)
{
! global $_CONF, $WS_PLUGIN;
/* Standard Atom elements */
***************
*** 951,955 ****
$WS_TEXT .= $text;
-
}
--- 949,952 ----
***************
*** 962,966 ****
echo $WS_TEXT;
-
}
--- 959,962 ----
More information about the geeklog-cvs
mailing list