1 /*
2 	+----------------------------------------------------------------------+
3 	| Copyright (c) The PHP Group                                          |
4 	+----------------------------------------------------------------------+
5 	| This source file is subject to version 3.01 of the PHP license,      |
6 	| that is bundled with this package in the file LICENSE, and is        |
7 	| available through the world-wide-web at the following url:           |
8 	| https://www.php.net/license/3_01.txt                                 |
9 	| If you did not receive a copy of the PHP license and are unable to   |
10 	| obtain it through the world-wide-web, please send a note to          |
11 	| license@php.net so we can mail you a copy immediately.               |
12 	+----------------------------------------------------------------------+
13 	| Authors: Andi Gutmans <andi@php.net>                                 |
14 	|          Zeev Suraski <zeev@php.net>                                 |
15 	+----------------------------------------------------------------------+
16 */
17 
18 /* {{{ includes */
19 #include "php.h"
20 #include "php_main.h"
21 #include "zend_modules.h"
22 #include "zend_compile.h"
23 #include <stdarg.h>
24 #include <stdlib.h>
25 #include <stdio.h>
26 
27 #include "ext/standard/dl.h"
28 #include "ext/standard/file.h"
29 #include "ext/standard/fsock.h"
30 #include "ext/standard/head.h"
31 #include "ext/standard/pack.h"
32 #include "ext/standard/php_browscap.h"
33 #include "ext/standard/php_crypt.h"
34 #include "ext/standard/php_dir.h"
35 #include "ext/standard/php_filestat.h"
36 #include "ext/standard/php_mail.h"
37 #include "ext/standard/php_ext_syslog.h"
38 #include "ext/standard/php_standard.h"
39 #include "ext/standard/php_array.h"
40 #include "ext/standard/php_assert.h"
41 #include "ext/reflection/php_reflection.h"
42 #include "ext/random/php_random.h"
43 #if HAVE_BCMATH
44 #include "ext/bcmath/php_bcmath.h"
45 #endif
46 #if HAVE_CALENDAR
47 #include "ext/calendar/php_calendar.h"
48 #endif
49 #if HAVE_CTYPE
50 #include "ext/ctype/php_ctype.h"
51 #endif
52 #include "ext/date/php_date.h"
53 #if HAVE_FTP
54 #include "ext/ftp/php_ftp.h"
55 #endif
56 #if HAVE_ICONV
57 #include "ext/iconv/php_iconv.h"
58 #endif
59 #include "ext/standard/reg.h"
60 #include "ext/pcre/php_pcre.h"
61 #if HAVE_UODBC
62 #include "ext/odbc/php_odbc.h"
63 #endif
64 #if HAVE_PHP_SESSION
65 #include "ext/session/php_session.h"
66 #endif
67 #if HAVE_MBSTRING
68 #include "ext/mbstring/mbstring.h"
69 #endif
70 #if HAVE_TOKENIZER
71 #include "ext/tokenizer/php_tokenizer.h"
72 #endif
73 #if HAVE_ZLIB
74 #include "ext/zlib/php_zlib.h"
75 #endif
76 #if HAVE_LIBXML
77 #include "ext/libxml/php_libxml.h"
78 #if HAVE_DOM
79 #include "ext/dom/php_dom.h"
80 #endif
81 #if HAVE_SIMPLEXML
82 #include "ext/simplexml/php_simplexml.h"
83 #endif
84 #endif
85 #if HAVE_XML
86 #include "ext/xml/php_xml.h"
87 #endif
88 #include "ext/com_dotnet/php_com_dotnet.h"
89 #include "ext/spl/php_spl.h"
90 #if HAVE_XML && HAVE_XMLREADER
91 #include "ext/xmlreader/php_xmlreader.h"
92 #endif
93 #if HAVE_XML && HAVE_XMLWRITER
94 #include "ext/xmlwriter/php_xmlwriter.h"
95 #endif
96 /* }}} */
97 
98 /* {{{ php_builtin_extensions[] */
99 static zend_module_entry * const php_builtin_extensions[] = {
100 	phpext_standard_ptr
101 #if HAVE_BCMATH
102 	,phpext_bcmath_ptr
103 #endif
104 #if HAVE_CALENDAR
105 	,phpext_calendar_ptr
106 #endif
107 	,phpext_com_dotnet_ptr
108 #if HAVE_CTYPE
109 	,phpext_ctype_ptr
110 #endif
111 	,phpext_date_ptr
112 #if HAVE_FTP
113 	,phpext_ftp_ptr
114 #endif
115 	,phpext_hash_ptr
116 #if HAVE_ICONV
117 	,phpext_iconv_ptr
118 #endif
119 #if HAVE_MBSTRING
120 	,phpext_mbstring_ptr
121 #endif
122 #if HAVE_UODBC
123 	,phpext_odbc_ptr
124 #endif
125 	,phpext_pcre_ptr
126 	,phpext_reflection_ptr
127 #if HAVE_PHP_SESSION
128 	,phpext_session_ptr
129 #endif
130 #if HAVE_TOKENIZER
131 	,phpext_tokenizer_ptr
132 #endif
133 #if HAVE_ZLIB
134 	,phpext_zlib_ptr
135 #endif
136 #if HAVE_LIBXML
137 	,phpext_libxml_ptr
138 #if HAVE_DOM
139 	,phpext_dom_ptr
140 #endif
141 #if HAVE_SIMPLEXML
142 	,phpext_simplexml_ptr
143 #endif
144 #endif
145 #if HAVE_XML
146 	,phpext_xml_ptr
147 #endif
148 	,phpext_spl_ptr
149 #if HAVE_XML && HAVE_XMLREADER
150 	,phpext_xmlreader_ptr
151 #endif
152 #if HAVE_XML && HAVE_XMLWRITER
153 	,phpext_xmlwriter_ptr
154 #endif
155 };
156 /* }}} */
157 
158 #define EXTCOUNT (sizeof(php_builtin_extensions)/sizeof(zend_module_entry *))
159 
php_register_internal_extensions(void)160 PHPAPI int php_register_internal_extensions(void)
161 {
162 	return php_register_extensions(php_builtin_extensions, EXTCOUNT);
163 }
164