axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r353997 [1/2] - in /webservices/axis2/trunk/c/bindings/php: ./ axis2/ axis2/tests/
Date Mon, 05 Dec 2005 06:22:15 GMT
Author: samisa
Date: Sun Dec  4 22:21:44 2005
New Revision: 353997

URL: http://svn.apache.org/viewcvs?rev=353997&view=rev
Log: (empty)

Added:
    webservices/axis2/trunk/c/bindings/php/
    webservices/axis2/trunk/c/bindings/php/axis2/
    webservices/axis2/trunk/c/bindings/php/axis2/.cvsignore
    webservices/axis2/trunk/c/bindings/php/axis2/CREDITS
    webservices/axis2/trunk/c/bindings/php/axis2/EXPERIMENTAL
    webservices/axis2/trunk/c/bindings/php/axis2/axis2.c
    webservices/axis2/trunk/c/bindings/php/axis2/axis2.php
    webservices/axis2/trunk/c/bindings/php/axis2/axis2_ce.h
    webservices/axis2/trunk/c/bindings/php/axis2/axis2_common.h
    webservices/axis2/trunk/c/bindings/php/axis2/axis2_fe.h
    webservices/axis2/trunk/c/bindings/php/axis2/axis2_properties.h
    webservices/axis2/trunk/c/bindings/php/axis2/config.m4
    webservices/axis2/trunk/c/bindings/php/axis2/config.w32
    webservices/axis2/trunk/c/bindings/php/axis2/om_attribute.c
    webservices/axis2/trunk/c/bindings/php/axis2/om_comment.c
    webservices/axis2/trunk/c/bindings/php/axis2/om_doctype.c
    webservices/axis2/trunk/c/bindings/php/axis2/om_document.c
    webservices/axis2/trunk/c/bindings/php/axis2/om_element.c
    webservices/axis2/trunk/c/bindings/php/axis2/om_namespace.c
    webservices/axis2/trunk/c/bindings/php/axis2/om_node.c
    webservices/axis2/trunk/c/bindings/php/axis2/om_output.c
    webservices/axis2/trunk/c/bindings/php/axis2/om_processing_instruction.c
    webservices/axis2/trunk/c/bindings/php/axis2/om_stax_builder.c
    webservices/axis2/trunk/c/bindings/php/axis2/om_text.c
    webservices/axis2/trunk/c/bindings/php/axis2/output.php
    webservices/axis2/trunk/c/bindings/php/axis2/php_axis2.h
    webservices/axis2/trunk/c/bindings/php/axis2/qname.c
    webservices/axis2/trunk/c/bindings/php/axis2/tests/
    webservices/axis2/trunk/c/bindings/php/axis2/tests/001.phpt
    webservices/axis2/trunk/c/bindings/php/axis2/xml_reader.c
    webservices/axis2/trunk/c/bindings/php/axis2/xml_writer.c

Added: webservices/axis2/trunk/c/bindings/php/axis2/.cvsignore
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/.cvsignore?rev=353997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/.cvsignore (added)
+++ webservices/axis2/trunk/c/bindings/php/axis2/.cvsignore Sun Dec  4 22:21:44 2005
@@ -0,0 +1,3 @@
+.deps
+*.lo
+*.la

Added: webservices/axis2/trunk/c/bindings/php/axis2/CREDITS
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/CREDITS?rev=353997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/CREDITS (added)
+++ webservices/axis2/trunk/c/bindings/php/axis2/CREDITS Sun Dec  4 22:21:44 2005
@@ -0,0 +1 @@
+axis2
\ No newline at end of file

Added: webservices/axis2/trunk/c/bindings/php/axis2/EXPERIMENTAL
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/EXPERIMENTAL?rev=353997&view=auto
==============================================================================
    (empty)

Added: webservices/axis2/trunk/c/bindings/php/axis2/axis2.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/axis2.c?rev=353997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/axis2.c (added)
+++ webservices/axis2/trunk/c/bindings/php/axis2/axis2.c Sun Dec  4 22:21:44 2005
@@ -0,0 +1,426 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/*
+  +----------------------------------------------------------------------+
+  | PHP Version 5                                                        |
+  +----------------------------------------------------------------------+
+  | Copyright (c) 1997-2004 The PHP Group                                |
+  +----------------------------------------------------------------------+
+  | This source file is subject to version 3.0 of the PHP license,       |
+  | that is bundled with this package in the file LICENSE, and is        |
+  | available through the world-wide-web at the following url:           |
+  | http://www.php.net/license/3_0.txt.                                  |
+  | If you did not receive a copy of the PHP license and are unable to   |
+  | obtain it through the world-wide-web, please send a note to          |
+  | license@php.net so we can mail you a copy immediately.               |
+  +----------------------------------------------------------------------+
+  | Author:                                                              |
+  +----------------------------------------------------------------------+
+*/
+
+/* $Id: header,v 1.15 2004/01/08 16:46:52 sniper Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "php_axis2.h"
+#include "axis2_env.h"
+#include "axis2_error_default.h"
+#include "axis2_stream_default.h"
+#include "axis2_log_default.h"
+
+
+static zend_object_value axis2_objects_new(zend_class_entry *class_type TSRMLS_DC );
+
+
+
+/* If you declare any globals in php_axis2.h uncomment this:
+*/
+ZEND_DECLARE_MODULE_GLOBALS(axis2)
+
+
+/* True global resources - no need for thread safety here */
+static int le_axis2;
+
+static zend_object_handlers axis2_object_handlers;
+
+/* {{{ axis2_functions[]
+ *
+ * Every user visible function must have an entry in axis2_functions[].
+ */
+function_entry axis2_functions[] = {
+	PHP_FE(axis2_helloworld,	NULL)		
+	{NULL, NULL, NULL}	/* Must be the last line in axis2_functions[] */
+};
+/* }}} */
+
+/* {{{ axis2_module_entry
+ */
+zend_module_entry axis2_module_entry = {
+#if ZEND_MODULE_API_NO >= 20010901
+	STANDARD_MODULE_HEADER,
+#endif
+	"axis2",
+	axis2_functions,
+	PHP_MINIT(axis2),
+	PHP_MSHUTDOWN(axis2),
+	PHP_RINIT(axis2),		/* Replace with NULL if there's nothing to do at request start */
+	PHP_RSHUTDOWN(axis2),	/* Replace with NULL if there's nothing to do at request end */
+	PHP_MINFO(axis2),
+#if ZEND_MODULE_API_NO >= 20010901
+	"0.1", /* Replace with version number for your extension */
+#endif
+	STANDARD_MODULE_PROPERTIES
+};
+/* }}} */
+
+#ifdef COMPILE_DL_AXIS2
+ZEND_GET_MODULE(axis2)
+#endif
+
+/* {{{ PHP_INI
+ */
+/* Remove comments and fill if you need to have entries in php.ini
+PHP_INI_BEGIN()
+    STD_PHP_INI_ENTRY("axis2.global_value",      "42", PHP_INI_ALL, OnUpdateLong, global_value, zend_axis2_globals, axis2_globals)
+    STD_PHP_INI_ENTRY("axis2.global_string", "foobar", PHP_INI_ALL, OnUpdateString, global_string, zend_axis2_globals, axis2_globals)
+PHP_INI_END()
+*/
+/* }}} */
+
+/* {{{ php_axis2_init_globals
+ */
+
+static void php_axis2_init_globals(zend_axis2_globals *axis2_globals)
+{
+    axis2_allocator_t *allocator = NULL;
+    axis2_error_t *err = NULL;
+    axis2_log_t *log = NULL;
+    axis2_stream_t *stream = NULL;
+    axis2_env_t *environment = NULL;
+    allocator = axis2_allocator_init (NULL);
+    log = axis2_log_create(allocator, NULL);
+    stream = axis2_stream_create(allocator, NULL);
+    err = axis2_error_create(allocator);
+    
+    environment= axis2_env_create_with_error_stream_log(allocator, err,stream, log);
+    
+	axis2_globals->global_value = 0;
+	axis2_globals->global_string = NULL;
+	axis2_globals->env = environment;
+	axis2_globals->allocator = allocator;
+}
+
+/* }}} */
+
+/* {{{ PHP_MINIT_FUNCTION
+ */
+PHP_MINIT_FUNCTION(axis2)
+{
+    zend_class_entry ce;
+	
+	ZEND_INIT_MODULE_GLOBALS(axis2, php_axis2_init_globals, NULL);
+    /* If you have INI entries, uncomment these lines 
+	REGISTER_INI_ENTRIES();
+	*/
+	
+	
+	memcpy(&axis2_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+	axis2_object_handlers.clone_obj = NULL;
+	
+	REGISTER_AXIS2_CLASS(ce,"Axis2XMLReader",NULL, php_axis2_xml_reader_class_functions, axis2_xml_reader_class_entry);
+    
+    REGISTER_AXIS2_CLASS(ce,"Axis2XMLWriter",NULL, php_axis2_xml_writer_class_functions, axis2_xml_writer_class_entry);
+    
+    REGISTER_AXIS2_CLASS(ce,"Axis2OMBuilder",NULL, php_axis2_om_stax_builder_class_functions, axis2_om_stax_builder_class_entry);
+    
+    REGISTER_AXIS2_CLASS(ce,"Axis2OMDocument",NULL, php_axis2_om_document_class_functions, axis2_om_document_class_entry);
+    
+    REGISTER_AXIS2_CLASS(ce,"Axis2OMOutput",NULL, php_axis2_om_output_class_functions, axis2_om_output_class_entry);
+    
+    
+    REGISTER_AXIS2_CLASS(ce, "Axis2OMNamespace", NULL, php_axis2_om_namespace_class_functions, axis2_om_namespace_class_entry);
+    
+    REGISTER_AXIS2_CLASS(ce, "Axis2OMAttribute", NULL, php_axis2_om_attribute_class_functions, axis2_om_attribute_class_entry);
+    
+    REGISTER_AXIS2_CLASS(ce, "Axis2Qname", NULL, php_axis2_qname_class_functions, axis2_qname_class_entry);
+   
+    REGISTER_AXIS2_CLASS(ce, "Axis2OMNode", NULL, php_axis2_om_node_class_functions, axis2_om_node_class_entry);
+    
+    REGISTER_AXIS2_CLASS(ce, "Axis2OMElement", axis2_om_node_class_entry , php_axis2_om_element_class_functions , axis2_om_element_class_entry);
+    
+    REGISTER_AXIS2_CLASS(ce, "Axis2OMText", axis2_om_node_class_entry , php_axis2_om_text_class_functions , axis2_om_text_class_entry);
+    
+    REGISTER_AXIS2_CLASS(ce, "Axis2OMComment", axis2_om_node_class_entry , php_axis2_om_comment_class_functions , axis2_om_comment_class_entry);
+
+    
+    REGISTER_LONG_CONSTANT("AXIS2_XML_READER_START_DOCUMENT",	AXIS2_XML_READER_START_DOCUMENT,		CONST_CS | CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT("AXIS2_XML_READER_START_ELEMENT",	AXIS2_XML_READER_START_ELEMENT ,		CONST_CS | CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT("AXIS2_XML_READER_END_ELEMENT",	    AXIS2_XML_READER_END_ELEMENT,		    CONST_CS | CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT("AXIS2_XML_READER_SPACE",	        AXIS2_XML_READER_SPACE,		            CONST_CS | CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT("AXIS2_XML_READER_EMPTY_ELEMENT",	AXIS2_XML_READER_EMPTY_ELEMENT,	     	CONST_CS | CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT("AXIS2_XML_READER_CHARACTER",	    AXIS2_XML_READER_CHARACTER,		        CONST_CS | CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT("AXIS2_XML_READER_ENTITY_REFERANCE",	AXIS2_XML_READER_ENTITY_REFERANCE,		CONST_CS | CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT("AXIS2_XML_READER_COMMENT",	        AXIS2_XML_READER_COMMENT,		        CONST_CS | CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT("AXIS2_XML_READER_PROCESSING_INSTRUCTION",	AXIS2_XML_READER_PROCESSING_INSTRUCTION,		CONST_CS | CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT("AXIS2_XML_READER_CDATA",	        AXIS2_XML_READER_CDATA,		CONST_CS | CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT("AXIS2_XML_READER_DOCUMENT_TYPE",	AXIS2_XML_READER_DOCUMENT_TYPE,		CONST_CS | CONST_PERSISTENT);
+    
+    	
+	
+	return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MSHUTDOWN_FUNCTION
+ */
+PHP_MSHUTDOWN_FUNCTION(axis2)
+{
+	/* uncomment this line if you have INI entries
+	UNREGISTER_INI_ENTRIES();
+	*/
+	php_axis2_destroy_env();
+	return SUCCESS;
+}
+/* }}} */
+
+
+
+void php_axis2_objects_free_storage(void *object TSRMLS_DC)
+{
+    axis2_object *intern = (axis2_object_ptr)object;
+    zend_hash_destroy(intern->std.properties);
+    FREE_HASHTABLE(intern->std.properties);
+    
+    /*TODO individual objects must be freed */
+    if(intern->ptr)
+    {
+    
+    
+    }
+    
+
+}
+
+
+static zend_object_value axis2_objects_new(zend_class_entry *class_type TSRMLS_DC )
+{
+    zend_object_value retval;
+    axis2_object *intern = NULL;
+    zval *tmp = NULL;
+    
+    intern = emalloc(sizeof(axis2_object));
+    intern->std.ce = class_type;
+   
+    
+    intern->ptr = NULL;
+    intern->prop_handler = NULL;
+    ALLOC_HASHTABLE(intern->std.properties);
+    zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+    zend_hash_copy(intern->std.properties, &class_type->default_properties,
+             (copy_ctor_func_t)zval_add_ref, (void*)tmp, sizeof(zval *));
+    retval.handle = zend_objects_store_put(intern, NULL,
+            ( zend_objects_free_object_storage_t)php_axis2_objects_free_storage,NULL TSRMLS_CC);
+            
+    intern->handle = retval.handle;
+    retval.handlers = &axis2_object_handlers;            
+    return retval;
+}
+
+
+/* Remove if there's nothing to do at request start */
+/* {{{ PHP_RINIT_FUNCTION
+ */
+PHP_RINIT_FUNCTION(axis2)
+{
+	return SUCCESS;
+}
+/* }}} */
+
+/* Remove if there's nothing to do at request end */
+/* {{{ PHP_RSHUTDOWN_FUNCTION
+ */
+PHP_RSHUTDOWN_FUNCTION(axis2)
+{
+	return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MINFO_FUNCTION
+ */
+PHP_MINFO_FUNCTION(axis2)
+{
+	php_info_print_table_start();
+	php_info_print_table_header(2, "axis2 support", "enabled");
+	php_info_print_table_end();
+
+	/* Remove comments if you have entries in php.ini
+	DISPLAY_INI_ENTRIES();
+	*/
+}
+/* }}} */
+
+
+
+
+
+/* {{{ proto string axis2_helloworld()
+  say welcome note */
+PHP_FUNCTION(axis2_helloworld)
+{
+    php_printf(" welcome axis2");
+}
+/* }}} */
+
+
+
+void php_axis2_destroy_env()
+{
+    TSRMLS_FETCH();
+    axis2_env_free(AXIS2_G(env));
+    AXIS2_G(env) = NULL;
+    AXIS2_G(allocator) = NULL;
+}
+
+axis2_env_t *php_axis2_get_env()
+{
+    TSRMLS_FETCH();
+    return AXIS2_G(env);
+}
+
+/* {{{ create_axis2_om_object */
+zval *php_axis2_create_om_object(void *obj, int obj_type, zend_class_entry *class_type TSRMLS_DC)
+{
+    zval *wrapper = NULL;
+    zend_class_entry *ce = NULL;
+    axis2_object *intern = NULL;
+    om_object *om_obj = NULL;
+    
+    if(!obj)
+    {
+        return NULL;
+    }
+    ce = class_type;
+   
+    ALLOC_ZVAL(wrapper);
+    /* ZVAL_NULL(wrapper); */
+    object_init_ex(wrapper,ce);
+    intern = (axis2_object_ptr)zend_objects_get_address(wrapper TSRMLS_CC);
+    ZVAL_ADDREF(wrapper);
+    
+    om_obj = (om_object_ptr)emalloc(sizeof(om_object));
+    om_obj->ptr = obj;
+    om_obj->obj_type = obj_type;
+    intern->ptr = om_obj;
+    intern->obj_type = OM_OBJ;
+    return (wrapper);   
+}
+
+/* }}} end create object */
+
+/* {{{ create om_node object */
+
+zval *php_axis2_create_om_node_object(void *obj, int node_type, zend_class_entry *class_type  TSRMLS_DC)
+{
+    zval *wrapper = NULL;
+    zend_class_entry *ce = NULL;
+    axis2_object *intern = NULL;
+    om_node_t *node_obj = NULL;
+    if(!obj)
+    {
+        return NULL;
+    }
+    ce = class_type;
+    ALLOC_ZVAL(wrapper);
+    /* ZVAL_NULL(wrapper); */
+    object_init_ex(wrapper, ce);
+    intern = (axis2_object_ptr)zend_objects_get_address(wrapper TSRMLS_CC);
+    ZVAL_ADDREF(wrapper);
+    
+    node_obj = (om_node_ptr)emalloc(sizeof(om_node_t));
+    node_obj->ptr = obj;
+    node_obj->node_type = node_type;
+    node_obj->builder = NULL;
+    node_obj->doc = NULL;
+    intern->ptr = node_obj;
+    intern->obj_type = OM_NODE_OBJ;
+    return (wrapper);
+}
+/* }}} end om_node_create obj */
+
+/* {{{ set Object */
+void php_axis2_set_object(void *obj,int obj_type, zval *wrapper_in TSRMLS_DC)
+{
+    axis2_object_ptr axis2_obj = NULL;
+   
+    axis2_obj = (axis2_object_ptr)zend_object_store_get_object(wrapper_in TSRMLS_CC);
+    axis2_obj->obj_type = obj_type;
+    axis2_obj->ptr = obj;
+}
+/* }}} end set object */
+
+/* {{{ stream to buffer */
+char* php_axis2_stream_to_buffer(php_stream *stream TSRMLS_DC)
+{
+    char *buffer = NULL;
+    int size = 0;
+    char *temp_buffer = NULL;
+    size = php_stream_copy_to_mem(stream,&temp_buffer,PHP_STREAM_COPY_ALL, 0);
+    buffer = estrdup(temp_buffer);
+    pefree(temp_buffer, 0);
+    return buffer;
+}
+
+zend_class_entry* php_axis2_get_class_type(int node_type)
+{
+    zend_class_entry *ce = NULL;
+    switch(node_type)
+    {
+        case OM_ELEMENT:
+            ce = axis2_om_element_class_entry;
+            break;
+        case OM_TEXT: 
+            ce = axis2_om_text_class_entry;
+            break;
+        case OM_PI:
+            ce = axis2_om_pi_class_entry;
+            break;
+        case OM_COMMENT:
+            ce = axis2_om_comment_class_entry;            
+            break;
+        default:
+            ce = NULL;
+            break;    
+    }
+    return ce;
+}
+/* }}} end stream to buffer */
+
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */

Added: webservices/axis2/trunk/c/bindings/php/axis2/axis2.php
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/axis2.php?rev=353997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/axis2.php (added)
+++ webservices/axis2/trunk/c/bindings/php/axis2/axis2.php Sun Dec  4 22:21:44 2005
@@ -0,0 +1,19 @@
+<?
+if(!extension_loaded('axis2')) {
+	dl('axis2.' . PHP_SHLIB_SUFFIX);
+}
+$module = 'axis2';
+$functions = get_extension_funcs($module);
+echo "Functions available in the test extension:<br>\n";
+foreach($functions as $func) {
+    echo $func."<br>\n";
+}
+echo "<br>\n";
+$function = 'confirm_' . $module . '_compiled';
+if (extension_loaded($module)) {
+	$str = $function($module);
+} else {
+	$str = "Module $module is not compiled into PHP";
+}
+echo "$str\n";
+?>

Added: webservices/axis2/trunk/c/bindings/php/axis2/axis2_ce.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/axis2_ce.h?rev=353997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/axis2_ce.h (added)
+++ webservices/axis2/trunk/c/bindings/php/axis2/axis2_ce.h Sun Dec  4 22:21:44 2005
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef AXIS2_CE_H
+#define AXIS2_CE_H
+
+zend_class_entry *axis2_xml_reader_class_entry;
+zend_class_entry *axis2_xml_writer_class_entry;
+zend_class_entry *axis2_qname_class_entry;
+zend_class_entry *axis2_om_element_class_entry;
+zend_class_entry *axis2_om_comment_class_entry;
+zend_class_entry *axis2_om_text_class_entry;
+zend_class_entry *axis2_om_pi_class_entry;
+zend_class_entry *axis2_om_stax_builder_class_entry;
+zend_class_entry *axis2_om_document_class_entry;
+zend_class_entry *axis2_om_attribute_class_entry;
+zend_class_entry *axis2_om_namespace_class_entry;
+zend_class_entry *axis2_om_node_class_entry;
+zend_class_entry *axis2_om_output_class_entry;
+#endif /* AXIS2_CE_H */
\ No newline at end of file

Added: webservices/axis2/trunk/c/bindings/php/axis2/axis2_common.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/axis2_common.h?rev=353997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/axis2_common.h (added)
+++ webservices/axis2/trunk/c/bindings/php/axis2/axis2_common.h Sun Dec  4 22:21:44 2005
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef AXIS2_COMMON_H
+#define AXIS2_COMMON_H
+
+#include <axis2_om_node.h>
+#include <axis2_om_document.h>
+#include <axis2_om_stax_builder.h>
+
+typedef struct _om_node {
+    void *ptr;
+    axis2_om_document_t *doc;
+    axis2_om_stax_builder_t *builder;
+    int node_type;
+    int ref_count;
+}om_node_t;
+
+typedef struct _om_object{
+    void *ptr;
+    int obj_type;
+    int ref_count;
+}om_object;
+
+typedef om_node_t* om_node_ptr;
+typedef om_object* om_object_ptr;
+
+
+#define REGISTER_AXIS2_CLASS(ce, name, parent_ce, funcs, entry) \
+INIT_CLASS_ENTRY(ce, name, funcs); \
+ce.create_object = axis2_objects_new; \
+entry = zend_register_internal_class_ex(&ce, parent_ce, NULL TSRMLS_CC);
+
+#define AXIS2_GET_THIS(zval) \
+        if(NULL == (zval = getThis())) \
+        { \
+            php_error_docref(NULL TSRMLS_CC, E_WARNING, "object missing ");  \
+            RETURN_FALSE; \
+        } 
+        
+#define AXIS2_GET_OBJ(__ptr, __id, __ptr_type, __intern) \
+        { \
+            __intern = (axis2_object *)zend_object_store_get_object(__id TSRMLS_CC); \
+            if((__intern->ptr)) \
+            { \
+                __ptr = (__ptr_type)(__intern->ptr); \
+            } \
+        }
+
+#endif /* AXIS2_COMMON_H */
\ No newline at end of file

Added: webservices/axis2/trunk/c/bindings/php/axis2/axis2_fe.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/axis2_fe.h?rev=353997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/axis2_fe.h (added)
+++ webservices/axis2/trunk/c/bindings/php/axis2/axis2_fe.h Sun Dec  4 22:21:44 2005
@@ -0,0 +1,209 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef AXIS2_FE_H
+#define AXIS2_FE_H
+
+extern zend_function_entry php_axis2_xml_reader_class_functions[];
+extern zend_function_entry php_axis2_xml_writer_class_functions[];
+extern zend_function_entry php_axis2_om_element_class_functions[];
+extern zend_function_entry php_axis2_om_comment_class_functions[];
+extern zend_function_entry php_axis2_om_text_class_functions[];
+extern zend_function_entry php_axis2_om_pi_class_functions[];
+extern zend_function_entry php_axis2_om_stax_builder_class_functions[];
+extern zend_function_entry php_axis2_om_document_class_functions[];
+extern zend_function_entry php_axis2_om_attribute_class_functions[];
+extern zend_function_entry php_axis2_om_namespace_class_functions[];
+extern zend_function_entry php_axis2_om_node_class_functions[];
+extern zend_function_entry php_axis2_qname_class_functions[];
+extern zend_function_entry php_axis2_om_output_class_functions[];
+
+
+/** axis2_xml_reader functions */
+PHP_METHOD(xml_reader, __construct);
+PHP_FUNCTION(axis2_xml_reader_next);
+PHP_FUNCTION(axis2_xml_reader_get_attribute_count);
+PHP_FUNCTION(axis2_xml_reader_get_attribute_name_by_number);
+PHP_FUNCTION(axis2_xml_reader_get_attribute_prefix_by_number);
+PHP_FUNCTION(axis2_xml_reader_get_attribute_namespace_by_number);
+PHP_FUNCTION(axis2_xml_reader_get_attribute_value_by_number);
+PHP_FUNCTION(axis2_xml_reader_get_name);
+PHP_FUNCTION(axis2_xml_reader_get_value);
+PHP_FUNCTION(axis2_xml_reader_get_prefix);
+PHP_FUNCTION(axis2_xml_reader_get_namespace_count);
+PHP_FUNCTION(axis2_xml_reader_get_namespace_uri_by_number);
+PHP_FUNCTION(axis2_xml_reader_get_namespace_prefix_by_number);
+PHP_FUNCTION(axis2_xml_reader_get_pi_target);
+PHP_FUNCTION(axis2_xml_reader_get_pi_data);
+
+/** xml_writer functions */
+
+PHP_FUNCTION(axis2_xml_writer_write_start_element);
+PHP_FUNCTION(axis2_xml_writer_end_start_element);
+PHP_FUNCTION(axis2_xml_writer_write_start_element_with_namespace);
+PHP_FUNCTION(axis2_xml_writer_write_start_element_with_namespace_prefix);
+PHP_FUNCTION(axis2_xml_writer_write_empty_element);
+PHP_FUNCTION(axis2_xml_writer_write_empty_element_with_namespace);
+PHP_FUNCTION(axis2_xml_writer_write_empty_element_with_namespace_prefix);
+PHP_FUNCTION(axis2_xml_writer_write_end_element);
+PHP_FUNCTION(axis2_xml_writer_write_end_document);
+PHP_FUNCTION(axis2_xml_writer_write_attribute);
+PHP_FUNCTION(axis2_xml_writer_write_attribute_with_namespace);
+PHP_FUNCTION(axis2_xml_writer_write_attribute_with_namespace_prefix);
+PHP_FUNCTION(axis2_xml_writer_write_namespace);
+PHP_FUNCTION(axis2_xml_writer_write_default_namespace);
+PHP_FUNCTION(axis2_xml_writer_write_comment);
+PHP_FUNCTION(axis2_xml_writer_write_processing_instruction);
+PHP_FUNCTION(axis2_xml_writer_write_processing_instruction_data);
+PHP_FUNCTION(axis2_xml_writer_write_cdata);
+PHP_FUNCTION(axis2_xml_writer_write_dtd);
+PHP_FUNCTION(axis2_xml_writer_write_entity_ref);
+PHP_FUNCTION(axis2_xml_writer_write_start_document);
+PHP_FUNCTION(axis2_xml_writer_write_start_document_with_version);
+PHP_FUNCTION(axis2_xml_writer_write_start_document_with_version_encoding);
+PHP_FUNCTION(axis2_xml_writer_write_characters);
+PHP_FUNCTION(axis2_xml_writer_get_prefix);
+PHP_FUNCTION(axis2_xml_writer_set_prefix);
+PHP_FUNCTION(axis2_xml_writer_set_default_prefix);
+PHP_FUNCTION(axis2_xml_writer_write_encoded);
+PHP_FUNCTION(axis2_xml_writer_get_xml);
+PHP_METHOD(axis2_xml_writer, __construct);
+
+/********* axis2 qname functions ***************/
+PHP_FUNCTION(axis2_qname_equals);
+PHP_FUNCTION(axis2_qname_clone);
+PHP_FUNCTION(axis2_qname_get_uri);
+PHP_FUNCTION(axis2_qname_get_prefix);
+PHP_FUNCTION(axis2_qname_get_localpart);
+PHP_METHOD(axis2_qname, __construct);
+
+/******** axis2_om_attribute functions *********/
+
+PHP_FUNCTION(axis2_om_attribute_get_qname);
+PHP_FUNCTION(axis2_om_attribute_serialize);
+PHP_FUNCTION(axis2_om_attribute_get_localname);
+PHP_FUNCTION(axis2_om_attribute_get_value);
+PHP_FUNCTION(axis2_om_attribute_set_localname);
+PHP_FUNCTION(axis2_om_attribute_set_value);
+PHP_FUNCTION(axis2_om_attribute_get_namespace);
+PHP_FUNCTION(axis2_om_attribute_set_namespace);
+PHP_METHOD(om_attribute, __construct); 
+
+/******* om_namespace functions ******************/
+PHP_FUNCTION(axis2_om_namespace_equals);
+PHP_FUNCTION(axis2_om_namespace_serialize);
+PHP_FUNCTION(axis2_om_namespace_get_uri);
+PHP_FUNCTION(axis2_om_namespace_get_prefix);
+PHP_METHOD(om_namespace, __construct);
+
+/******* om_element functions ********************/
+PHP_FUNCTION(axis2_om_element_find_namespace);
+PHP_FUNCTION(axis2_om_element_declare_namespace);
+PHP_FUNCTION(axis2_om_element_find_namespace_with_qname);
+PHP_FUNCTION(axis2_om_element_add_attribute);
+PHP_FUNCTION(axis2_om_element_get_attribute);
+PHP_FUNCTION(axis2_om_element_serialize);
+PHP_FUNCTION(axis2_om_element_find_declared_namespace);
+PHP_FUNCTION(axis2_om_element_get_localname);
+PHP_FUNCTION(axis2_om_element_get_namespace);
+PHP_FUNCTION(axis2_om_element_set_namespace);
+PHP_FUNCTION(axis2_om_element_set_localname);
+PHP_METHOD(om_element, __construct);
+
+/******* om_comment functions ******************/
+
+PHP_FUNCTION(axis2_om_comment_serialize);
+PHP_FUNCTION(axis2_om_comment_get_value);
+PHP_FUNCTION(axis2_om_comment_set_value);
+PHP_METHOD(om_comment, __construct);
+
+/******** om_document functions ******************/
+
+PHP_FUNCTION(axis2_om_document_build_next);
+PHP_FUNCTION(axis2_om_document_add_child);
+PHP_FUNCTION(axis2_om_document_get_root_element);
+PHP_FUNCTION(axis2_om_document_set_root_element);
+PHP_FUNCTION(axis2_om_document_build_all);
+PHP_METHOD(om_document, __construct);
+
+
+/******* om_node_functions **********************/
+
+PHP_FUNCTION(axis2_om_node_add_child);
+PHP_FUNCTION(axis2_om_node_detach);
+PHP_FUNCTION(axis2_om_node_insert_sibling_after);
+PHP_FUNCTION(axis2_om_node_insert_sibling_before);
+PHP_FUNCTION(axis2_om_node_set_parent);
+PHP_FUNCTION(axis2_om_node_serialize);
+PHP_FUNCTION(axis2_om_node_get_parent);
+PHP_FUNCTION(axis2_om_node_get_first_child);
+PHP_FUNCTION(axis2_om_node_get_last_child);
+PHP_FUNCTION(axis2_om_node_get_previous_sibling);
+PHP_FUNCTION(axis2_om_node_get_next_sibling);
+PHP_FUNCTION(axis2_om_node_get_node_type);
+PHP_FUNCTION(axis2_om_node_get_build_status);
+PHP_METHOD(om_node, __construct);
+
+/****** om_text functions ************************/
+PHP_FUNCTION(axis2_om_text_serialize);
+PHP_FUNCTION(axis2_om_text_set_value);
+PHP_FUNCTION(axis2_om_text_get_value);
+PHP_METHOD(om_text, __construct);
+
+/***** om_stax_builder **************************/
+
+PHP_FUNCTION(axis2_om_stax_builder_next);
+PHP_FUNCTION(axis2_om_stax_builder_discard_current_element);
+PHP_METHOD(om_stax_builder, __construct);
+
+
+/******** processing instruction functions ******/
+PHP_FUNCTION(axis2_om_pi_set_value);
+PHP_FUNCTION(axis2_om_pi_set_target);
+PHP_FUNCTION(axis2_om_pi_get_value);
+PHP_FUNCTION(axis2_om_pi_getTarget);
+PHP_FUNCTION(axis2_om_pi_serialize);
+PHP_METHOD(om_pi, __construct);
+
+/******** om_output *****************************/
+PHP_METHOD(om_output, __construct);
+
+typedef enum {
+
+    NODE_INVALID = 0,
+    OM_DOCUMENT,
+    OM_ELEMENT,
+    OM_DOCTYPE,
+    OM_COMMENT,
+    OM_ATTRIBUTE,
+    OM_NAMESPACE,
+    OM_PI,
+    OM_TEXT,
+    OM_NODE,
+    AXIS2_XML_READER,
+    AXIS2_XML_WRITER,
+    OM_STAX_BUILDER,
+    AXIS2_QNAME,
+    OM_OUTPUT
+}om_obj_types;
+
+typedef enum{
+    OM_OBJ = 0,
+    OM_NODE_OBJ
+}axis2_obj_types;
+
+#endif /* AXIS2_FE_H */
\ No newline at end of file

Added: webservices/axis2/trunk/c/bindings/php/axis2/axis2_properties.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/axis2_properties.h?rev=353997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/axis2_properties.h (added)
+++ webservices/axis2/trunk/c/bindings/php/axis2/axis2_properties.h Sun Dec  4 22:21:44 2005
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef AXIS2_PROPERTIES_H
+#define AXIS2_PROPERTIES_H
+
+#endif /* AXIS2_PROPERTIES_H */
\ No newline at end of file

Added: webservices/axis2/trunk/c/bindings/php/axis2/config.m4
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/config.m4?rev=353997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/config.m4 (added)
+++ webservices/axis2/trunk/c/bindings/php/axis2/config.m4 Sun Dec  4 22:21:44 2005
@@ -0,0 +1,63 @@
+dnl $Id$
+dnl config.m4 for extension axis2
+
+dnl Comments in this file start with the string 'dnl'.
+dnl Remove where necessary. This file will not work
+dnl without editing.
+
+dnl If your extension references something external, use with:
+
+dnl PHP_ARG_WITH(axis2, for axis2 support,
+dnl Make sure that the comment is aligned:
+dnl [  --with-axis2             Include axis2 support])
+
+dnl Otherwise use enable:
+
+dnl PHP_ARG_ENABLE(axis2, whether to enable axis2 support,
+dnl Make sure that the comment is aligned:
+dnl [  --enable-axis2           Enable axis2 support])
+
+if test "$PHP_AXIS2" != "no"; then
+  dnl Write more examples of tests here...
+
+  dnl # --with-axis2 -> check with-path
+  dnl SEARCH_PATH="/usr/local /usr"     # you might want to change this
+  dnl SEARCH_FOR="/include/axis2.h"  # you most likely want to change this
+  dnl if test -r $PHP_AXIS2/$SEARCH_FOR; then # path given as parameter
+  dnl   AXIS2_DIR=$PHP_AXIS2
+  dnl else # search default path list
+  dnl   AC_MSG_CHECKING([for axis2 files in default path])
+  dnl   for i in $SEARCH_PATH ; do
+  dnl     if test -r $i/$SEARCH_FOR; then
+  dnl       AXIS2_DIR=$i
+  dnl       AC_MSG_RESULT(found in $i)
+  dnl     fi
+  dnl   done
+  dnl fi
+  dnl
+  dnl if test -z "$AXIS2_DIR"; then
+  dnl   AC_MSG_RESULT([not found])
+  dnl   AC_MSG_ERROR([Please reinstall the axis2 distribution])
+  dnl fi
+
+  dnl # --with-axis2 -> add include path
+  dnl PHP_ADD_INCLUDE($AXIS2_DIR/include)
+
+  dnl # --with-axis2 -> check for lib and symbol presence
+  dnl LIBNAME=axis2 # you may want to change this
+  dnl LIBSYMBOL=axis2 # you most likely want to change this 
+
+  dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
+  dnl [
+  dnl   PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $AXIS2_DIR/lib, AXIS2_SHARED_LIBADD)
+  dnl   AC_DEFINE(HAVE_AXIS2LIB,1,[ ])
+  dnl ],[
+  dnl   AC_MSG_ERROR([wrong axis2 lib version or lib not found])
+  dnl ],[
+  dnl   -L$AXIS2_DIR/lib -lm -ldl
+  dnl ])
+  dnl
+  dnl PHP_SUBST(AXIS2_SHARED_LIBADD)
+
+  PHP_NEW_EXTENSION(axis2, axis2.c, $ext_shared)
+fi

Added: webservices/axis2/trunk/c/bindings/php/axis2/config.w32
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/config.w32?rev=353997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/config.w32 (added)
+++ webservices/axis2/trunk/c/bindings/php/axis2/config.w32 Sun Dec  4 22:21:44 2005
@@ -0,0 +1,13 @@
+// $Id$
+// vim:ft=javascript
+
+// If your extension references something external, use ARG_WITH
+// ARG_WITH("axis2", "for axis2 support", "no");
+
+// Otherwise, use ARG_ENABLE
+// ARG_ENABLE("axis2", "enable axis2 support", "no");
+
+if (PHP_AXIS2 != "no") {
+	EXTENSION("axis2", "axis2.c");
+}
+

Added: webservices/axis2/trunk/c/bindings/php/axis2/om_attribute.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/om_attribute.c?rev=353997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/om_attribute.c (added)
+++ webservices/axis2/trunk/c/bindings/php/axis2/om_attribute.c Sun Dec  4 22:21:44 2005
@@ -0,0 +1,270 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_om_node.h"
+#include "axis2_om_attribute.h"
+
+zend_function_entry php_axis2_om_attribute_class_functions[]=
+{
+    PHP_FALIAS(getQname , axis2_om_attribute_get_qname, NULL)
+    PHP_FALIAS(serialize, axis2_om_attribute_serialize, NULL)
+    PHP_FALIAS(getLocalname , axis2_om_attribute_get_localname, NULL)
+    PHP_FALIAS(getValue , axis2_om_attribute_get_value, NULL)
+    PHP_FALIAS(setLocalname , axis2_om_attribute_set_localname, NULL)
+    PHP_FALIAS(setValue , axis2_om_attribute_set_value, NULL)
+    PHP_FALIAS(getNamespace , axis2_om_attribute_get_namespace, NULL)
+    PHP_FALIAS(setNamespace , axis2_om_attribute_set_namespace, NULL)
+    PHP_ME(om_attribute, __construct, NULL, ZEND_ACC_PUBLIC)
+    {NULL, NULL, NULL}
+};
+
+PHP_METHOD(om_attribute, __construct)
+{
+    axis2_object_ptr intern = NULL;
+    om_object_ptr om_obj = NULL;
+    zval *object = NULL;
+    axis2_env_t *env = NULL;
+    char *lname = NULL;
+    char *val =  NULL;
+    int lname_len = 0;
+    int val_len = 0;
+    axis2_om_attribute_t *om_attr = NULL;
+    
+    axis2_object_ptr intern_ns = NULL;
+    om_object_ptr om_obj_ns = NULL;
+    zval *ns_obj = NULL;
+    axis2_om_namespace_t *ns = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OssO!",&object, axis2_om_attribute_class_entry ,&lname, &lname_len, &val, &val_len,
+                    &ns_obj,axis2_om_namespace_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+    intern = (axis2_object_ptr)zend_object_store_get_object(object TSRMLS_CC);
+    om_obj = (om_object_ptr)emalloc(sizeof(om_object));
+    om_obj->obj_type = OM_ATTRIBUTE;
+    om_obj->ptr = NULL;
+   
+    if(ns_obj)
+    {
+        AXIS2_GET_OBJ(om_obj_ns, ns_obj, om_object_ptr, intern_ns);
+        if(om_obj_ns && om_obj_ns->ptr)
+            ns = (axis2_om_namespace_t *)(om_obj_ns->ptr);
+    }
+            
+    om_attr = axis2_om_attribute_create(&env, lname, val, ns);
+    om_obj->ptr = om_attr;
+    intern->ptr = om_obj;        
+}
+
+PHP_FUNCTION(axis2_om_attribute_get_localname)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_om_attribute_t *attr = NULL;
+    char *lname = NULL;
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    
+    attr = (axis2_om_attribute_t *)(om_obj->ptr);
+    
+    if(attr)
+    {
+       lname = AXIS2_OM_ATTRIBUTE_GET_LOCALNAME(attr, &env);
+       RETURN_STRING(lname, 1);     
+    }
+    RETURN_NULL();
+}
+
+/* {{{ proto qname getValue */
+PHP_FUNCTION(axis2_om_attribute_get_value)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_om_attribute_t *attr = NULL;
+    char *value = NULL;
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    
+    attr = (axis2_om_attribute_t *)(om_obj->ptr);
+    
+    if(attr)
+    {
+       value = AXIS2_OM_ATTRIBUTE_GET_VALUE(attr, &env);
+       RETURN_STRING(value, 1);     
+    }
+    RETURN_NULL();
+}
+/* }}} end getValue */
+PHP_FUNCTION(axis2_om_attribute_get_namespace)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_om_attribute_t *attr = NULL;
+    axis2_om_namespace_t *ns = NULL;
+    zval *namespace_obj = NULL;  
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    
+    attr = (axis2_om_attribute_t *)(om_obj->ptr);
+    
+    if(attr)
+    {
+       ns = AXIS2_OM_ATTRIBUTE_GET_NAMESPACE(attr, &env);
+       namespace_obj = php_axis2_create_om_object(ns, 
+                            OM_NAMESPACE, axis2_om_namespace_class_entry TSRMLS_CC);
+       RETURN_ZVAL(namespace_obj, NULL, NULL);                    
+    }
+    RETURN_NULL();
+}
+
+
+PHP_FUNCTION(axis2_om_attribute_get_qname)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_om_attribute_t *attr = NULL;
+    axis2_qname_t *qname = NULL;
+    zval *qname_obj = NULL;  
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+
+    attr = (axis2_om_attribute_t *)(om_obj->ptr);
+    if(attr)
+    {
+       qname = AXIS2_OM_ATTRIBUTE_GET_QNAME(attr, &env);
+       qname_obj = php_axis2_create_om_object(qname, 
+                            AXIS2_QNAME, axis2_qname_class_entry TSRMLS_CC);
+       RETURN_ZVAL(qname_obj, NULL, NULL);                    
+    }
+    RETURN_NULL();
+}
+
+
+PHP_FUNCTION(axis2_om_attribute_set_localname)
+{
+    axis2_object_ptr intern = NULL;
+    om_object_ptr om_obj = NULL;
+    zval *object = NULL;
+    axis2_env_t *env = NULL;
+    char *lname = NULL;
+    int lname_len = 0;
+    axis2_om_attribute_t *om_attr = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "Os",&object, axis2_om_attribute_class_entry ,&lname, &lname_len) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+   
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    if(om_obj)
+    {
+       om_attr = (axis2_om_attribute_t*)(om_obj->ptr);
+       AXIS2_OM_ATTRIBUTE_SET_LOCALNAME(om_attr, &env, lname);
+    }
+}
+PHP_FUNCTION(axis2_om_attribute_set_value)
+{
+    axis2_object_ptr intern = NULL;
+    om_object_ptr om_obj = NULL;
+    zval *object = NULL;
+    axis2_env_t *env = NULL;
+    char *value = NULL;
+    int value_len = 0;
+    axis2_om_attribute_t *om_attr = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "Os",&object, axis2_om_attribute_class_entry ,&value, &value_len) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+   
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    if(om_obj)
+    {
+       om_attr = (axis2_om_attribute_t*)(om_obj->ptr);
+       AXIS2_OM_ATTRIBUTE_SET_VALUE(om_attr, &env, value);
+    }
+
+}
+
+PHP_FUNCTION(axis2_om_attribute_set_namespace)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr ns_intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    om_object_ptr om_ns_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_om_attribute_t *attr = NULL;
+    axis2_om_namespace_t *ns = NULL;
+    zval *ns_obj = NULL;  
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_attribute_class_entry ,&ns_obj, axis2_om_namespace_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    AXIS2_GET_OBJ(om_ns_obj, ns_obj, om_object_ptr, ns_intern);
+    
+    attr = (axis2_om_attribute_t *)(om_obj->ptr);
+    ns   = (axis2_om_namespace_t *)(om_ns_obj->ptr);
+    
+    if(attr && ns)
+    {
+        AXIS2_OM_ATTRIBUTE_SET_NAMESPACE(attr, &env, ns);   
+    }
+    RETURN_NULL();
+}
+
+PHP_FUNCTION(axis2_om_attribute_serialize)
+{
+}

Added: webservices/axis2/trunk/c/bindings/php/axis2/om_comment.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/om_comment.c?rev=353997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/om_comment.c (added)
+++ webservices/axis2/trunk/c/bindings/php/axis2/om_comment.c Sun Dec  4 22:21:44 2005
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_om_node.h"
+#include "axis2_om_comment.h"
+
+zend_function_entry php_axis2_om_comment_class_functions[]=
+{
+  /*  PHP_FALIAS(serialize , axis2_om_comment_serialize, NULL) */
+    PHP_FALIAS(getValue , axis2_om_comment_get_value, NULL)
+    PHP_FALIAS(setValue , axis2_om_comment_set_value, NULL)
+    PHP_ME(om_comment, __construct, NULL, ZEND_ACC_PUBLIC)
+    { NULL, NULL, NULL}
+};
+
+PHP_METHOD(om_comment, __construct)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_parent = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    om_node_ptr node_obj_parent = NULL;
+    
+    zval *object = NULL;
+    zval *object_parent = NULL;
+    
+    axis2_env_t *env = NULL;
+    char *value = NULL;
+    int value_len = 0;
+
+    axis2_om_comment_t *om_comment = NULL;
+    axis2_om_node_t *node = NULL;
+    axis2_om_node_t *node_parent = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO!s",&object, axis2_om_comment_class_entry, &object_parent,
+                    axis2_om_node_class_entry, &value, &value_len) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+    
+    intern = (axis2_object_ptr)zend_object_store_get_object(object TSRMLS_CC);
+    node_obj = (om_node_ptr)emalloc(sizeof(om_node_t));
+    node_obj->builder = NULL;
+    node_obj->doc = NULL;
+    node_obj->node_type = OM_COMMENT;
+    
+    if(object_parent)
+    {
+        AXIS2_GET_OBJ(node_obj_parent, object_parent, om_node_ptr, intern_parent);
+        if(node_obj_parent && node_obj_parent->ptr)
+            node_parent = (axis2_om_node_t *)(node_obj_parent->ptr);
+    }
+    
+    om_comment = axis2_om_comment_create(&env, node_parent, value, &node);
+    node_obj->ptr = node;
+    intern->obj_type = OM_NODE_OBJ;
+    intern->ptr = node_obj;
+}
+
+
+PHP_FUNCTION(axis2_om_comment_serialize){}
+
+PHP_FUNCTION(axis2_om_comment_get_value)
+{
+    axis2_object_ptr intern = NULL;
+    om_node_ptr node_obj = NULL;
+    zval *object = NULL;
+    axis2_env_t *env = NULL;
+    char *value = NULL;
+
+    axis2_om_comment_t *om_comment = NULL;
+    axis2_om_node_t *node = NULL;
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+            
+    node = (axis2_om_node_t *)(node_obj->ptr);
+    
+    if(node)
+    {
+        om_comment = (axis2_om_comment_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(node, &env);
+        value = AXIS2_OM_COMMENT_GET_VALUE(om_comment, &env);
+        RETURN_STRING(value, 1);
+    }
+    RETURN_NULL();
+}
+PHP_FUNCTION(axis2_om_comment_set_value)
+{
+    axis2_object_ptr intern = NULL;
+    om_node_ptr node_obj = NULL;
+    
+    zval *object = NULL;
+    axis2_env_t *env = NULL;
+    char *value = NULL;
+    int value_len = 0;
+
+    axis2_om_comment_t *om_comment = NULL;
+    axis2_om_node_t *node = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "Os",&object, axis2_om_comment_class_entry, &value, &value_len) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    
+    node = (axis2_om_node_t *)(node_obj->ptr);
+    
+    om_comment = (axis2_om_comment_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(node, &env);     
+    AXIS2_OM_COMMENT_SET_VALUE(om_comment, &env, value);
+}

Added: webservices/axis2/trunk/c/bindings/php/axis2/om_doctype.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/om_doctype.c?rev=353997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/om_doctype.c (added)
+++ webservices/axis2/trunk/c/bindings/php/axis2/om_doctype.c Sun Dec  4 22:21:44 2005
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_om_node.h"
+#include "axis2_om_doctype.h"
+

Added: webservices/axis2/trunk/c/bindings/php/axis2/om_document.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/om_document.c?rev=353997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/om_document.c (added)
+++ webservices/axis2/trunk/c/bindings/php/axis2/om_document.c Sun Dec  4 22:21:44 2005
@@ -0,0 +1,176 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_om_document.h"
+
+zend_function_entry php_axis2_om_document_class_functions[] = 
+{
+    PHP_FALIAS(buildNext , axis2_om_document_build_next, NULL)
+    PHP_FALIAS(addChild , axis2_om_document_add_child, NULL)
+    PHP_FALIAS(getRootElement , axis2_om_document_get_root_element, NULL)
+    PHP_FALIAS(setRootElement , axis2_om_document_set_root_element, NULL)
+    PHP_FALIAS(buildAll , axis2_om_document_build_all, NULL)
+    PHP_ME(om_document, __construct, NULL, ZEND_ACC_PUBLIC)
+    { NULL, NULL, NULL}    
+};
+
+
+PHP_METHOD(om_document, __construct)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_root = NULL;
+    axis2_object_ptr intern_builder = NULL;
+   
+    
+    om_object_ptr om_obj = NULL;
+    om_node_ptr node_obj_root = NULL;
+    om_object_ptr om_obj_builder = NULL;
+    
+    
+    zval *object = NULL;
+    zval *object_root = NULL;
+    zval *object_builder = NULL;
+    
+    
+    axis2_om_stax_builder_t *builder = NULL;
+    axis2_om_node_t *root = NULL;
+    axis2_om_document_t *document = NULL;
+    axis2_env_t *env = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO!O!",&object, axis2_om_document_class_entry, &object_root,
+             axis2_om_node_class_entry, &object_builder, 
+             axis2_om_stax_builder_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_OBJ(om_obj_builder, object_builder, om_object_ptr, intern_builder);
+    
+    AXIS2_GET_OBJ(node_obj_root, object_root, om_node_ptr, intern_root);
+    
+    intern = (axis2_object_ptr)zend_object_store_get_object(object TSRMLS_CC);
+    om_obj = (om_object_ptr)emalloc(sizeof(om_object));
+    om_obj->obj_type = OM_DOCUMENT;
+    om_obj->ptr = NULL;
+    
+    builder = (axis2_om_stax_builder_t *)(om_obj_builder->ptr);
+    root    = (axis2_om_node_t *)(node_obj_root->ptr);
+    
+    document = axis2_om_document_create(&env, root, builder);
+    om_obj->ptr = document;
+    intern->ptr = om_obj; 
+}
+
+PHP_FUNCTION(axis2_om_document_build_next)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_node = NULL;
+    
+    
+    om_object_ptr om_obj = NULL;
+    om_node_ptr node_obj = NULL;
+        
+    zval *object = NULL;
+    zval *object_node = NULL;
+    
+    
+    axis2_om_node_t *node = NULL;
+    axis2_om_document_t *document = NULL;
+    axis2_env_t *env = NULL; 
+    int node_type = 0;   
+    zend_class_entry *ce_node = NULL;
+
+    AXIS2_GET_THIS(object);
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    env = php_axis2_get_env();
+    
+    document = (axis2_om_document_t *)(om_obj->ptr);
+    
+    
+    
+    if(document)
+    {
+        node = AXIS2_OM_DOCUMENT_BUILD_NEXT(document, &env);  
+        if(node)
+        {
+            node_type = AXIS2_OM_NODE_GET_NODE_TYPE(node, &env);
+            ce_node = php_axis2_get_class_type(node_type);
+            object_node = php_axis2_create_om_node_object(node, node_type, ce_node TSRMLS_CC);
+            RETURN_ZVAL(object_node, NULL, NULL);        
+        }    
+    }    
+    RETURN_NULL();    
+}
+PHP_FUNCTION(axis2_om_document_add_child)
+{
+     php_printf("not implemented yet");
+}
+PHP_FUNCTION(axis2_om_document_get_root_element)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_node = NULL;
+    
+    
+    om_object_ptr om_obj = NULL;
+    om_node_ptr node_obj = NULL;
+        
+    zval *object = NULL;
+    zval *object_node = NULL;
+    
+    
+    axis2_om_node_t *node = NULL;
+    axis2_om_document_t *document = NULL;
+    axis2_env_t *env = NULL; 
+    int node_type = 0;   
+    zend_class_entry *ce_node = NULL;
+
+    AXIS2_GET_THIS(object);
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    env = php_axis2_get_env();
+    
+    document = (axis2_om_document_t *)(om_obj->ptr);
+    
+    
+    
+    if(document)
+    {
+        node = AXIS2_OM_DOCUMENT_GET_ROOT_ELEMENT(document, &env);  
+        if(node)
+        {
+            node_type = AXIS2_OM_NODE_GET_NODE_TYPE(node, &env);
+            ce_node = php_axis2_get_class_type(node_type);
+            object_node = php_axis2_create_om_node_object(node, node_type, ce_node TSRMLS_CC);
+            RETURN_ZVAL(object_node, NULL, NULL);        
+        }    
+    }    
+    RETURN_NULL();    
+}
+
+PHP_FUNCTION(axis2_om_document_set_root_element)
+{
+    php_printf("not implemented yet");
+}
+PHP_FUNCTION(axis2_om_document_build_all)
+{
+ php_printf("not implemented yet");
+}

Added: webservices/axis2/trunk/c/bindings/php/axis2/om_element.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/om_element.c?rev=353997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/om_element.c (added)
+++ webservices/axis2/trunk/c/bindings/php/axis2/om_element.c Sun Dec  4 22:21:44 2005
@@ -0,0 +1,322 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_om_node.h"
+#include "axis2_om_element.h"
+
+zend_function_entry php_axis2_om_element_class_functions[]=
+{
+    PHP_FALIAS(findNamespace , axis2_om_element_find_namespace, NULL)
+    PHP_FALIAS(declareNamespace , axis2_om_element_declare_namespace, NULL)
+    PHP_FALIAS(findNamespaceWithQname , axis2_om_element_find_namespace_with_qname, NULL)
+    PHP_FALIAS(addAttribute , axis2_om_element_add_attribute, NULL)
+    PHP_FALIAS(getAttribute , axis2_om_element_get_attribute, NULL)
+ /*   PHP_FALIAS(serialize , axis2_om_element_serialize, NULL) */
+    PHP_FALIAS(findDeclaredNamespace , axis2_om_element_find_declared_namespace, NULL)
+    PHP_FALIAS(getLocalname , axis2_om_element_get_localname, NULL)
+    PHP_FALIAS(getNamespace , axis2_om_element_get_namespace, NULL)
+    PHP_FALIAS(setNamespace , axis2_om_element_set_namespace, NULL)
+    PHP_FALIAS(setLocalname , axis2_om_element_set_localname, NULL)
+    PHP_ME(om_element, __construct, NULL, ZEND_ACC_PUBLIC)
+{NULL, NULL, NULL}
+};
+
+PHP_METHOD(om_element, __construct)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_parent = NULL;
+    axis2_object_ptr intern_ns = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    om_node_ptr node_obj_parent = NULL;
+    om_object_ptr om_obj_ns = NULL;
+    
+    zval *object = NULL;
+    zval *object_parent = NULL;
+    zval *object_ns = NULL;
+    
+    axis2_env_t *env = NULL;
+    char *lname = NULL;
+    int lname_len = 0;
+    char *n = NULL;
+
+    axis2_om_element_t *om_element = NULL;
+    axis2_om_node_t *node = NULL;
+    axis2_om_node_t *node_parent = NULL;
+    axis2_om_namespace_t *ns = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO!sO!",&object, axis2_om_element_class_entry, &object_parent,
+                    axis2_om_node_class_entry, &lname, &lname_len,
+                    &object_ns, axis2_om_namespace_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+    
+    intern = (axis2_object_ptr)zend_object_store_get_object(object TSRMLS_CC);
+    node_obj = (om_node_ptr)emalloc(sizeof(om_node_t));
+    node_obj->builder = NULL;
+    node_obj->doc = NULL;
+    node_obj->node_type = OM_ELEMENT;
+    
+    if(object_parent)
+    {
+        AXIS2_GET_OBJ(node_obj_parent, object_parent, om_node_ptr, intern_parent);
+        if(node_obj_parent && node_obj_parent->ptr)
+            node_parent = (axis2_om_node_t *)(node_obj_parent->ptr);
+    }
+    if(object_ns)
+    {
+        AXIS2_GET_OBJ(om_obj_ns, object_ns, om_object_ptr, intern_ns);
+        if(om_obj_ns && om_obj_ns->ptr)
+            ns = (axis2_om_namespace_t *)(om_obj_ns->ptr);
+    }
+    
+    om_element = axis2_om_element_create(&env, node_parent, lname, ns, &node);
+    node_obj->ptr = node;
+    intern->obj_type = OM_NODE_OBJ;
+    intern->ptr = node_obj;
+}
+
+
+PHP_FUNCTION(axis2_om_element_get_localname)
+{
+    axis2_object_ptr intern = NULL;
+    om_node_ptr node_obj = NULL;
+    
+    zval *object = NULL;
+    
+    axis2_env_t *env = NULL;
+    char *localname = NULL;
+    axis2_om_element_t *om_element = NULL;
+    axis2_om_node_t *node = NULL;
+
+    AXIS2_GET_THIS(object);
+    
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    node = (axis2_om_node_t*)(node_obj->ptr);
+    om_element = (axis2_om_element_t*)AXIS2_OM_NODE_GET_DATA_ELEMENT(node , &env);
+   
+    localname = AXIS2_OM_ELEMENT_GET_LOCALNAME(om_element, &env);
+    if(localname)
+    {
+        RETURN_STRING(localname, 1);
+    }
+    RETURN_NULL();
+   
+}
+PHP_FUNCTION(axis2_om_element_get_namespace)
+{
+    axis2_object_ptr intern = NULL;
+    om_node_ptr node_obj = NULL;
+    zval *object = NULL;
+    zval *object_ns = NULL;
+    
+    axis2_env_t *env = NULL;
+    axis2_om_element_t *om_element = NULL;
+    axis2_om_node_t *node = NULL;
+    axis2_om_namespace_t *ns = NULL;
+   
+    AXIS2_GET_THIS(object);
+    env = php_axis2_get_env();
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    
+    node = (axis2_om_node_t*)(node_obj->ptr);
+    om_element = (axis2_om_element_t*)AXIS2_OM_NODE_GET_DATA_ELEMENT(node , &env);
+   
+    ns = AXIS2_OM_ELEMENT_GET_NAMESPACE(om_element, &env);
+    if(ns)
+    {
+        object_ns = php_axis2_create_om_object(ns, OM_OBJ, axis2_om_namespace_class_entry TSRMLS_CC);         
+        RETURN_ZVAL(object_ns, NULL, NULL);
+    }
+    RETURN_NULL();
+}
+
+
+PHP_FUNCTION(axis2_om_element_get_attribute)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_qname = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    om_object_ptr qname_obj = NULL;
+    
+    zval *object = NULL;
+    zval *object_attr = NULL;
+    zval *object_qname = NULL;
+    
+    axis2_env_t *env = NULL;
+    axis2_om_element_t *om_element = NULL;
+    axis2_om_node_t *node = NULL;
+    axis2_om_attribute_t *attr = NULL;
+    axis2_qname_t *qname = NULL;
+   
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_element_class_entry, &object_qname,
+                    axis2_qname_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    AXIS2_GET_OBJ(qname_obj, object_qname, om_object_ptr, intern_qname);
+    
+    node = (axis2_om_node_t*)(node_obj->ptr);
+    om_element = (axis2_om_element_t*)AXIS2_OM_NODE_GET_DATA_ELEMENT(node , &env);
+    qname = (axis2_qname_t *)(qname_obj->ptr);
+    
+    attr = AXIS2_OM_ELEMENT_GET_ATTRIBUTE(om_element, &env, qname);
+    if(attr)
+    {
+        object_attr = php_axis2_create_om_object(attr, OM_OBJ, axis2_om_attribute_class_entry TSRMLS_CC);         
+        RETURN_ZVAL(object_attr, NULL, NULL);
+    }
+    RETURN_NULL();
+}
+
+PHP_FUNCTION(axis2_om_element_add_attribute)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_attr = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    om_object_ptr attr_obj = NULL;
+    
+    zval *object = NULL;
+    zval *object_attr = NULL;
+    
+    axis2_env_t *env = NULL;
+    axis2_om_element_t *om_element = NULL;
+    axis2_om_node_t *node = NULL;
+    axis2_om_attribute_t *attr = NULL;
+   
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_element_class_entry, &object_attr,
+                    axis2_om_attribute_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    AXIS2_GET_OBJ(attr_obj, object_attr, om_object_ptr, intern_attr);
+    
+    node = (axis2_om_node_t*)(node_obj->ptr);
+    om_element = (axis2_om_element_t*)AXIS2_OM_NODE_GET_DATA_ELEMENT(node , &env);
+    attr = (axis2_om_attribute_t *)(attr_obj->ptr);
+    if(attr)
+    {
+        AXIS2_OM_ELEMENT_ADD_ATTRIBUTE(om_element, &env, attr);
+    }
+}
+
+
+PHP_FUNCTION(axis2_om_element_set_namespace)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_ns = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    om_object_ptr om_obj = NULL;
+    
+    zval *object = NULL;
+    zval *object_ns = NULL;
+    
+    axis2_env_t *env = NULL;
+    axis2_om_element_t *om_element = NULL;
+    axis2_om_node_t *node = NULL;
+    axis2_om_namespace_t *ns = NULL;
+   
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_element_class_entry, &object_ns,
+                    axis2_om_namespace_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    AXIS2_GET_OBJ(om_obj, object_ns , om_object_ptr, intern_ns);
+    
+    node = (axis2_om_node_t*)(node_obj->ptr);
+    om_element = (axis2_om_element_t*)AXIS2_OM_NODE_GET_DATA_ELEMENT(node , &env);
+    ns  = (axis2_om_namespace_t *)(om_obj->ptr);
+    if(ns)
+    {
+        AXIS2_OM_ELEMENT_SET_NAMESPACE(om_element, &env, ns, node);
+    }
+}
+
+
+PHP_FUNCTION(axis2_om_element_set_localname)
+{
+    axis2_object_ptr intern = NULL;
+    om_node_ptr node_obj = NULL;
+    zval *object = NULL;
+
+    char *localname = NULL;
+    int lnamelen = 0;
+    
+    axis2_env_t *env = NULL;
+    axis2_om_element_t *om_element = NULL;
+    axis2_om_node_t *node = NULL;
+   
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "Os",&object, axis2_om_element_class_entry, &localname,
+                    &lnamelen) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    
+    node = (axis2_om_node_t*)(node_obj->ptr);
+    om_element = (axis2_om_element_t*)AXIS2_OM_NODE_GET_DATA_ELEMENT(node , &env);
+    if(om_element)
+    {
+        AXIS2_OM_ELEMENT_SET_LOCALNAME(om_element, &env, localname);
+    }
+}
+
+
+PHP_FUNCTION(axis2_om_element_serialize)
+{
+
+}
+
+
+PHP_FUNCTION(axis2_om_element_find_namespace)
+{}
+PHP_FUNCTION(axis2_om_element_declare_namespace)
+{}
+
+PHP_FUNCTION(axis2_om_element_find_namespace_with_qname)
+{}
+PHP_FUNCTION(axis2_om_element_find_declared_namespace){}

Added: webservices/axis2/trunk/c/bindings/php/axis2/om_namespace.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/om_namespace.c?rev=353997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/om_namespace.c (added)
+++ webservices/axis2/trunk/c/bindings/php/axis2/om_namespace.c Sun Dec  4 22:21:44 2005
@@ -0,0 +1,165 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_om_node.h"
+#include "axis2_om_namespace.h"
+
+zend_function_entry php_axis2_om_namespace_class_functions[]=
+{
+    PHP_FALIAS(equals , axis2_om_namespace_equals, NULL)
+    PHP_FALIAS(serialize , axis2_om_namespace_serialize, NULL)
+    PHP_FALIAS(getUri , axis2_om_namespace_get_uri, NULL)
+    PHP_FALIAS(getPrefix , axis2_om_namespace_get_prefix, NULL)
+    PHP_ME(om_namespace, __construct, NULL, ZEND_ACC_PUBLIC)
+    {NULL, NULL, NULL} 
+};
+
+/* {{{ om_namespace __construct [ string, string ] */
+PHP_METHOD(om_namespace, __construct)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    axis2_env_t *env = NULL;
+    char *ns_uri = NULL;
+    char *prefix = NULL;
+    int urilen = 0;
+    int prefixlen = 0;
+    axis2_om_namespace_t *om_namespace = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "Oss",&object, axis2_om_namespace_class_entry ,&ns_uri, &urilen, &prefix, &prefixlen) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+  
+    env = php_axis2_get_env();
+    intern = (axis2_object_ptr)zend_object_store_get_object(object TSRMLS_CC);
+    om_obj = (om_object_ptr)emalloc(sizeof(om_object));
+    om_obj->obj_type = OM_NAMESPACE;
+    om_obj->ptr = NULL;
+    
+    om_namespace = axis2_om_namespace_create (&env, ns_uri, prefix);
+    if(!om_namespace)
+    {
+        php_error_docref(NULL TSRMLS_CC, E_OUTOFMEMORY, " namespace create failure ");
+    }
+    
+    om_obj->ptr = om_namespace;
+    
+    intern->obj_type = OM_OBJ;
+    intern->ptr = om_obj;
+}
+
+/* }}} end om_namespace __construct */
+
+/* {{{ om_namespace equals */
+PHP_FUNCTION(axis2_om_namespace_equals)
+{
+    axis2_object_ptr intern= NULL;
+    axis2_object_ptr intern1 = NULL;
+    zval *object = NULL;
+    zval *ns_obj = NULL;
+    om_object_ptr this_ns = NULL;
+    om_object_ptr ns_to_cmp = NULL;
+    axis2_env_t *env = NULL;
+    axis2_om_namespace_t *ns1 = NULL;
+    axis2_om_namespace_t *ns2 = NULL;
+    axis2_bool_t equals = AXIS2_FALSE;
+    
+    env = php_axis2_get_env();
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_namespace_class_entry , &ns_obj, axis2_om_namespace_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    } 
+    
+    AXIS2_GET_OBJ(this_ns, object, om_object_ptr, intern);
+    AXIS2_GET_OBJ(ns_to_cmp, ns_obj, om_object_ptr, intern1);
+    
+    ns1 = (axis2_om_namespace_t *)(this_ns->ptr);
+    ns2 = (axis2_om_namespace_t *)(ns_to_cmp->ptr);
+    
+    equals = AXIS2_OM_NAMESPACE_EQUALS(ns1, &env, ns2);
+    
+    if(equals == AXIS2_TRUE)
+    {
+        RETURN_BOOL(1);
+    }
+    if(equals == AXIS2_FALSE) 
+    {
+        RETURN_BOOL(0);
+    }
+}
+/* }}} end om_namespace equals */
+
+
+
+PHP_FUNCTION(axis2_om_namespace_get_uri)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_om_namespace_t *ns = NULL;
+    char *uri;
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    
+    ns = (axis2_om_namespace_t *)(om_obj->ptr);
+    
+    if(ns)
+    {
+       uri = AXIS2_OM_NAMESPACE_GET_URI(ns, &env);
+       RETURN_STRING(uri, 1);     
+    }
+    RETURN_NULL();
+}
+
+
+PHP_FUNCTION(axis2_om_namespace_get_prefix)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_om_namespace_t *ns = NULL;
+    char *prefix;
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    
+    ns = (axis2_om_namespace_t *)(om_obj->ptr);
+    
+    if(ns)
+    {
+       prefix = AXIS2_OM_NAMESPACE_GET_PREFIX(ns, &env);
+       RETURN_STRING(prefix, 1);     
+    }
+    RETURN_NULL();
+}
+
+PHP_FUNCTION(axis2_om_namespace_serialize){}

Added: webservices/axis2/trunk/c/bindings/php/axis2/om_node.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/om_node.c?rev=353997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/om_node.c (added)
+++ webservices/axis2/trunk/c/bindings/php/axis2/om_node.c Sun Dec  4 22:21:44 2005
@@ -0,0 +1,419 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_om_node.h"
+#include "axis2_om_element.h"
+
+zend_function_entry php_axis2_om_node_class_functions[] =
+{
+    PHP_FALIAS(addChild , axis2_om_node_add_child, NULL)
+    PHP_FALIAS(detach , axis2_om_node_detach, NULL)
+    PHP_FALIAS(insertSiblingAfter , axis2_om_node_insert_sibling_after, NULL)
+    PHP_FALIAS(insertSiblingBefore , axis2_om_node_insert_sibling_before, NULL)
+    PHP_FALIAS(setParent , axis2_om_node_set_parent, NULL)
+    PHP_FALIAS(serialize , axis2_om_node_serialize, NULL)
+    PHP_FALIAS(getParent , axis2_om_node_get_parent, NULL)
+    PHP_FALIAS(getFirstChild , axis2_om_node_get_first_child, NULL)
+    PHP_FALIAS(getLastChild , axis2_om_node_get_last_child, NULL)
+    PHP_FALIAS(getPreviousSibling , axis2_om_node_get_previous_sibling, NULL)
+    PHP_FALIAS(getNextSibling , axis2_om_node_get_next_sibling, NULL)
+    PHP_FALIAS(getNodeType , axis2_om_node_get_node_type, NULL)
+    PHP_FALIAS(isComplete , axis2_om_node_get_build_status, NULL)
+    PHP_ME(om_node, __construct, NULL, ZEND_ACC_PRIVATE)
+    { NULL, NULL, NULL}
+};
+/*
+static zend_class_entry* php_axis2_get_class_type(int node_type)
+{
+    zend_class_entry *ce = NULL;
+    switch(node_type)
+    {
+        case OM_ELEMENT:
+            ce = axis2_om_element_class_entry;
+            break;
+        case OM_TEXT: 
+            ce = axis2_om_text_class_entry;
+            break;
+        case OM_PI:
+            ce = axis2_om_pi_class_entry;
+            break;
+        case OM_COMMENT:
+            ce = axis2_om_comment_class_entry;            
+            break;
+        default:
+            ce = NULL;
+            break;    
+    }
+    return ce;
+}
+*/
+PHP_METHOD(om_node, __construct)
+{
+
+}
+
+/* {{{ proto void Axis2OMNode::addChild */
+PHP_FUNCTION(axis2_om_node_add_child)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_child = NULL;
+    
+    zval *object = NULL;
+    zval *obj_child = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    om_node_ptr node_obj_child = NULL;
+    
+    axis2_om_node_t *om_node = NULL;
+    axis2_om_node_t *child   = NULL;
+    axis2_env_t *env = NULL;
+     
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_node_class_entry ,&obj_child,axis2_om_node_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    
+    env = php_axis2_get_env();
+ 
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+       
+    AXIS2_GET_OBJ(node_obj_child, obj_child, om_node_ptr, intern_child);
+    
+    om_node = (axis2_om_node_t *)(node_obj->ptr);
+    child = (axis2_om_node_t *)(node_obj_child->ptr);
+    /* this should be fixed */
+    AXIS2_OM_NODE_ADD_CHILD(child, &env, om_node);    
+    
+}
+/* }}} */
+
+PHP_FUNCTION(axis2_om_node_detach)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_node_ptr node_obj = NULL;
+    axis2_om_node_t *om_node = NULL;
+    axis2_env_t *env = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_node_class_entry ) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    
+    env = php_axis2_get_env();
+ 
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    om_node = (axis2_om_node_t *)(node_obj->ptr);
+    AXIS2_OM_NODE_DETACH(om_node, &env);    
+}
+
+PHP_FUNCTION(axis2_om_node_set_parent)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_parent = NULL;
+    
+    zval *object = NULL;
+    zval *obj_parent = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    om_node_ptr node_obj_parent = NULL;
+    
+    axis2_om_node_t *om_node = NULL;
+    axis2_om_node_t *parent   = NULL;
+    axis2_env_t *env = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_node_class_entry ,&obj_parent,axis2_om_node_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    
+    env = php_axis2_get_env();
+ 
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+       
+    AXIS2_GET_OBJ(node_obj_parent, obj_parent, om_node_ptr, intern_parent);
+    
+    om_node = (axis2_om_node_t *)(node_obj->ptr);
+    parent = (axis2_om_node_t *)(node_obj_parent->ptr);
+    AXIS2_OM_NODE_SET_PARENT(om_node, &env, parent);    
+}
+
+PHP_FUNCTION(axis2_om_node_get_node_type)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_node_ptr node_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_om_node_t *om_node = NULL;
+    int node_type = 0;
+        
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    
+    om_node = (axis2_om_node_t *)(node_obj->ptr);
+    node_type = AXIS2_OM_NODE_GET_NODE_TYPE(om_node, &env);
+    RETURN_LONG(node_type);
+}
+
+PHP_FUNCTION(axis2_om_node_get_build_status)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_node_ptr node_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_om_node_t *om_node = NULL;
+    axis2_bool_t status = AXIS2_FALSE;
+        
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    
+    om_node = (axis2_om_node_t *)(node_obj->ptr);
+    status = AXIS2_OM_NODE_GET_BUILD_STATUS(om_node, &env);
+    RETURN_BOOL(status);
+}
+
+PHP_FUNCTION(axis2_om_node_get_parent)
+{
+    zend_class_entry *parent_ce = NULL;
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_parent = NULL;
+    
+    zval *object = NULL;
+    zval *obj_parent = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    
+    axis2_om_node_t *om_node = NULL;
+    axis2_om_node_t *parent   = NULL;
+    axis2_env_t *env = NULL;
+    int parent_node_type = 0;
+    
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+       
+    om_node = (axis2_om_node_t *)(node_obj->ptr);
+    parent = AXIS2_OM_NODE_GET_PARENT(om_node, &env);
+    if(parent)
+    {
+        parent_node_type = AXIS2_OM_NODE_GET_NODE_TYPE(parent, &env);
+        parent_ce = php_axis2_get_class_type(parent_node_type);
+        obj_parent = php_axis2_create_om_node_object(parent, 
+                        parent_node_type, parent_ce TSRMLS_CC);
+        RETURN_ZVAL(obj_parent, NULL, NULL);    
+    }
+    RETURN_NULL();
+}
+PHP_FUNCTION(axis2_om_node_get_first_child)
+{
+    zend_class_entry *child_ce = NULL;
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_child = NULL;
+    
+    zval *object = NULL;
+    zval *obj_child = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    
+    axis2_om_node_t *om_node = NULL;
+    axis2_om_node_t *child   = NULL;
+    axis2_env_t *env = NULL;
+    int child_node_type = 0;
+    axis2_om_element_t *e = NULL;
+    
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+       
+    om_node = (axis2_om_node_t *)(node_obj->ptr);
+    
+    child = AXIS2_OM_NODE_GET_FIRST_CHILD(om_node, &env);
+    if(child)
+    {
+        child_node_type = AXIS2_OM_NODE_GET_NODE_TYPE(child, &env);
+        child_ce = php_axis2_get_class_type(child_node_type);
+        obj_child = php_axis2_create_om_node_object(child, 
+                        child_node_type, child_ce TSRMLS_CC);
+        RETURN_ZVAL(obj_child, NULL, NULL);   
+        
+    }
+    RETURN_NULL();
+    
+}
+
+PHP_FUNCTION(axis2_om_node_get_last_child)
+{
+    zend_class_entry *child_ce = NULL;
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_child = NULL;
+    
+    zval *object = NULL;
+    zval *obj_child = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    
+    axis2_om_node_t *om_node = NULL;
+    axis2_om_node_t *child   = NULL;
+    axis2_env_t *env = NULL;
+    int child_node_type = 0;
+    
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+       
+    om_node = (axis2_om_node_t *)(node_obj->ptr);
+    child = AXIS2_OM_NODE_GET_LAST_CHILD(om_node, &env);
+    if(child)
+    {
+        child_node_type = AXIS2_OM_NODE_GET_NODE_TYPE(child, &env);
+        child_ce = php_axis2_get_class_type(child_node_type);
+        obj_child = php_axis2_create_om_node_object(child, 
+                        child_node_type, child_ce TSRMLS_CC);
+        RETURN_ZVAL(obj_child, NULL, NULL);    
+    }
+    RETURN_NULL();
+}
+
+PHP_FUNCTION(axis2_om_node_get_previous_sibling)
+{
+    zend_class_entry *sibling_ce = NULL;
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_sibling = NULL;
+    
+    zval *object = NULL;
+    zval *obj_sibling = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    
+    axis2_om_node_t *om_node = NULL;
+    axis2_om_node_t *sibling   = NULL;
+    axis2_env_t *env = NULL;
+    int sibling_node_type = 0;
+    
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+       
+    om_node = (axis2_om_node_t *)(node_obj->ptr);
+    sibling = AXIS2_OM_NODE_GET_PREVIOUS_SIBLING(om_node, &env);
+    if(sibling)
+    {
+        sibling_node_type = AXIS2_OM_NODE_GET_NODE_TYPE(sibling, &env);
+        sibling_ce = php_axis2_get_class_type(sibling_node_type);
+        obj_sibling = php_axis2_create_om_node_object(sibling, 
+                        sibling_node_type, sibling_ce TSRMLS_CC);
+        RETURN_ZVAL(obj_sibling, NULL, NULL);    
+    }
+    RETURN_NULL();
+}
+
+PHP_FUNCTION(axis2_om_node_get_next_sibling)
+{
+    zend_class_entry *sibling_ce = NULL;
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_sibling = NULL;
+    
+    zval *object = NULL;
+    zval *obj_sibling = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    
+    axis2_om_node_t *om_node = NULL;
+    axis2_om_node_t *sibling   = NULL;
+    axis2_env_t *env = NULL;
+    int sibling_node_type = 0;
+    
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+       
+    om_node = (axis2_om_node_t *)(node_obj->ptr);
+    sibling = AXIS2_OM_NODE_GET_NEXT_SIBLING(om_node, &env);
+    if(sibling)
+    {
+        sibling_node_type = AXIS2_OM_NODE_GET_NODE_TYPE(sibling, &env);
+        sibling_ce = php_axis2_get_class_type(sibling_node_type);
+        obj_sibling = php_axis2_create_om_node_object(sibling, 
+                        sibling_node_type, sibling_ce TSRMLS_CC);
+        RETURN_ZVAL(obj_sibling, NULL, NULL);    
+    }
+    RETURN_NULL();
+}
+PHP_FUNCTION(axis2_om_node_serialize)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_output = NULL;
+    
+    zval *object = NULL;
+    zval *object_output = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    om_object_ptr om_obj_output = NULL;
+    
+    axis2_om_output_t *output = NULL;
+    axis2_om_node_t *node = NULL;
+    axis2_env_t *env = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_node_class_entry,
+             &object_output , axis2_om_output_class_entry ) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    AXIS2_GET_OBJ(om_obj_output, object_output, om_object_ptr, intern_output);
+    
+    node = (axis2_om_node_t *)(node_obj->ptr);
+    output = (axis2_om_output_t *)(om_obj_output->ptr);
+    
+    AXIS2_OM_NODE_SERIALIZE(node, &env, output);
+}
+PHP_FUNCTION(axis2_om_node_insert_sibling_after)
+{
+    php_printf("not implemented yet");
+}
+PHP_FUNCTION(axis2_om_node_insert_sibling_before)
+{
+    php_printf("not implemented yet");
+}
+
+
+

Added: webservices/axis2/trunk/c/bindings/php/axis2/om_output.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/om_output.c?rev=353997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/om_output.c (added)
+++ webservices/axis2/trunk/c/bindings/php/axis2/om_output.c Sun Dec  4 22:21:44 2005
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_om_output.h"
+#include "axis2_xml_writer.h"
+
+extern zend_function_entry php_axis2_om_output_class_functions[] =
+{
+    PHP_ME(om_output, __construct, NULL, ZEND_ACC_PUBLIC)
+    { NULL, NULL, NULL}
+};
+
+PHP_METHOD(om_output, __construct)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_writer = NULL;
+    
+    zval *object = NULL;
+    zval *object_writer = NULL;
+    
+    om_object_ptr om_obj = NULL;
+    om_object_ptr om_obj_writer = NULL;
+    
+    axis2_om_output_t *om_output = NULL;
+    axis2_xml_writer_t *writer = NULL;
+    axis2_env_t *env = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_output_class_entry,
+                 &object_writer, axis2_xml_writer_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+
+    env = php_axis2_get_env();    
+    intern = (axis2_object_ptr)zend_object_store_get_object(object TSRMLS_CC);
+    om_obj = (om_object_ptr)emalloc(sizeof(om_object));
+    om_obj->obj_type = OM_OUTPUT;
+    om_obj->ptr = NULL;   
+    
+    AXIS2_GET_OBJ(om_obj_writer, object_writer, om_object_ptr, intern_writer);
+    writer = (axis2_xml_writer_t *)(om_obj_writer->ptr);
+       
+    om_output = axis2_om_output_create(&env, writer);
+    om_obj->ptr = om_output;
+    
+    intern->obj_type = OM_OBJ;
+    intern->ptr = om_obj;
+}
\ No newline at end of file



Mime
View raw message