Skip to content

Commit 94925b1

Browse files
author
Sterling Hughes
committedMay 18, 2003
add very basic code for the simplexml extension. The following works ::
person.xml -- <person> <name> <first>Sterling</first> <last>Hughes</last> </name> </person> person.php -- <?php $p = simplexml_load_file('person.xml'); echo $p->name->last . ', ' . $p->name->first; ?> Still needs lots of work.
1 parent 185a4ba commit 94925b1

File tree

6 files changed

+482
-0
lines changed

6 files changed

+482
-0
lines changed
 

‎ext/simplexml/CREDITS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
simplexml

‎ext/simplexml/EXPERIMENTAL

Whitespace-only changes.

‎ext/simplexml/config.m4

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
dnl $Id$
2+
dnl config.m4 for extension simplexml
3+
4+
PHP_ARG_WITH(simplexml, for simplexml support,
5+
[ --with-simplexml Include simplexml support])
6+
7+
if test "$PHP_SIMPLEXML" != "no"; then
8+
PHP_NEW_EXTENSION(simplexml, simplexml.c, $ext_shared)
9+
fi

‎ext/simplexml/php_simplexml.h

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
+----------------------------------------------------------------------+
3+
| PHP Version 4 |
4+
+----------------------------------------------------------------------+
5+
| Copyright (c) 1997-2003 The PHP Group |
6+
+----------------------------------------------------------------------+
7+
| This source file is subject to version 2.02 of the PHP license, |
8+
| that is bundled with this package in the file LICENSE, and is |
9+
| available at through the world-wide-web at |
10+
| http://www.php.net/license/2_02.txt. |
11+
| If you did not receive a copy of the PHP license and are unable to |
12+
| obtain it through the world-wide-web, please send a note to |
13+
| license@php.net so we can mail you a copy immediately. |
14+
+----------------------------------------------------------------------+
15+
| Author: Sterling Hughes <sterling@php.net> |
16+
+----------------------------------------------------------------------+
17+
*/
18+
19+
/* $Id$ */
20+
21+
#ifndef PHP_SIMPLEXML_H
22+
#define PHP_SIMPLEXML_H
23+
24+
extern zend_module_entry simplexml_module_entry;
25+
#define phpext_simplexml_ptr &simplexml_module_entry
26+
27+
#ifdef PHP_WIN32
28+
#define PHP_SIMPLEXML_API __declspec(dllexport)
29+
#else
30+
#define PHP_SIMPLEXML_API
31+
#endif
32+
33+
#ifdef ZTS
34+
#include "TSRM.h"
35+
#endif
36+
37+
#include <libxml/parser.h>
38+
#include <libxml/parserInternals.h>
39+
#include <libxml/tree.h>
40+
#include <libxml/uri.h>
41+
#include <libxml/xmlerror.h>
42+
#include <libxml/xinclude.h>
43+
#include <libxml/xpath.h>
44+
#include <libxml/xpathInternals.h>
45+
#include <libxml/xpointer.h>
46+
47+
PHP_MINIT_FUNCTION(simplexml);
48+
PHP_MSHUTDOWN_FUNCTION(simplexml);
49+
PHP_RINIT_FUNCTION(simplexml);
50+
PHP_RSHUTDOWN_FUNCTION(simplexml);
51+
PHP_MINFO_FUNCTION(simplexml);
52+
53+
typedef struct {
54+
zend_object zo;
55+
xmlDocPtr document;
56+
xmlNodePtr node;
57+
} php_sxe_object;
58+
59+
60+
#ifdef ZTS
61+
#define SIMPLEXML_G(v) TSRMG(simplexml_globals_id, zend_simplexml_globals *, v)
62+
#else
63+
#define SIMPLEXML_G(v) (simplexml_globals.v)
64+
#endif
65+
66+
#endif
67+
68+
69+
/*
70+
* Local variables:
71+
* tab-width: 4
72+
* c-basic-offset: 4
73+
* indent-tabs-mode: t
74+
* End:
75+
* vim600: fdm=marker
76+
* vim: noet sw=4 ts=4
77+
*/

0 commit comments

Comments
 (0)
Failed to load comments.