Skip to content

Commit 9b39c14

Browse files
committed
Merge pull request #20 from zelgerj/master
fixed #19, cleanup and minor build refactoring
2 parents dd04722 + b20f070 commit 9b39c14

7 files changed

+79
-25
lines changed

build.default.properties

+10-7
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,24 @@
1010
# ---- General Settings ---------------------------------------------------------
1111
php.ext.name = appserver
1212

13-
release.version = 0.1.9
13+
release.version = 0.1.10
1414
release.stability = beta
15-
api.version = 0.1.9
15+
api.version = 0.1.10
1616
api.stability = beta
1717

18-
php.version = 5.5.10
18+
php.version = 5.6.0beta4
19+
20+
# for stable releases
21+
php.downloadurl = http://de1.php.net/get/php-${php.version}.tar.gz/from/this/mirror
22+
# for beta releases
23+
php.downloadurl = http://downloads.php.net/tyrael/php-${php.version}.tar.gz
24+
1925
php.configure = --prefix=/opt/appserver \
2026
--enable-debug \
2127
--enable-sockets \
2228
--enable-fpm \
2329
--enable-maintainer-zts \
2430
--enable-pthreads=static \
25-
--enable-redis=static \
26-
--enable-apcu=static \
2731
--enable-appserver=static \
2832
--enable-xdebug=shared \
2933
--enable-pcntl \
@@ -39,11 +43,10 @@ php.configure = --prefix=/opt/appserver \
3943
--with-openssl \
4044
--with-zlib \
4145
42-
zmq.version = dev-master
4346
pthreads.version = 2.0.4
4447
memcached.version = 2.1.0
4548
redis.version = 2.2.3
4649
apcu.version = 4.0.2
4750
xdebug.version = 2.2.3
4851

49-
deploy.dir = ${c-build.dir}/php-${php.version}/ext
52+
deploy.dir = ${c-build.dir}/php/ext

build.xml

+6-11
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
<!-- Get PHP source package by given version number -->
120120
<!-- ==================================================================== -->
121121
<target name="get-php-src" depends="check-php-src-present" unless="${php-src.present}" description="Get PHP source package by given version number">
122-
<get src="http://de1.php.net/get/php-${php.version}.tar.gz/from/this/mirror" dest="/tmp/php-${php.version}.tar.gz"/>
122+
<get src="${php.downloadurl}" dest="/tmp/php-${php.version}.tar.gz"/>
123123
</target>
124124

125125
<!-- ==================================================================== -->
@@ -161,6 +161,8 @@
161161
<!-- Prepares the PHP sources for the runtime -->
162162
<!-- ==================================================================== -->
163163
<target name="prepare-source" depends="prepare" description="Prepares the PHP sources for the runtime.">
164+
<delete dir="${c-build.dir}/php-{php.version}" includeemptydirs="true" quiet="false" verbose="false" failonerror="false"/>
165+
164166
<!-- prepare PHP sources -->
165167
<antcall target="get-php-src"/>
166168
<untar src="/tmp/php-${php.version}.tar.gz" dest="${c-build.dir}" compression="gzip"/>
@@ -171,7 +173,7 @@
171173
</chmod>
172174

173175
<!-- recreate symlink -->
174-
<delete file="${c-build.dir}/php" followsymlinks="false" removenotfollowedsymlinks="true" />
176+
<symlink link="${c-build.dir}/php" action="delete"/>
175177
<symlink link="${c-build.dir}/php" resource="${c-build.dir}/php-${php.version}"/>
176178

177179
<antcall target="get-pthreads-src"/>
@@ -180,17 +182,11 @@
180182
<fileset dir="/tmp/pthreads-${pthreads.version}"/>
181183
</move>
182184

183-
<!-- pthreads head
185+
<!-- activate to fetch pthreads head instead of given version in properties file
184186
<exec executable="git" dir="${c-build.dir}/php/ext">
185187
<arg line="clone https://github.com/krakjoe/pthreads.git"/>
186188
</exec>
187189
-->
188-
189-
<!-- zmq head
190-
<exec executable="git" dir="${c-build.dir}/php/ext">
191-
<arg line="clone https://github.com/mkoppanen/php-zmq.git zmq"/>
192-
</exec>
193-
-->
194190

195191
<antcall target="get-memcached-src"/>
196192
<untar src="/tmp/memcached-${memcached.version}.tgz" dest="/tmp" compression="gzip"/>
@@ -245,8 +241,7 @@
245241
<!-- Inits the build source for PHP -->
246242
<!-- ==================================================================== -->
247243
<target name="init-build" description="Init the php build environment.">
248-
<delete dir="${c-build.dir}" includeemptydirs="true" quiet="false" verbose="false" failonerror="true"/>
249-
<antcall target="prepare-source"/>
244+
<antcall target="prepare-source"/>
250245
<antcall target="deploy"/>
251246
<antcall target="configure"/>
252247
<antcall target="make"/>

launch/anotherTest.launch

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<launchConfiguration type="org.eclipse.cdt.launch.applicationLaunchType">
3+
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB" value="true"/>
4+
<listAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB_LIST"/>
5+
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="gdb"/>
6+
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_ON_FORK" value="false"/>
7+
<stringAttribute key="org.eclipse.cdt.dsf.gdb.GDB_INIT" value=".gdbinit"/>
8+
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
9+
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE" value="false"/>
10+
<listAttribute key="org.eclipse.cdt.dsf.gdb.SOLIB_PATH"/>
11+
<stringAttribute key="org.eclipse.cdt.dsf.gdb.TRACEPOINT_MODE" value="TP_NORMAL_ONLY"/>
12+
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
13+
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.internal.ui.launching.LocalApplicationCDebuggerTab.DEFAULTS_SET" value="true"/>
14+
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
15+
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
16+
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="gdb"/>
17+
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/>
18+
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
19+
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
20+
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="/opt/appserver/var/www/anotherStackableStorageTest.php"/>
21+
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="build/php/sapi/cli/php"/>
22+
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="php-ext-appserver"/>
23+
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
24+
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="cdt.managedbuild.toolchain.gnu.macosx.base.1221491367"/>
25+
<booleanAttribute key="org.eclipse.cdt.launch.use_terminal" value="true"/>
26+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
27+
<listEntry value="/anotherTest"/>
28+
</listAttribute>
29+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
30+
<listEntry value="4"/>
31+
</listAttribute>
32+
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
33+
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
34+
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
35+
</listAttribute>
36+
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;&#10;"/>
37+
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
38+
<stringAttribute key="provider" value="org.eclipse.linuxtools.profiling.provider.valgrind.cachegrind"/>
39+
</launchConfiguration>

launch/appserver.launch

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/>
1818
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
1919
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
20-
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="-d date.timezone=Europe/Berlin -d zend_extension=${project_loc}/build/php/modules/xdebug.so /opt/appserver/server.php"/>
20+
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="-d date.timezone=Europe/Berlin -d appserver.remove_functions=getenv,putenv /opt/appserver/server.php"/>
2121
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="build/php/sapi/cli/php"/>
2222
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="php-ext-appserver"/>
2323
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
24-
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="cdt.managedbuild.toolchain.gnu.macosx.base.1221491367"/>
24+
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>
25+
<stringAttribute key="org.eclipse.cdt.launch.WORKING_DIRECTORY" value="/opt/appserver"/>
2526
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
2627
<listEntry value="/php-ext-appserver"/>
2728
</listAttribute>

src/appserver.c

+16
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,27 @@ PHP_FUNCTION(appserver_set_raw_post_data)
306306
return;
307307
}
308308

309+
/* removed raw_post_data in php-5.6.x */
310+
#if ZEND_MODULE_API_NO >= 20131226
311+
/* create stream if not exists yes */
312+
if (!SG(request_info).request_body) {
313+
SG(request_info).request_body = php_stream_temp_create(TEMP_STREAM_DEFAULT, SAPI_POST_BLOCK_SIZE);
314+
}
315+
/* write given post data to stream */
316+
php_stream_write(SG(request_info).request_body, postData, postData_len);
317+
/* rewind it for further processing */
318+
php_stream_rewind(SG(request_info).request_body);
319+
/* make old var $HTTP_RAW_POST_DATA available */
320+
SET_VAR_STRINGL("HTTP_RAW_POST_DATA", estrndup(postData, postData_len), postData_len);
321+
322+
#else
309323
/* set to $HTTP_RAW_POST_DATA var */
310324
SET_VAR_STRINGL("HTTP_RAW_POST_DATA", estrndup(postData, postData_len), postData_len);
311325
/* set to php://input */
312326
SG(request_info).raw_post_data = estrndup(postData, postData_len);
313327
SG(request_info).raw_post_data_length = postData_len;
328+
#endif
329+
314330
}
315331

316332
/* {{{ proto boolean appserver_redefine(string $constant [, mixed $value])

src/tests/appserver_005.phpt

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Johann Zelger <jz [at] techdivision [dot] com>
55
--FILE--
66
<?php
77

8-
header('Content-type: text/html');
8+
header('Content-type: text/html;charset=UTF-8');
99
header('X-POWERED-BY: appserver.io');
1010
var_dump(appserver_get_headers(false));
1111
var_dump(appserver_get_headers(false));
@@ -14,13 +14,13 @@ var_dump(appserver_get_headers(false));
1414
--EXPECT--
1515
array(2) {
1616
[0]=>
17-
string(23) "Content-type: text/html"
17+
string(37) "Content-type: text/html;charset=UTF-8"
1818
[1]=>
1919
string(26) "X-POWERED-BY: appserver.io"
2020
}
2121
array(2) {
2222
[0]=>
23-
string(23) "Content-type: text/html"
23+
string(37) "Content-type: text/html;charset=UTF-8"
2424
[1]=>
2525
string(26) "X-POWERED-BY: appserver.io"
2626
}

src/tests/appserver_006.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Johann Zelger <jz [at] techdivision [dot] com>
55
--FILE--
66
<?php
77

8-
header('Content-type: text/html');
8+
header('Content-type: text/html;charset=UTF-8');
99
header('X-POWERED-BY: appserver.io');
1010
var_dump(appserver_get_headers(true));
1111
var_dump(appserver_get_headers());
@@ -14,7 +14,7 @@ var_dump(appserver_get_headers());
1414
--EXPECT--
1515
array(2) {
1616
[0]=>
17-
string(23) "Content-type: text/html"
17+
string(37) "Content-type: text/html;charset=UTF-8"
1818
[1]=>
1919
string(26) "X-POWERED-BY: appserver.io"
2020
}

0 commit comments

Comments
 (0)