Skip to content
Browse files

New PHP support.

  • Loading branch information...
1 parent c83c951 commit 4f736a940b9b871154067d30d89c22bca0de8a27 @lstoll committed Oct 4, 2011
Showing with 0 additions and 62,919 deletions.
  1. +0 −3 Gemfile
  2. +0 −10 Gemfile.lock
  3. +0 −1 Procfile
  4. +0 −1 README.md
  5. +0 −9 Vagrantfile
  6. 0 {public → }/index.php
  7. +0 −8 provision.sh
  8. +0 −28 sw/linux/bin/pear
  9. +0 −28 sw/linux/bin/peardev
  10. +0 −28 sw/linux/bin/pecl
  11. +0 −1 sw/linux/bin/phar
  12. BIN sw/linux/bin/phar.phar
  13. BIN sw/linux/bin/php
  14. BIN sw/linux/bin/php-cgi
  15. +0 −90 sw/linux/bin/php-config
  16. +0 −209 sw/linux/bin/phpize
  17. +0 −2 sw/linux/etc/pear.conf
  18. +0 −186 sw/linux/include/php/TSRM/TSRM.h
  19. +0 −45 sw/linux/include/php/TSRM/readdir.h
  20. +0 −1 sw/linux/include/php/TSRM/tsrm_config.h
  21. +0 −22 sw/linux/include/php/TSRM/tsrm_config.w32.h
  22. +0 −70 sw/linux/include/php/TSRM/tsrm_config_common.h
  23. +0 −29 sw/linux/include/php/TSRM/tsrm_nw.h
  24. +0 −6 sw/linux/include/php/TSRM/tsrm_strtok_r.h
  25. +0 −338 sw/linux/include/php/TSRM/tsrm_virtual_cwd.h
  26. +0 −110 sw/linux/include/php/TSRM/tsrm_win32.h
  27. +0 −860 sw/linux/include/php/Zend/zend.h
  28. +0 −742 sw/linux/include/php/Zend/zend_API.h
  29. +0 −250 sw/linux/include/php/Zend/zend_alloc.h
  30. +0 −46 sw/linux/include/php/Zend/zend_build.h
  31. +0 −39 sw/linux/include/php/Zend/zend_builtin_functions.h
  32. +0 −48 sw/linux/include/php/Zend/zend_closures.h
  33. +0 −868 sw/linux/include/php/Zend/zend_compile.h
  34. +0 −4 sw/linux/include/php/Zend/zend_config.h
  35. +0 −89 sw/linux/include/php/Zend/zend_config.nw.h
  36. +0 −100 sw/linux/include/php/Zend/zend_config.w32.h
  37. +0 −85 sw/linux/include/php/Zend/zend_constants.h
  38. +0 −48 sw/linux/include/php/Zend/zend_dtrace.h
  39. +0 −47 sw/linux/include/php/Zend/zend_dynamic_array.h
  40. +0 −52 sw/linux/include/php/Zend/zend_errors.h
  41. +0 −68 sw/linux/include/php/Zend/zend_exceptions.h
  42. +0 −461 sw/linux/include/php/Zend/zend_execute.h
  43. +0 −133 sw/linux/include/php/Zend/zend_extensions.h
  44. +0 −424 sw/linux/include/php/Zend/zend_float.h
  45. +0 −245 sw/linux/include/php/Zend/zend_gc.h
  46. +0 −323 sw/linux/include/php/Zend/zend_globals.h
  47. +0 −108 sw/linux/include/php/Zend/zend_globals_macros.h
  48. +0 −392 sw/linux/include/php/Zend/zend_hash.h
  49. +0 −60 sw/linux/include/php/Zend/zend_highlight.h
  50. +0 −37 sw/linux/include/php/Zend/zend_indent.h
  51. +0 −219 sw/linux/include/php/Zend/zend_ini.h
  52. +0 −86 sw/linux/include/php/Zend/zend_ini_parser.h
  53. +0 −46 sw/linux/include/php/Zend/zend_ini_scanner.h
  54. +0 −13 sw/linux/include/php/Zend/zend_ini_scanner_defs.h
  55. +0 −80 sw/linux/include/php/Zend/zend_interfaces.h
  56. +0 −44 sw/linux/include/php/Zend/zend_istdiostream.h
  57. +0 −93 sw/linux/include/php/Zend/zend_iterators.h
  58. +0 −314 sw/linux/include/php/Zend/zend_language_parser.h
  59. +0 −72 sw/linux/include/php/Zend/zend_language_scanner.h
  60. +0 −15 sw/linux/include/php/Zend/zend_language_scanner_defs.h
  61. +0 −126 sw/linux/include/php/Zend/zend_list.h
  62. +0 −86 sw/linux/include/php/Zend/zend_llist.h
  63. +0 −141 sw/linux/include/php/Zend/zend_modules.h
  64. +0 −89 sw/linux/include/php/Zend/zend_multibyte.h
  65. +0 −72 sw/linux/include/php/Zend/zend_multiply.h
  66. +0 −179 sw/linux/include/php/Zend/zend_object_handlers.h
  67. +0 −46 sw/linux/include/php/Zend/zend_objects.h
  68. +0 −99 sw/linux/include/php/Zend/zend_objects_API.h
  69. +0 −882 sw/linux/include/php/Zend/zend_operators.h
  70. +0 −122 sw/linux/include/php/Zend/zend_ptr_stack.h
  71. +0 −36 sw/linux/include/php/Zend/zend_qsort.h
  72. +0 −104 sw/linux/include/php/Zend/zend_signal.h
  73. +0 −58 sw/linux/include/php/Zend/zend_stack.h
  74. +0 −55 sw/linux/include/php/Zend/zend_static_allocator.h
  75. +0 −81 sw/linux/include/php/Zend/zend_stream.h
  76. +0 −71 sw/linux/include/php/Zend/zend_string.h
  77. +0 −38 sw/linux/include/php/Zend/zend_strtod.h
  78. +0 −135 sw/linux/include/php/Zend/zend_ts_hash.h
  79. +0 −69 sw/linux/include/php/Zend/zend_types.h
  80. +0 −96 sw/linux/include/php/Zend/zend_variables.h
  81. +0 −29 sw/linux/include/php/Zend/zend_vm.h
  82. +0 −5,087 sw/linux/include/php/Zend/zend_vm_def.h
  83. +0 −39,799 sw/linux/include/php/Zend/zend_vm_execute.h
  84. +0 −159 sw/linux/include/php/Zend/zend_vm_opcodes.h
  85. +0 −134 sw/linux/include/php/ext/date/lib/timelib.h
  86. +0 −5 sw/linux/include/php/ext/date/lib/timelib_config.h
  87. +0 −223 sw/linux/include/php/ext/date/lib/timelib_structs.h
  88. +0 −186 sw/linux/include/php/ext/date/php_date.h
  89. +0 −106 sw/linux/include/php/ext/dom/xml_common.h
  90. +0 −64 sw/linux/include/php/ext/ereg/php_ereg.h
  91. +0 −65 sw/linux/include/php/ext/ereg/php_regex.h
  92. +0 −30 sw/linux/include/php/ext/ereg/regex/cclass.h
  93. +0 −102 sw/linux/include/php/ext/ereg/regex/cname.h
  94. +0 −85 sw/linux/include/php/ext/ereg/regex/regex.h
  95. +0 −140 sw/linux/include/php/ext/ereg/regex/regex2.h
  96. +0 −23 sw/linux/include/php/ext/ereg/regex/utils.h
  97. +0 −103 sw/linux/include/php/ext/filter/php_filter.h
  98. +0 −158 sw/linux/include/php/ext/hash/php_hash.h
  99. +0 −44 sw/linux/include/php/ext/hash/php_hash_adler32.h
  100. +0 −45 sw/linux/include/php/ext/hash/php_hash_crc32.h
  101. +0 −79 sw/linux/include/php/ext/hash/php_hash_fnv.h
  102. +0 −47 sw/linux/include/php/ext/hash/php_hash_gost.h
  103. +0 −59 sw/linux/include/php/ext/hash/php_hash_haval.h
  104. +0 −43 sw/linux/include/php/ext/hash/php_hash_joaat.h
  105. +0 −100 sw/linux/include/php/ext/hash/php_hash_md.h
  106. +0 −66 sw/linux/include/php/ext/hash/php_hash_ripemd.h
  107. +0 −51 sw/linux/include/php/ext/hash/php_hash_salsa.h
  108. +0 −97 sw/linux/include/php/ext/hash/php_hash_sha.h
  109. +0 −51 sw/linux/include/php/ext/hash/php_hash_snefru.h
  110. +0 −49 sw/linux/include/php/ext/hash/php_hash_tiger.h
  111. +0 −71 sw/linux/include/php/ext/hash/php_hash_types.h
  112. +0 −48 sw/linux/include/php/ext/hash/php_hash_whirlpool.h
  113. +0 −1 sw/linux/include/php/ext/iconv/php_have_bsd_iconv.h
  114. +0 −1 sw/linux/include/php/ext/iconv/php_have_glibc_iconv.h
  115. +0 −1 sw/linux/include/php/ext/iconv/php_have_ibm_iconv.h
  116. +0 −1 sw/linux/include/php/ext/iconv/php_have_iconv.h
  117. +0 −1 sw/linux/include/php/ext/iconv/php_have_libiconv.h
  118. +0 −130 sw/linux/include/php/ext/iconv/php_iconv.h
  119. +0 −1 sw/linux/include/php/ext/iconv/php_iconv_aliased_libiconv.h
  120. +0 −1 sw/linux/include/php/ext/iconv/php_iconv_supports_errno.h
  121. +0 −1 sw/linux/include/php/ext/iconv/php_php_iconv_h_path.h
  122. +0 −1 sw/linux/include/php/ext/iconv/php_php_iconv_impl.h
  123. +0 −90 sw/linux/include/php/ext/json/php_json.h
  124. +0 −124 sw/linux/include/php/ext/libxml/php_libxml.h
  125. +0 −361 sw/linux/include/php/ext/pcre/pcrelib/config.h
  126. +0 −318 sw/linux/include/php/ext/pcre/pcrelib/pcre.h
  127. +0 −1,869 sw/linux/include/php/ext/pcre/pcrelib/pcre_internal.h
  128. +0 −146 sw/linux/include/php/ext/pcre/pcrelib/pcreposix.h
  129. +0 −161 sw/linux/include/php/ext/pcre/pcrelib/ucp.h
  130. +0 −90 sw/linux/include/php/ext/pcre/php_pcre.h
  131. +0 −94 sw/linux/include/php/ext/pdo/php_pdo.h
  132. +0 −673 sw/linux/include/php/ext/pdo/php_pdo_driver.h
  133. +0 −29 sw/linux/include/php/ext/session/mod_files.h
  134. +0 −29 sw/linux/include/php/ext/session/mod_user.h
  135. +0 −271 sw/linux/include/php/ext/session/php_session.h
  136. +0 −103 sw/linux/include/php/ext/spl/php_spl.h
  137. +0 −46 sw/linux/include/php/ext/spl/spl_array.h
  138. +0 −149 sw/linux/include/php/ext/spl/spl_directory.h
  139. +0 −42 sw/linux/include/php/ext/spl/spl_dllist.h
  140. +0 −61 sw/linux/include/php/ext/spl/spl_engine.h
  141. +0 −53 sw/linux/include/php/ext/spl/spl_exceptions.h
  142. +0 −38 sw/linux/include/php/ext/spl/spl_fixedarray.h
  143. +0 −91 sw/linux/include/php/ext/spl/spl_functions.h
  144. +0 −44 sw/linux/include/php/ext/spl/spl_heap.h
  145. +0 −186 sw/linux/include/php/ext/spl/spl_iterators.h
  146. +0 −43 sw/linux/include/php/ext/spl/spl_observer.h
Sorry, we could not display the entire diff because too many files (430) changed.
View
3 Gemfile
@@ -1,3 +0,0 @@
-source :rubyforge
-
-gem 'rake', '0.9.2'
View
10 Gemfile.lock
@@ -1,10 +0,0 @@
-GEM
- remote: http://rubygems.org/
- specs:
- rake (0.9.2)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- rake (= 0.9.2)
View
1 Procfile
@@ -1 +0,0 @@
-web: cd public ; ../sw/linux/bin/php -S 0.0.0.0:$PORT
View
1 README.md
@@ -1 +0,0 @@
-# PHP on Heroku
View
9 Vagrantfile
@@ -1,9 +0,0 @@
-Vagrant::Config.run do |config|
- config.vm.box = "lucid64"
- config.vm.box_url = "http://files.vagrantup.com/lucid64.box"
- # Foreman default.
- config.vm.forward_port("http", 5000, 5000)
- # name / dest / src
- config.vm.share_folder("app", "/app", ".")
- config.vm.provision :shell, :path => "provision.sh"
-end
View
0 public/index.php → index.php
File renamed without changes.
View
8 provision.sh
@@ -1,8 +0,0 @@
-#!/bin/bash
-sudo apt-get -y install build-essential libxml2-dev libpq-dev
-wget http://snaps.php.net/php5.4-latest.tar.bz2
-tar -jxvf php5.4-latest.tar.bz2
-cd php5.4*
-./configure --with-pgsql --prefix=/app/sw/linux
-make
-make install
View
28 sw/linux/bin/pear
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-# first find which PHP binary to use
-if test "x$PHP_PEAR_PHP_BIN" != "x"; then
- PHP="$PHP_PEAR_PHP_BIN"
-else
- if test "/app/sw/linux/bin/php" = '@'php_bin'@'; then
- PHP=php
- else
- PHP="/app/sw/linux/bin/php"
- fi
-fi
-
-# then look for the right pear include dir
-if test "x$PHP_PEAR_INSTALL_DIR" != "x"; then
- INCDIR=$PHP_PEAR_INSTALL_DIR
- INCARG="-d include_path=$PHP_PEAR_INSTALL_DIR"
-else
- if test "/app/sw/linux/lib/php" = '@'php_dir'@'; then
- INCDIR=`dirname $0`
- INCARG=""
- else
- INCDIR="/app/sw/linux/lib/php"
- INCARG="-d include_path=/app/sw/linux/lib/php"
- fi
-fi
-
-exec $PHP -C -q $INCARG -d date.timezone=UTC -d output_buffering=1 -d variables_order=EGPCS -d open_basedir="" -d safe_mode=0 -d register_argc_argv="On" -d auto_prepend_file="" -d auto_append_file="" $INCDIR/pearcmd.php "$@"
View
28 sw/linux/bin/peardev
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-# first find which PHP binary to use
-if test "x$PHP_PEAR_PHP_BIN" != "x"; then
- PHP="$PHP_PEAR_PHP_BIN"
-else
- if test "/app/sw/linux/bin/php" = '@'php_bin'@'; then
- PHP=php
- else
- PHP="/app/sw/linux/bin/php"
- fi
-fi
-
-# then look for the right pear include dir
-if test "x$PHP_PEAR_INSTALL_DIR" != "x"; then
- INCDIR=$PHP_PEAR_INSTALL_DIR
- INCARG="-d include_path=$PHP_PEAR_INSTALL_DIR"
-else
- if test "/app/sw/linux/lib/php" = '@'php_dir'@'; then
- INCDIR=`dirname $0`
- INCARG=""
- else
- INCDIR="/app/sw/linux/lib/php"
- INCARG="-d include_path=/app/sw/linux/lib/php"
- fi
-fi
-
-exec $PHP -d date.timezone=UTC -d memory_limit="-1" -C -q $INCARG -d output_buffering=1 -d open_basedir="" -d safe_mode=0 -d register_argc_argv="On" -d auto_prepend_file="" -d variables_order=EGPCS -d auto_append_file="" $INCDIR/pearcmd.php "$@"
View
28 sw/linux/bin/pecl
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-# first find which PHP binary to use
-if test "x$PHP_PEAR_PHP_BIN" != "x"; then
- PHP="$PHP_PEAR_PHP_BIN"
-else
- if test "/app/sw/linux/bin/php" = '@'php_bin'@'; then
- PHP=php
- else
- PHP="/app/sw/linux/bin/php"
- fi
-fi
-
-# then look for the right pear include dir
-if test "x$PHP_PEAR_INSTALL_DIR" != "x"; then
- INCDIR=$PHP_PEAR_INSTALL_DIR
- INCARG="-d include_path=$PHP_PEAR_INSTALL_DIR"
-else
- if test "/app/sw/linux/lib/php" = '@'php_dir'@'; then
- INCDIR=`dirname $0`
- INCARG=""
- else
- INCDIR="/app/sw/linux/lib/php"
- INCARG="-d include_path=/app/sw/linux/lib/php"
- fi
-fi
-
-exec $PHP -C -n -q $INCARG -d date.timezone=UTC -d output_buffering=1 -d variables_order=EGPCS -d safe_mode=0 -d register_argc_argv="On" $INCDIR/peclcmd.php "$@"
View
1 sw/linux/bin/phar
View
BIN sw/linux/bin/phar.phar
Binary file not shown.
View
BIN sw/linux/bin/php
Binary file not shown.
View
BIN sw/linux/bin/php-cgi
Binary file not shown.
View
90 sw/linux/bin/php-config
@@ -1,90 +0,0 @@
-#! /bin/sh
-
-SED="/bin/sed"
-prefix="/app/sw/linux"
-datarootdir="/app/sw/linux/php"
-exec_prefix="${prefix}"
-version="5.4.0beta1-dev"
-vernum="50400"
-include_dir="${prefix}/include/php"
-includes="-I$include_dir -I$include_dir/main -I$include_dir/TSRM -I$include_dir/Zend -I$include_dir/ext -I$include_dir/ext/date/lib"
-ldflags=""
-libs="-lcrypt -lcrypt -lpq -lrt -lrt -lm -ldl -lnsl -lxml2 -lxml2 -lxml2 -lcrypt -lxml2 -lxml2 -lxml2 -lcrypt "
-extension_dir='/app/sw/linux/lib/php/extensions/no-debug-non-zts-20100525'
-man_dir=`eval echo ${datarootdir}/man`
-program_prefix=""
-program_suffix=""
-exe_extension=""
-php_cli_binary=NONE
-php_cgi_binary=NONE
-configure_options=" '--with-pgsql' '--prefix=/app/sw/linux'"
-php_sapis=" cli cgi"
-
-# Set php_cli_binary and php_cgi_binary if available
-for sapi in $php_sapis; do
- case $sapi in
- cli)
- php_cli_binary="${exec_prefix}/bin/${program_prefix}php${program_suffix}${exe_extension}"
- ;;
- cgi)
- php_cgi_binary="${exec_prefix}/bin/${program_prefix}php-cgi${program_suffix}${exe_extension}"
- ;;
- esac
-done
-
-# Determine which (if any) php binary is available
-if test "$php_cli_binary" != "NONE"; then
- php_binary="$php_cli_binary"
-else
- php_binary="$php_cgi_binary"
-fi
-
-# Remove quotes
-configure_options=`echo $configure_options | $SED -e "s#'##g"`
-
-case "$1" in
---prefix)
- echo $prefix;;
---includes)
- echo $includes;;
---ldflags)
- echo $ldflags;;
---libs)
- echo $libs;;
---extension-dir)
- echo $extension_dir;;
---include-dir)
- echo $include_dir;;
---php-binary)
- echo $php_binary;;
---php-sapis)
- echo $php_sapis;;
---configure-options)
- echo $configure_options;;
---man-dir)
- echo $man_dir;;
---version)
- echo $version;;
---vernum)
- echo $vernum;;
-*)
- cat << EOF
-Usage: $0 [OPTION]
-Options:
- --prefix [$prefix]
- --includes [$includes]
- --ldflags [$ldflags]
- --libs [$libs]
- --extension-dir [$extension_dir]
- --include-dir [$include_dir]
- --man-dir [$man_dir]
- --php-binary [$php_binary]
- --php-sapis [$php_sapis]
- --configure-options [$configure_options]
- --version [$version]
- --vernum [$vernum]
-EOF
- exit 1;;
-esac
-
-exit 0
View
209 sw/linux/bin/phpize
@@ -1,209 +0,0 @@
-#!/bin/sh
-
-# Variable declaration
-prefix='/app/sw/linux'
-datarootdir='/app/sw/linux/php'
-exec_prefix="`eval echo ${prefix}`"
-phpdir="`eval echo ${exec_prefix}/lib/php`/build"
-includedir="`eval echo ${prefix}/include`/php"
-builddir="`pwd`"
-SED="/bin/sed"
-
-FILES_BUILD="mkdep.awk scan_makefile_in.awk shtool libtool.m4"
-FILES="acinclude.m4 Makefile.global config.sub config.guess ltmain.sh run-tests*.php"
-CLEAN_FILES="$FILES *.o *.lo *.la .deps .libs/ build/ include/ modules/ install-sh \
- mkinstalldirs missing config.nice config.sub config.guess configure configure.in \
- aclocal.m4 config.h config.h.in conftest* ltmain.sh libtool config.cache autom4te.cache/ \
- config.log config.status Makefile Makefile.fragments Makefile.objects confdefs.h \
- run-tests*.php tests/*.diff tests/*.exp tests/*.log tests/*.out tests/*.php"
-
-# function declaration
-phpize_usage()
-{
- echo "Usage: $0 [--clean|--help|--version|-v]"
-}
-
-phpize_no_configm4()
-{
- if test $@ -eq 1; then
- clean=" --clean"
- fi
-
- echo "Cannot find config.m4. "
- echo "Make sure that you run '$0$clean' in the top level source directory of the module"
- echo
-}
-
-phpize_clean()
-{
- echo "Cleaning.."
- for i in $CLEAN_FILES; do
- if test -f "$i"; then
- rm -f $i
- elif test -d "$i"; then
- rm -rf $i
- fi
- done
-}
-
-phpize_check_configm4()
-{
- if test ! -r config.m4; then
- phpize_no_configm4 $@
- exit 1
- fi
-
-}
-
-phpize_get_api_numbers()
-{
- # extracting API NOs:
- PHP_API_VERSION=`grep '#define PHP_API_VERSION' $includedir/main/php.h|$SED 's/#define PHP_API_VERSION//'`
- ZEND_MODULE_API_NO=`grep '#define ZEND_MODULE_API_NO' $includedir/Zend/zend_modules.h|$SED 's/#define ZEND_MODULE_API_NO//'`
- ZEND_EXTENSION_API_NO=`grep '#define ZEND_EXTENSION_API_NO' $includedir/Zend/zend_extensions.h|$SED 's/#define ZEND_EXTENSION_API_NO//'`
-}
-
-phpize_print_api_numbers()
-{
- phpize_get_api_numbers
- echo "Configuring for:"
- echo "PHP Api Version: "$PHP_API_VERSION
- echo "Zend Module Api No: "$ZEND_MODULE_API_NO
- echo "Zend Extension Api No: "$ZEND_EXTENSION_API_NO
-}
-
-phpize_check_build_files()
-{
- if test ! -d "$phpdir"; then
- cat <<EOF
-Cannot find build files at '$phpdir'. Please check your PHP installation.
-
-EOF
- exit 1
- fi
-
- case "$phpdir" in
- *\ * | *\ *)
- cat <<EOF
-Invalid source path '$phpdir'. Whitespace is not allowed in source path.
-
-EOF
- exit 1;;
- esac
-
- case "$builddir" in
- *\ * | *\ *)
- cat <<EOF
-Invalid build path '$builddir'. Whitespace is not allowed in build path.
-
-EOF
- exit 1;;
- esac
-}
-
-phpize_check_shtool()
-{
- test -x "$builddir/build/shtool" || chmod +x "$builddir/build/shtool"
-
- if test ! -x "$builddir/build/shtool"; then
- cat <<EOF
-shtool at '$builddir/build/shtool' does not exist or is not executable.
-Make sure that the file exists and is executable and then rerun this script.
-
-EOF
- exit 1
- else
- php_shtool=$builddir/build/shtool
- fi
-}
-
-phpize_check_autotools()
-{
- test -z "$PHP_AUTOCONF" && PHP_AUTOCONF=autoconf
- test -z "$PHP_AUTOHEADER" && PHP_AUTOHEADER=autoheader
-
- if test ! -x "$PHP_AUTOCONF" && test ! -x "`$php_shtool path $PHP_AUTOCONF`"; then
- cat <<EOF
-Cannot find autoconf. Please check your autoconf installation and the
-\$PHP_AUTOCONF environment variable. Then, rerun this script.
-
-EOF
- exit 1
- fi
- if test ! -x "$PHP_AUTOHEADER" && test ! -x "`$php_shtool path $PHP_AUTOHEADER`"; then
- cat <<EOF
-Cannot find autoheader. Please check your autoconf installation and the
-\$PHP_AUTOHEADER environment variable. Then, rerun this script.
-
-EOF
- exit 1
- fi
-}
-
-phpize_copy_files()
-{
- test -d build || mkdir build
-
- (cd "$phpdir" && cp $FILES_BUILD "$builddir"/build)
- (cd "$phpdir" && cp $FILES "$builddir")
- (cd "$builddir" && cat acinclude.m4 ./build/libtool.m4 > aclocal.m4)
-}
-
-phpize_replace_prefix()
-{
- $SED \
- -e "s#/app/sw/linux#$prefix#" \
- < "$phpdir/phpize.m4" > configure.in
-}
-
-phpize_autotools()
-{
- $PHP_AUTOCONF || exit 1
- $PHP_AUTOHEADER || exit 1
-}
-
-# Main script
-
-case "$1" in
- # Cleanup
- --clean)
- phpize_check_configm4 1
- phpize_clean
- exit 0
- ;;
-
- # Usage
- --help)
- phpize_usage
- exit 0
- ;;
-
- # Version
- --version|-v)
- phpize_print_api_numbers
- exit 0
- ;;
-
- # Default
- *)
- phpize_check_configm4 0
-
- phpize_check_build_files
-
- phpize_print_api_numbers
-
- phpize_copy_files
-
- phpize_replace_prefix
-
- touch install-sh mkinstalldirs missing
-
- phpize_check_shtool
-
- phpize_check_autotools
-
- phpize_autotools
- ;;
-esac
-
-exit 0
View
2 sw/linux/etc/pear.conf
@@ -1,2 +0,0 @@
-#PEAR_Config 0.9
-a:31:{s:9:"cache_dir";s:15:"/tmp/pear/cache";s:15:"default_channel";s:12:"pear.php.net";s:16:"preferred_mirror";s:12:"pear.php.net";s:13:"remote_config";s:0:"";s:13:"auto_discover";i:0;s:13:"master_server";s:12:"pear.php.net";s:10:"http_proxy";s:0:"";s:7:"php_dir";s:21:"/app/sw/linux/lib/php";s:7:"ext_dir";s:58:"/app/sw/linux/lib/php/extensions/no-debug-non-zts-20100525";s:7:"doc_dir";s:25:"/app/sw/linux/lib/php/doc";s:7:"bin_dir";s:17:"/app/sw/linux/bin";s:8:"data_dir";s:26:"/app/sw/linux/lib/php/data";s:7:"cfg_dir";s:25:"/app/sw/linux/lib/php/cfg";s:7:"www_dir";s:28:"/app/sw/linux/lib/php/htdocs";s:8:"test_dir";s:26:"/app/sw/linux/lib/php/test";s:8:"temp_dir";s:14:"/tmp/pear/temp";s:12:"download_dir";s:18:"/tmp/pear/download";s:7:"php_bin";s:21:"/app/sw/linux/bin/php";s:10:"php_prefix";s:0:"";s:10:"php_suffix";s:0:"";s:7:"php_ini";s:0:"";s:8:"username";s:0:"";s:8:"password";s:0:"";s:7:"verbose";i:1;s:15:"preferred_state";s:6:"stable";s:5:"umask";i:18;s:9:"cache_ttl";i:3600;s:8:"sig_type";s:3:"gpg";s:7:"sig_bin";s:12:"/usr/bin/gpg";s:9:"sig_keyid";s:0:"";s:10:"sig_keydir";s:26:"/app/sw/linux/etc/pearkeys";}
View
186 sw/linux/include/php/TSRM/TSRM.h
@@ -1,186 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | Thread Safe Resource Manager |
- +----------------------------------------------------------------------+
- | Copyright (c) 1999-2011, Andi Gutmans, Sascha Schumann, Zeev Suraski |
- | This source file is subject to the TSRM license, that is bundled |
- | with this package in the file LICENSE |
- +----------------------------------------------------------------------+
- | Authors: Zeev Suraski <zeev@zend.com> |
- +----------------------------------------------------------------------+
-*/
-
-#ifndef TSRM_H
-#define TSRM_H
-
-#if !defined(__CYGWIN__) && defined(WIN32)
-# define TSRM_WIN32
-# include "tsrm_config.w32.h"
-#else
-# include <tsrm_config.h>
-#endif
-
-#ifdef TSRM_WIN32
-# ifdef TSRM_EXPORTS
-# define TSRM_API __declspec(dllexport)
-# else
-# define TSRM_API __declspec(dllimport)
-# endif
-#elif defined(__GNUC__) && __GNUC__ >= 4
-# define TSRM_API __attribute__ ((visibility("default")))
-#else
-# define TSRM_API
-#endif
-
-#ifdef _WIN64
-typedef __int64 tsrm_intptr_t;
-typedef unsigned __int64 tsrm_uintptr_t;
-#else
-typedef long tsrm_intptr_t;
-typedef unsigned long tsrm_uintptr_t;
-#endif
-
-/* Only compile multi-threading functions if we're in ZTS mode */
-#ifdef ZTS
-
-#ifdef TSRM_WIN32
-# ifndef TSRM_INCLUDE_FULL_WINDOWS_HEADERS
-# define WIN32_LEAN_AND_MEAN
-# endif
-# include <windows.h>
-# include <shellapi.h>
-#elif defined(GNUPTH)
-# include <pth.h>
-#elif defined(PTHREADS)
-# include <pthread.h>
-#elif defined(TSRM_ST)
-# include <st.h>
-#elif defined(BETHREADS)
-#include <kernel/OS.h>
-#include <TLS.h>
-#endif
-
-typedef int ts_rsrc_id;
-
-/* Define THREAD_T and MUTEX_T */
-#ifdef TSRM_WIN32
-# define THREAD_T DWORD
-# define MUTEX_T CRITICAL_SECTION *
-#elif defined(GNUPTH)
-# define THREAD_T pth_t
-# define MUTEX_T pth_mutex_t *
-#elif defined(PTHREADS)
-# define THREAD_T pthread_t
-# define MUTEX_T pthread_mutex_t *
-#elif defined(NSAPI)
-# define THREAD_T SYS_THREAD
-# define MUTEX_T CRITICAL
-#elif defined(PI3WEB)
-# define THREAD_T PIThread *
-# define MUTEX_T PISync *
-#elif defined(TSRM_ST)
-# define THREAD_T st_thread_t
-# define MUTEX_T st_mutex_t
-#elif defined(BETHREADS)
-# define THREAD_T thread_id
-typedef struct {
- sem_id sem;
- int32 ben;
-} beos_ben;
-# define MUTEX_T beos_ben *
-#endif
-
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-
-typedef void (*ts_allocate_ctor)(void *, void ***);
-typedef void (*ts_allocate_dtor)(void *, void ***);
-
-#define THREAD_HASH_OF(thr,ts) (unsigned long)thr%(unsigned long)ts
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* startup/shutdown */
-TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename);
-TSRM_API void tsrm_shutdown(void);
-
-/* allocates a new thread-safe-resource id */
-TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor);
-
-/* fetches the requested resource for the current thread */
-TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id);
-#define ts_resource(id) ts_resource_ex(id, NULL)
-
-/* frees all resources allocated for the current thread */
-TSRM_API void ts_free_thread(void);
-
-/* frees all resources allocated for all threads except current */
-void ts_free_worker_threads(void);
-
-/* deallocates all occurrences of a given id */
-TSRM_API void ts_free_id(ts_rsrc_id id);
-
-
-/* Debug support */
-#define TSRM_ERROR_LEVEL_ERROR 1
-#define TSRM_ERROR_LEVEL_CORE 2
-#define TSRM_ERROR_LEVEL_INFO 3
-
-typedef void (*tsrm_thread_begin_func_t)(THREAD_T thread_id, void ***tsrm_ls);
-typedef void (*tsrm_thread_end_func_t)(THREAD_T thread_id, void ***tsrm_ls);
-
-
-TSRM_API int tsrm_error(int level, const char *format, ...);
-TSRM_API void tsrm_error_set(int level, char *debug_filename);
-
-/* utility functions */
-TSRM_API THREAD_T tsrm_thread_id(void);
-TSRM_API MUTEX_T tsrm_mutex_alloc(void);
-TSRM_API void tsrm_mutex_free(MUTEX_T mutexp);
-TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp);
-TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp);
-#ifdef HAVE_SIGPROCMASK
-TSRM_API int tsrm_sigmask(int how, const sigset_t *set, sigset_t *oldset);
-#endif
-
-TSRM_API void *tsrm_set_new_thread_begin_handler(tsrm_thread_begin_func_t new_thread_begin_handler);
-TSRM_API void *tsrm_set_new_thread_end_handler(tsrm_thread_end_func_t new_thread_end_handler);
-
-/* these 3 APIs should only be used by people that fully understand the threading model
- * used by PHP/Zend and the selected SAPI. */
-TSRM_API void *tsrm_new_interpreter_context(void);
-TSRM_API void *tsrm_set_interpreter_context(void *new_ctx);
-TSRM_API void tsrm_free_interpreter_context(void *context);
-
-#define TSRM_SHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)+1)
-#define TSRM_UNSHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)-1)
-
-#define TSRMLS_FETCH() void ***tsrm_ls = (void ***) ts_resource_ex(0, NULL)
-#define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = (void ***) ctx
-#define TSRMLS_SET_CTX(ctx) ctx = (void ***) tsrm_ls
-#define TSRMG(id, type, element) (((type) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(id)])->element)
-#define TSRMLS_D void ***tsrm_ls
-#define TSRMLS_DC , TSRMLS_D
-#define TSRMLS_C tsrm_ls
-#define TSRMLS_CC , TSRMLS_C
-
-#ifdef __cplusplus
-}
-#endif
-
-#else /* non ZTS */
-
-#define TSRMLS_FETCH()
-#define TSRMLS_FETCH_FROM_CTX(ctx)
-#define TSRMLS_SET_CTX(ctx)
-#define TSRMLS_D void
-#define TSRMLS_DC
-#define TSRMLS_C
-#define TSRMLS_CC
-
-#endif /* ZTS */
-
-#endif /* TSRM_H */
View
45 sw/linux/include/php/TSRM/readdir.h
@@ -1,45 +0,0 @@
-#ifndef READDIR_H
-#define READDIR_H
-
-
-/*
- * Structures and types used to implement opendir/readdir/closedir
- * on Windows 95/NT.
- */
-
-#include <windows.h>
-
-#include <io.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <direct.h>
-
-/* struct dirent - same as Unix */
-
-struct dirent {
- long d_ino; /* inode (always 1 in WIN32) */
- off_t d_off; /* offset to this dirent */
- unsigned short d_reclen; /* length of d_name */
- char d_name[_MAX_FNAME + 1]; /* filename (null terminated) */
-};
-
-
-/* typedef DIR - not the same as Unix */
-typedef struct {
- HANDLE handle; /* _findfirst/_findnext handle */
- short offset; /* offset into directory */
- short finished; /* 1 if there are not more files */
- WIN32_FIND_DATA fileinfo; /* from _findfirst/_findnext */
- char *dir; /* the dir we are reading */
- struct dirent dent; /* the dirent to return */
-} DIR;
-
-/* Function prototypes */
-DIR *opendir(const char *);
-struct dirent *readdir(DIR *);
-int readdir_r(DIR *, struct dirent *, struct dirent **);
-int closedir(DIR *);
-int rewinddir(DIR *);
-
-#endif /* READDIR_H */
View
1 sw/linux/include/php/TSRM/tsrm_config.h
@@ -1 +0,0 @@
-#include <../main/php_config.h>
View
22 sw/linux/include/php/TSRM/tsrm_config.w32.h
@@ -1,22 +0,0 @@
-#ifndef TSRM_CONFIG_W32_H
-#define TSRM_CONFIG_W32_H
-
-#include <../main/config.w32.h>
-
-#define HAVE_UTIME 1
-#define HAVE_ALLOCA 1
-#define HAVE_REALPATH 1
-
-#include <malloc.h>
-#include <stdlib.h>
-#include <crtdbg.h>
-
-#undef inline
-#ifdef ZEND_WIN32_FORCE_INLINE
-# define inline __forceinline
-#else
-# define inline
-#endif
-
-
-#endif
View
70 sw/linux/include/php/TSRM/tsrm_config_common.h
@@ -1,70 +0,0 @@
-#ifndef TSRM_CONFIG_COMMON_H
-#define TSRM_CONFIG_COMMON_H
-
-#ifndef __CYGWIN__
-# if WINNT|WIN32
-# define TSRM_WIN32
-# endif
-#endif
-
-#ifdef TSRM_WIN32
-# include "tsrm_config.w32.h"
-#else
-# include <tsrm_config.h>
-# include <sys/param.h>
-#endif
-
-#if HAVE_ALLOCA_H && !defined(_ALLOCA_H)
-# include <alloca.h>
-#endif
-
-/* AIX requires this to be the first thing in the file. */
-#ifndef __GNUC__
-# ifndef HAVE_ALLOCA_H
-# ifdef _AIX
-#pragma alloca
-# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-# ifndef NETWARE
-char *alloca ();
-# endif
-# endif
-# endif
-# endif
-#endif
-
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#if HAVE_LIMITS_H
-#include <limits.h>
-#endif
-
-#ifndef MAXPATHLEN
-# ifdef PATH_MAX
-# define MAXPATHLEN PATH_MAX
-# elif defined(MAX_PATH)
-# define MAXPATHLEN MAX_PATH
-# else
-# define MAXPATHLEN 256
-# endif
-#endif
-
-#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2))
-# define TSRM_ALLOCA_MAX_SIZE 4096
-# define TSRM_ALLOCA_FLAG(name) \
- int name;
-# define tsrm_do_alloca_ex(size, limit, use_heap) \
- ((use_heap = ((size) > (limit))) ? malloc(size) : alloca(size))
-# define tsrm_do_alloca(size, use_heap) \
- tsrm_do_alloca_ex(size, TSRM_ALLOCA_MAX_SIZE, use_heap)
-# define tsrm_free_alloca(p, use_heap) \
- do { if (use_heap) free(p); } while (0)
-#else
-# define TSRM_ALLOCA_FLAG(name)
-# define tsrm_do_alloca(p, use_heap) malloc(p)
-# define tsrm_free_alloca(p, use_heap) free(p)
-#endif
-
-#endif /* TSRM_CONFIG_COMMON_H */
View
29 sw/linux/include/php/TSRM/tsrm_nw.h
@@ -1,29 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2011 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 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_01.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. |
- +----------------------------------------------------------------------+
- | Authors: Venkat Raghavan S <rvenkat@novell.com> |
- | Anantha Kesari H Y <hyanantha@novell.com> |
- +----------------------------------------------------------------------+
-*/
-
-
-#ifndef TSRM_NW_H
-#define TSRM_NW_H
-
-#include "TSRM.h"
-
-TSRM_API FILE* popen(const char *command, const char *type);
-TSRM_API int pclose(FILE* stream);
-
-#endif
View
6 sw/linux/include/php/TSRM/tsrm_strtok_r.h
@@ -1,6 +0,0 @@
-#ifndef TSRM_STRTOK_R
-#define TSRM_STRTOK_R
-
-char *tsrm_strtok_r(char *s, const char *delim, char **last);
-
-#endif
View
338 sw/linux/include/php/TSRM/tsrm_virtual_cwd.h
@@ -1,338 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2011 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 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_01.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. |
- +----------------------------------------------------------------------+
- | Authors: Andi Gutmans <andi@zend.com> |
- | Sascha Schumann <sascha@schumann.cx> |
- | Pierre Joye <pierre@php.net> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: tsrm_virtual_cwd.h 306938 2011-01-01 02:17:06Z felipe $ */
-
-#ifndef VIRTUAL_CWD_H
-#define VIRTUAL_CWD_H
-
-#include "TSRM.h"
-#include "tsrm_config_common.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-
-#ifdef HAVE_UTIME_H
-#include <utime.h>
-#endif
-
-#ifdef HAVE_STDARG_H
-#include <stdarg.h>
-#endif
-
-#ifdef ZTS
-#define VIRTUAL_DIR
-#endif
-
-#ifndef TSRM_WIN32
-#include <unistd.h>
-#else
-#include <direct.h>
-#endif
-
-#if defined(__osf__) || defined(_AIX)
-#include <errno.h>
-#endif
-
-#ifdef TSRM_WIN32
-#include "readdir.h"
-#include <sys/utime.h>
-/* mode_t isn't defined on Windows */
-typedef unsigned short mode_t;
-
-#define DEFAULT_SLASH '\\'
-#define DEFAULT_DIR_SEPARATOR ';'
-#define IS_SLASH(c) ((c) == '/' || (c) == '\\')
-#define IS_SLASH_P(c) (*(c) == '/' || \
- (*(c) == '\\' && !IsDBCSLeadByte(*(c-1))))
-
-/* COPY_WHEN_ABSOLUTE is 2 under Win32 because by chance both regular absolute paths
- in the file system and UNC paths need copying of two characters */
-#define COPY_WHEN_ABSOLUTE(path) 2
-#define IS_UNC_PATH(path, len) \
- (len >= 2 && IS_SLASH(path[0]) && IS_SLASH(path[1]))
-#define IS_ABSOLUTE_PATH(path, len) \
- (len >= 2 && ((isalpha(path[0]) && path[1] == ':') || IS_UNC_PATH(path, len)))
-
-#elif defined(NETWARE)
-#ifdef HAVE_DIRENT_H
-#include <dirent.h>
-#endif
-
-#define DEFAULT_SLASH '/'
-#define DEFAULT_DIR_SEPARATOR ';'
-#define IS_SLASH(c) ((c) == '/' || (c) == '\\')
-#define IS_SLASH_P(c) IS_SLASH(*(c))
-/* Colon indicates volume name, either first character should be forward slash or backward slash */
-#define IS_ABSOLUTE_PATH(path, len) \
- ((strchr(path, ':') != NULL) || ((len >= 1) && ((path[0] == '/') || (path[0] == '\\'))))
-
-#else
-#ifdef HAVE_DIRENT_H
-#include <dirent.h>
-#endif
-
-#define DEFAULT_SLASH '/'
-
-#ifdef __riscos__
-#define DEFAULT_DIR_SEPARATOR ';'
-#else
-#define DEFAULT_DIR_SEPARATOR ':'
-#endif
-
-#define IS_SLASH(c) ((c) == '/')
-#define IS_SLASH_P(c) (*(c) == '/')
-
-#endif
-
-
-#ifndef COPY_WHEN_ABSOLUTE
-#define COPY_WHEN_ABSOLUTE(path) 0
-#endif
-
-#ifndef IS_ABSOLUTE_PATH
-#define IS_ABSOLUTE_PATH(path, len) \
- (IS_SLASH(path[0]))
-#endif
-
-#ifdef TSRM_EXPORTS
-#define CWD_EXPORTS
-#endif
-
-#ifdef TSRM_WIN32
-# ifdef CWD_EXPORTS
-# define CWD_API __declspec(dllexport)
-# else
-# define CWD_API __declspec(dllimport)
-# endif
-#elif defined(__GNUC__) && __GNUC__ >= 4
-# define CWD_API __attribute__ ((visibility("default")))
-#else
-# define CWD_API
-#endif
-
-#ifdef TSRM_WIN32
-CWD_API int php_sys_stat_ex(const char *path, struct stat *buf, int lstat);
-# define php_sys_stat(path, buf) php_sys_stat_ex(path, buf, 0)
-# define php_sys_lstat(path, buf) php_sys_stat_ex(path, buf, 1)
-CWD_API int php_sys_readlink(const char *link, char *target, size_t target_len);
-#else
-# define php_sys_stat stat
-# define php_sys_lstat lstat
-# ifdef HAVE_SYMLINK
-# define php_sys_readlink(link, target, target_len) readlink(link, target, target_len)
-# endif
-#endif
-
-typedef struct _cwd_state {
- char *cwd;
- int cwd_length;
-} cwd_state;
-
-typedef int (*verify_path_func)(const cwd_state *);
-
-CWD_API void virtual_cwd_startup(void);
-CWD_API void virtual_cwd_shutdown(void);
-CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC);
-CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC);
-CWD_API int virtual_chdir(const char *path TSRMLS_DC);
-CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path TSRMLS_DC) TSRMLS_DC);
-CWD_API int virtual_filepath(const char *path, char **filepath TSRMLS_DC);
-CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path TSRMLS_DC);
-CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC);
-CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC);
-CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...);
-CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC);
-CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC);
-CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC);
-CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC);
-CWD_API int virtual_unlink(const char *path TSRMLS_DC);
-CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC);
-CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC);
-CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC);
-CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC);
-CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC);
-#if defined(TSRM_WIN32)
-/* these are not defined in win32 headers */
-#ifndef W_OK
-#define W_OK 0x02
-#endif
-#ifndef R_OK
-#define R_OK 0x04
-#endif
-#ifndef X_OK
-#define X_OK 0x01
-#endif
-#ifndef F_OK
-#define F_OK 0x00
-#endif
-#endif
-
-#if HAVE_UTIME
-CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC);
-#endif
-CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC);
-#if !defined(TSRM_WIN32) && !defined(NETWARE)
-CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link TSRMLS_DC);
-#endif
-
-/* One of the following constants must be used as the last argument
- in virtual_file_ex() call. */
-
-#define CWD_EXPAND 0 /* expand "." and ".." but dont resolve symlinks */
-#define CWD_FILEPATH 1 /* resolve symlinks if file is exist otherwise expand */
-#define CWD_REALPATH 2 /* call realpath(), resolve symlinks. File must exist */
-
-CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath TSRMLS_DC);
-
-CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC);
-
-#define REALPATH_CACHE_TTL (2*60) /* 2 minutes */
-#define REALPATH_CACHE_SIZE 0 /* disabled while php.ini isn't loaded */
-
-typedef struct _realpath_cache_bucket {
- unsigned long key;
- char *path;
- int path_len;
- char *realpath;
- int realpath_len;
- int is_dir;
- time_t expires;
-#ifdef PHP_WIN32
- unsigned char is_rvalid;
- unsigned char is_readable;
- unsigned char is_wvalid;
- unsigned char is_writable;
-#endif
- struct _realpath_cache_bucket *next;
-} realpath_cache_bucket;
-
-typedef struct _virtual_cwd_globals {
- cwd_state cwd;
- long realpath_cache_size;
- long realpath_cache_size_limit;
- long realpath_cache_ttl;
- realpath_cache_bucket *realpath_cache[1024];
-} virtual_cwd_globals;
-
-#ifdef ZTS
-extern ts_rsrc_id cwd_globals_id;
-# define CWDG(v) TSRMG(cwd_globals_id, virtual_cwd_globals *, v)
-#else
-extern virtual_cwd_globals cwd_globals;
-# define CWDG(v) (cwd_globals.v)
-#endif
-
-CWD_API void realpath_cache_clean(TSRMLS_D);
-CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC);
-CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int path_len, time_t t TSRMLS_DC);
-CWD_API int realpath_cache_size(TSRMLS_D);
-CWD_API int realpath_cache_max_buckets(TSRMLS_D);
-CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D);
-
-/* The actual macros to be used in programs using TSRM
- * If the program defines VIRTUAL_DIR it will use the
- * virtual_* functions
- */
-
-#ifdef VIRTUAL_DIR
-
-#define VCWD_GETCWD(buff, size) virtual_getcwd(buff, size TSRMLS_CC)
-#define VCWD_FOPEN(path, mode) virtual_fopen(path, mode TSRMLS_CC)
-/* Because open() has two modes, we have to macros to replace it */
-#define VCWD_OPEN(path, flags) virtual_open(path TSRMLS_CC, flags)
-#define VCWD_OPEN_MODE(path, flags, mode) virtual_open(path TSRMLS_CC, flags, mode)
-#define VCWD_CREAT(path, mode) virtual_creat(path, mode TSRMLS_CC)
-#define VCWD_CHDIR(path) virtual_chdir(path TSRMLS_CC)
-#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, virtual_chdir TSRMLS_CC)
-#define VCWD_GETWD(buf)
-#define VCWD_REALPATH(path, real_path) virtual_realpath(path, real_path TSRMLS_CC)
-#define VCWD_RENAME(oldname, newname) virtual_rename(oldname, newname TSRMLS_CC)
-#define VCWD_STAT(path, buff) virtual_stat(path, buff TSRMLS_CC)
-# define VCWD_LSTAT(path, buff) virtual_lstat(path, buff TSRMLS_CC)
-#define VCWD_UNLINK(path) virtual_unlink(path TSRMLS_CC)
-#define VCWD_MKDIR(pathname, mode) virtual_mkdir(pathname, mode TSRMLS_CC)
-#define VCWD_RMDIR(pathname) virtual_rmdir(pathname TSRMLS_CC)
-#define VCWD_OPENDIR(pathname) virtual_opendir(pathname TSRMLS_CC)
-#define VCWD_POPEN(command, type) virtual_popen(command, type TSRMLS_CC)
-#define VCWD_ACCESS(pathname, mode) virtual_access(pathname, mode TSRMLS_CC)
-#if HAVE_UTIME
-#define VCWD_UTIME(path, time) virtual_utime(path, time TSRMLS_CC)
-#endif
-#define VCWD_CHMOD(path, mode) virtual_chmod(path, mode TSRMLS_CC)
-#if !defined(TSRM_WIN32) && !defined(NETWARE)
-#define VCWD_CHOWN(path, owner, group) virtual_chown(path, owner, group, 0 TSRMLS_CC)
-#if HAVE_LCHOWN
-#define VCWD_LCHOWN(path, owner, group) virtual_chown(path, owner, group, 1 TSRMLS_CC)
-#endif
-#endif
-
-#else
-
-#define VCWD_GETCWD(buff, size) getcwd(buff, size)
-#define VCWD_FOPEN(path, mode) fopen(path, mode)
-#define VCWD_OPEN(path, flags) open(path, flags)
-#define VCWD_OPEN_MODE(path, flags, mode) open(path, flags, mode)
-#define VCWD_CREAT(path, mode) creat(path, mode)
-/* rename on windows will fail if newname already exists.
- MoveFileEx has to be used */
-#if defined(TSRM_WIN32)
-# define VCWD_RENAME(oldname, newname) (MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED) == 0 ? -1 : 0)
-#else
-# define VCWD_RENAME(oldname, newname) rename(oldname, newname)
-#endif
-#define VCWD_CHDIR(path) chdir(path)
-#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, chdir)
-#define VCWD_GETWD(buf) getwd(buf)
-#define VCWD_STAT(path, buff) php_sys_stat(path, buff)
-#define VCWD_LSTAT(path, buff) lstat(path, buff)
-#define VCWD_UNLINK(path) unlink(path)
-#define VCWD_MKDIR(pathname, mode) mkdir(pathname, mode)
-#define VCWD_RMDIR(pathname) rmdir(pathname)
-#define VCWD_OPENDIR(pathname) opendir(pathname)
-#define VCWD_POPEN(command, type) popen(command, type)
-#if defined(TSRM_WIN32)
-#define VCWD_ACCESS(pathname, mode) tsrm_win32_access(pathname, mode TSRMLS_CC)
-#else
-#define VCWD_ACCESS(pathname, mode) access(pathname, mode)
-#endif
-
-#define VCWD_REALPATH(path, real_path) tsrm_realpath(path, real_path TSRMLS_CC)
-
-#if HAVE_UTIME
-# ifdef TSRM_WIN32
-# define VCWD_UTIME(path, time) win32_utime(path, time)
-# else
-# define VCWD_UTIME(path, time) utime(path, time)
-# endif
-#endif
-
-#define VCWD_CHMOD(path, mode) chmod(path, mode)
-#if !defined(TSRM_WIN32) && !defined(NETWARE)
-#define VCWD_CHOWN(path, owner, group) chown(path, owner, group)
-#if HAVE_LCHOWN
-#define VCWD_LCHOWN(path, owner, group) lchown(path, owner, group)
-#endif
-#endif
-
-#endif
-
-#endif /* VIRTUAL_CWD_H */
View
110 sw/linux/include/php/TSRM/tsrm_win32.h
@@ -1,110 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2011 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 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_01.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. |
- +----------------------------------------------------------------------+
- | Authors: Daniel Beulshausen <daniel@php4win.de> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: tsrm_win32.h 306938 2011-01-01 02:17:06Z felipe $ */
-
-#ifndef TSRM_WIN32_H
-#define TSRM_WIN32_H
-
-#include "TSRM.h"
-#include <windows.h>
-
-struct ipc_perm {
- int key;
- unsigned short uid;
- unsigned short gid;
- unsigned short cuid;
- unsigned short cgid;
- unsigned short mode;
- unsigned short seq;
-};
-
-struct shmid_ds {
- struct ipc_perm shm_perm;
- int shm_segsz;
- time_t shm_atime;
- time_t shm_dtime;
- time_t shm_ctime;
- unsigned short shm_cpid;
- unsigned short shm_lpid;
- short shm_nattch;
-};
-
-typedef struct {
- FILE *stream;
- HANDLE prochnd;
-} process_pair;
-
-typedef struct {
- void *addr;
- HANDLE info;
- HANDLE segment;
- struct shmid_ds *descriptor;
-} shm_pair;
-
-typedef struct {
- process_pair *process;
- shm_pair *shm;
- int process_size;
- int shm_size;
- char *comspec;
- HANDLE impersonation_token;
- PSID impersonation_token_sid;
-} tsrm_win32_globals;
-
-#ifdef ZTS
-# define TWG(v) TSRMG(win32_globals_id, tsrm_win32_globals *, v)
-#else
-# define TWG(v) (win32_globals.v)
-#endif
-
-#define IPC_PRIVATE 0
-#define IPC_CREAT 00001000
-#define IPC_EXCL 00002000
-#define IPC_NOWAIT 00004000
-
-#define IPC_RMID 0
-#define IPC_SET 1
-#define IPC_STAT 2
-#define IPC_INFO 3
-
-#define SHM_R PAGE_READONLY
-#define SHM_W PAGE_READWRITE
-
-#define SHM_RDONLY FILE_MAP_READ
-#define SHM_RND FILE_MAP_WRITE
-#define SHM_REMAP FILE_MAP_COPY
-
-char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC);
-
-TSRM_API void tsrm_win32_startup(void);
-TSRM_API void tsrm_win32_shutdown(void);
-
-TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env TSRMLS_DC);
-TSRM_API FILE *popen(const char *command, const char *type);
-TSRM_API int pclose(FILE *stream);
-TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC);
-TSRM_API int win32_utime(const char *filename, struct utimbuf *buf);
-
-TSRM_API int shmget(int key, int size, int flags);
-TSRM_API void *shmat(int key, const void *shmaddr, int flags);
-TSRM_API int shmdt(const void *shmaddr);
-TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf);
-
-TSRM_API char *realpath(char *orig_path, char *buffer);
-#endif
View
860 sw/linux/include/php/Zend/zend.h
@@ -1,860 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | Zend Engine |
- +----------------------------------------------------------------------+
- | Copyright (c) 1998-2011 Zend Technologies Ltd. (http://www.zend.com) |
- +----------------------------------------------------------------------+
- | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. |
- | If you did not receive a copy of the Zend license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@zend.com so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Andi Gutmans <andi@zend.com> |
- | Zeev Suraski <zeev@zend.com> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: zend.h 315001 2011-08-16 10:44:47Z bjori $ */
-
-#ifndef ZEND_H
-#define ZEND_H
-
-#define ZEND_VERSION "2.4.0"
-
-#define ZEND_ENGINE_2
-
-#ifdef __cplusplus
-#define BEGIN_EXTERN_C() extern "C" {
-#define END_EXTERN_C() }
-#else
-#define BEGIN_EXTERN_C()
-#define END_EXTERN_C()
-#endif
-
-/*
- * general definitions
- */
-
-#ifdef ZEND_WIN32
-# include "zend_config.w32.h"
-# define ZEND_PATHS_SEPARATOR ';'
-#elif defined(NETWARE)
-# include <zend_config.h>
-# define ZEND_PATHS_SEPARATOR ';'
-#elif defined(__riscos__)
-# include <zend_config.h>
-# define ZEND_PATHS_SEPARATOR ';'
-#else
-# include <zend_config.h>
-# define ZEND_PATHS_SEPARATOR ':'
-#endif
-
-#ifdef ZEND_WIN32
-/* Only use this macro if you know for sure that all of the switches values
- are covered by its case statements */
-#define EMPTY_SWITCH_DEFAULT_CASE() \
- default: \
- __assume(0); \
- break;
-#else
-#define EMPTY_SWITCH_DEFAULT_CASE()
-#endif
-
-/* all HAVE_XXX test have to be after the include of zend_config above */
-
-#include <stdio.h>
-
-#ifdef HAVE_UNIX_H
-# include <unix.h>
-#endif
-
-#ifdef HAVE_STDARG_H
-# include <stdarg.h>
-#endif
-
-#ifdef HAVE_DLFCN_H
-# include <dlfcn.h>
-#endif
-
-#if defined(HAVE_LIBDL) && !defined(ZEND_WIN32)
-
-# ifndef RTLD_LAZY
-# define RTLD_LAZY 1 /* Solaris 1, FreeBSD's (2.1.7.1 and older) */
-# endif
-
-# ifndef RTLD_GLOBAL
-# define RTLD_GLOBAL 0
-# endif
-
-# if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT)
-# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
-# elif defined(RTLD_DEEPBIND)
-# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)
-# else
-# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)
-# endif
-# define DL_UNLOAD dlclose
-# if defined(DLSYM_NEEDS_UNDERSCORE)
-# define DL_FETCH_SYMBOL(h,s) dlsym((h), "_" s)
-# else
-# define DL_FETCH_SYMBOL dlsym
-# endif
-# define DL_ERROR dlerror
-# define DL_HANDLE void *
-# define ZEND_EXTENSIONS_SUPPORT 1
-#elif defined(ZEND_WIN32)
-# define DL_LOAD(libname) LoadLibrary(libname)
-# define DL_FETCH_SYMBOL GetProcAddress
-# define DL_UNLOAD FreeLibrary
-# define DL_HANDLE HMODULE
-# define ZEND_EXTENSIONS_SUPPORT 1
-#else
-# define DL_HANDLE void *
-# define ZEND_EXTENSIONS_SUPPORT 0
-#endif
-
-#if HAVE_ALLOCA_H && !defined(_ALLOCA_H)
-# include <alloca.h>
-#endif
-
-/* AIX requires this to be the first thing in the file. */
-#ifndef __GNUC__
-# ifndef HAVE_ALLOCA_H
-# ifdef _AIX
-#pragma alloca
-# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-# endif
-# endif
-# endif
-#endif
-
-/* GCC x.y.z supplies __GNUC__ = x and __GNUC_MINOR__ = y */
-#ifdef __GNUC__
-# define ZEND_GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
-#else
-# define ZEND_GCC_VERSION 0
-#endif
-
-#if ZEND_GCC_VERSION >= 2096
-# define ZEND_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
-#else
-# define ZEND_ATTRIBUTE_MALLOC
-#endif
-
-#if ZEND_GCC_VERSION >= 2007
-# define ZEND_ATTRIBUTE_FORMAT(type, idx, first) __attribute__ ((format(type, idx, first)))
-#else
-# define ZEND_ATTRIBUTE_FORMAT(type, idx, first)
-#endif
-
-#if ZEND_GCC_VERSION >= 3001 && !defined(__INTEL_COMPILER)
-# define ZEND_ATTRIBUTE_PTR_FORMAT(type, idx, first) __attribute__ ((format(type, idx, first)))
-#else
-# define ZEND_ATTRIBUTE_PTR_FORMAT(type, idx, first)
-#endif
-
-#if ZEND_GCC_VERSION >= 3001
-# define ZEND_ATTRIBUTE_DEPRECATED __attribute__((deprecated))
-#elif defined(ZEND_WIN32) && defined(_MSC_VER) && _MSC_VER >= 1300
-# define ZEND_ATTRIBUTE_DEPRECATED __declspec(deprecated)
-#else
-# define ZEND_ATTRIBUTE_DEPRECATED
-#endif
-
-#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004 && defined(__i386__)
-# define ZEND_FASTCALL __attribute__((fastcall))
-#elif defined(_MSC_VER) && defined(_M_IX86)
-# define ZEND_FASTCALL __fastcall
-#else
-# define ZEND_FASTCALL
-#endif
-
-#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004
-#else
-# define __restrict__
-#endif
-#define restrict __restrict__
-
-#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(ZEND_WIN32)) && !(defined(ZTS) && defined(NETWARE)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN)
-# define ZEND_ALLOCA_MAX_SIZE (32 * 1024)
-# define ALLOCA_FLAG(name) \
- zend_bool name;
-# define SET_ALLOCA_FLAG(name) \
- name = 1
-# define do_alloca_ex(size, limit, use_heap) \
- ((use_heap = (UNEXPECTED((size) > (limit)))) ? emalloc(size) : alloca(size))
-# define do_alloca(size, use_heap) \
- do_alloca_ex(size, ZEND_ALLOCA_MAX_SIZE, use_heap)
-# define free_alloca(p, use_heap) \
- do { if (UNEXPECTED(use_heap)) efree(p); } while (0)
-#else
-# define ALLOCA_FLAG(name)
-# define SET_ALLOCA_FLAG(name)
-# define do_alloca(p, use_heap) emalloc(p)
-# define free_alloca(p, use_heap) efree(p)
-#endif
-
-#if ZEND_DEBUG
-#define ZEND_FILE_LINE_D const char *__zend_filename, const uint __zend_lineno
-#define ZEND_FILE_LINE_DC , ZEND_FILE_LINE_D
-#define ZEND_FILE_LINE_ORIG_D const char *__zend_orig_filename, const uint __zend_orig_lineno
-#define ZEND_FILE_LINE_ORIG_DC , ZEND_FILE_LINE_ORIG_D
-#define ZEND_FILE_LINE_RELAY_C __zend_filename, __zend_lineno
-#define ZEND_FILE_LINE_RELAY_CC , ZEND_FILE_LINE_RELAY_C
-#define ZEND_FILE_LINE_C __FILE__, __LINE__
-#define ZEND_FILE_LINE_CC , ZEND_FILE_LINE_C
-#define ZEND_FILE_LINE_EMPTY_C NULL, 0
-#define ZEND_FILE_LINE_EMPTY_CC , ZEND_FILE_LINE_EMPTY_C
-#define ZEND_FILE_LINE_ORIG_RELAY_C __zend_orig_filename, __zend_orig_lineno
-#define ZEND_FILE_LINE_ORIG_RELAY_CC , ZEND_FILE_LINE_ORIG_RELAY_C
-#else
-#define ZEND_FILE_LINE_D
-#define ZEND_FILE_LINE_DC
-#define ZEND_FILE_LINE_ORIG_D
-#define ZEND_FILE_LINE_ORIG_DC
-#define ZEND_FILE_LINE_RELAY_C
-#define ZEND_FILE_LINE_RELAY_CC
-#define ZEND_FILE_LINE_C
-#define ZEND_FILE_LINE_CC
-#define ZEND_FILE_LINE_EMPTY_C
-#define ZEND_FILE_LINE_EMPTY_CC
-#define ZEND_FILE_LINE_ORIG_RELAY_C
-#define ZEND_FILE_LINE_ORIG_RELAY_CC
-#endif /* ZEND_DEBUG */
-
-#ifdef ZTS
-#define ZTS_V 1
-#else
-#define ZTS_V 0
-#endif
-
-#include "zend_errors.h"
-#include "zend_alloc.h"
-
-#include "zend_types.h"
-#include "zend_string.h"
-
-#ifdef HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
-#ifndef LONG_MAX
-#define LONG_MAX 2147483647L
-#endif
-
-#ifndef LONG_MIN
-#define LONG_MIN (- LONG_MAX - 1)
-#endif
-
-#if SIZEOF_LONG == 4
-#define MAX_LENGTH_OF_LONG 11
-static const char long_min_digits[] = "2147483648";
-#elif SIZEOF_LONG == 8
-#define MAX_LENGTH_OF_LONG 20
-static const char long_min_digits[] = "9223372036854775808";
-#else
-#error "Unknown SIZEOF_LONG"
-#endif
-
-#define MAX_LENGTH_OF_DOUBLE 32
-
-#undef SUCCESS
-#undef FAILURE
-#define SUCCESS 0
-#define FAILURE -1 /* this MUST stay a negative number, or it may affect functions! */
-
-#include "zend_hash.h"
-#include "zend_ts_hash.h"
-#include "zend_llist.h"
-
-#define INTERNAL_FUNCTION_PARAMETERS int ht, zval *return_value, zval **return_value_ptr, zval *this_ptr, int return_value_used TSRMLS_DC
-#define INTERNAL_FUNCTION_PARAM_PASSTHRU ht, return_value, return_value_ptr, this_ptr, return_value_used TSRMLS_CC
-
-#if defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__)
-void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((noreturn));
-#else
-# define zend_error_noreturn zend_error
-#endif
-
-/*
- * zval
- */
-typedef struct _zval_struct zval;
-typedef struct _zend_class_entry zend_class_entry;
-
-typedef struct _zend_guard {
- zend_bool in_get;
- zend_bool in_set;
- zend_bool in_unset;
- zend_bool in_isset;
- zend_bool dummy; /* sizeof(zend_guard) must not be equal to sizeof(void*) */
-} zend_guard;
-
-typedef struct _zend_object {
- zend_class_entry *ce;
- HashTable *properties;
- zval **properties_table;
- HashTable *guards; /* protects from __get/__set ... recursion */
-} zend_object;
-
-#include "zend_object_handlers.h"
-
-typedef union _zvalue_value {
- long lval; /* long value */
- double dval; /* double value */
- struct {
- char *val;
- int len;
- } str;
- HashTable *ht; /* hash table value */
- zend_object_value obj;
-} zvalue_value;
-
-struct _zval_struct {
- /* Variable information */
- zvalue_value value; /* value */
- zend_uint refcount__gc;
- zend_uchar type; /* active type */
- zend_uchar is_ref__gc;
-};
-
-#define Z_REFCOUNT_PP(ppz) Z_REFCOUNT_P(*(ppz))
-#define Z_SET_REFCOUNT_PP(ppz, rc) Z_SET_REFCOUNT_P(*(ppz), rc)
-#define Z_ADDREF_PP(ppz) Z_ADDREF_P(*(ppz))
-#define Z_DELREF_PP(ppz) Z_DELREF_P(*(ppz))
-#define Z_ISREF_PP(ppz) Z_ISREF_P(*(ppz))
-#define Z_SET_ISREF_PP(ppz) Z_SET_ISREF_P(*(ppz))
-#define Z_UNSET_ISREF_PP(ppz) Z_UNSET_ISREF_P(*(ppz))
-#define Z_SET_ISREF_TO_PP(ppz, isref) Z_SET_ISREF_TO_P(*(ppz), isref)
-
-#define Z_REFCOUNT_P(pz) zval_refcount_p(pz)
-#define Z_SET_REFCOUNT_P(pz, rc) zval_set_refcount_p(pz, rc)
-#define Z_ADDREF_P(pz) zval_addref_p(pz)
-#define Z_DELREF_P(pz) zval_delref_p(pz)
-#define Z_ISREF_P(pz) zval_isref_p(pz)
-#define Z_SET_ISREF_P(pz) zval_set_isref_p(pz)
-#define Z_UNSET_ISREF_P(pz) zval_unset_isref_p(pz)
-#define Z_SET_ISREF_TO_P(pz, isref) zval_set_isref_to_p(pz, isref)
-
-#define Z_REFCOUNT(z) Z_REFCOUNT_P(&(z))
-#define Z_SET_REFCOUNT(z, rc) Z_SET_REFCOUNT_P(&(z), rc)
-#define Z_ADDREF(z) Z_ADDREF_P(&(z))
-#define Z_DELREF(z) Z_DELREF_P(&(z))
-#define Z_ISREF(z) Z_ISREF_P(&(z))
-#define Z_SET_ISREF(z) Z_SET_ISREF_P(&(z))
-#define Z_UNSET_ISREF(z) Z_UNSET_ISREF_P(&(z))
-#define Z_SET_ISREF_TO(z, isref) Z_SET_ISREF_TO_P(&(z), isref)
-
-#if defined(__GNUC__)
-#if __GNUC__ >= 3
-#define zend_always_inline inline __attribute__((always_inline))
-#define zend_never_inline __attribute__((noinline))
-#else
-#define zend_always_inline inline
-#define zend_never_inline
-#endif
-
-#elif defined(_MSC_VER)
-#define zend_always_inline __forceinline
-#define zend_never_inline
-#else
-#define zend_always_inline inline
-#define zend_never_inline
-#endif
-
-#if (defined (__GNUC__) && __GNUC__ > 2 ) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX)
-# define EXPECTED(condition) __builtin_expect(condition, 1)
-# define UNEXPECTED(condition) __builtin_expect(condition, 0)
-#else
-# define EXPECTED(condition) (condition)
-# define UNEXPECTED(condition) (condition)
-#endif
-
-static zend_always_inline zend_uint zval_refcount_p(zval* pz) {
- return pz->refcount__gc;
-}
-
-static zend_always_inline zend_uint zval_set_refcount_p(zval* pz, zend_uint rc) {
- return pz->refcount__gc = rc;
-}
-
-static zend_always_inline zend_uint zval_addref_p(zval* pz) {
- return ++pz->refcount__gc;
-}
-
-static zend_always_inline zend_uint zval_delref_p(zval* pz) {
- return --pz->refcount__gc;
-}
-
-static zend_always_inline zend_bool zval_isref_p(zval* pz) {
- return pz->is_ref__gc;
-}
-
-static zend_always_inline zend_bool zval_set_isref_p(zval* pz) {
- return pz->is_ref__gc = 1;
-}
-
-static zend_always_inline zend_bool zval_unset_isref_p(zval* pz) {
- return pz->is_ref__gc = 0;
-}
-
-static zend_always_inline zend_bool zval_set_isref_to_p(zval* pz, zend_bool isref) {
- return pz->is_ref__gc = isref;
-}
-
-/* excpt.h on Digital Unix 4.0 defines function_table */
-#undef function_table
-
-/* A lot of stuff needs shifiting around in order to include zend_compile.h here */
-union _zend_function;
-
-#include "zend_iterators.h"
-
-struct _zend_serialize_data;
-struct _zend_unserialize_data;
-
-typedef struct _zend_serialize_data zend_serialize_data;
-typedef struct _zend_unserialize_data zend_unserialize_data;
-
-struct _zend_trait_method_reference {
- char* method_name;
- unsigned int mname_len;
-
- zend_class_entry *ce;
-
- char* class_name;
- unsigned int cname_len;
-};
-typedef struct _zend_trait_method_reference zend_trait_method_reference;
-
-struct _zend_trait_precedence {
- zend_trait_method_reference *trait_method;
-
- zend_class_entry** exclude_from_classes;
-
- union _zend_function* function;
-};
-typedef struct _zend_trait_precedence zend_trait_precedence;
-
-struct _zend_trait_alias {
- zend_trait_method_reference *trait_method;
-
- /**
- * name for method to be added
- */
- char* alias;
- unsigned int alias_len;
-
- /**
- * modifiers to be set on trait method
- */
- zend_uint modifiers;
-
- union _zend_function* function;
-};
-typedef struct _zend_trait_alias zend_trait_alias;
-
-struct _zend_class_entry {
- char type;
- const char *name;
- zend_uint name_length;
- struct _zend_class_entry *parent;
- int refcount;
- zend_uint ce_flags;
-
- HashTable function_table;
- HashTable properties_info;
- zval **default_properties_table;
- zval **default_static_members_table;
- zval **static_members_table;
- HashTable constants_table;
- int default_properties_count;
- int default_static_members_count;
-
- union _zend_function *constructor;
- union _zend_function *destructor;
- union _zend_function *clone;
- union _zend_function *__get;
- union _zend_function *__set;
- union _zend_function *__unset;
- union _zend_function *__isset;
- union _zend_function *__call;
- union _zend_function *__callstatic;
- union _zend_function *__tostring;
- union _zend_function *serialize_func;
- union _zend_function *unserialize_func;
-
- zend_class_iterator_funcs iterator_funcs;
-
- /* handlers */
- zend_object_value (*create_object)(zend_class_entry *class_type TSRMLS_DC);
- zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
- int (*interface_gets_implemented)(zend_class_entry *iface, zend_class_entry *class_type TSRMLS_DC); /* a class implements this interface */
- union _zend_function *(*get_static_method)(zend_class_entry *ce, char* method, int method_len TSRMLS_DC);
-
- /* serializer callbacks */
- int (*serialize)(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC);
- int (*unserialize)(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC);
-
- zend_class_entry **interfaces;
- zend_uint num_interfaces;
-
- zend_class_entry **traits;
- zend_uint num_traits;
- zend_trait_alias **trait_aliases;
- zend_trait_precedence **trait_precedences;
-
- union {
- struct {
- char *filename;
- zend_uint line_start;
- zend_uint line_end;
- char *doc_comment;
- zend_uint doc_comment_len;
- } user;
- struct {
- const struct _zend_function_entry *builtin_functions;
- struct _zend_module_entry *module;
- } internal;
- } info;
-};
-
-#include "zend_stream.h"
-typedef struct _zend_utility_functions {
- void (*error_function)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
- int (*printf_function)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
- int (*write_function)(const char *str, uint str_length);
- FILE *(*fopen_function)(const char *filename, char **opened_path TSRMLS_DC);
- void (*message_handler)(long message, void *data TSRMLS_DC);
-#ifndef ZEND_SIGNALS
- void (*block_interruptions)(void);
- void (*unblock_interruptions)(void);
-#endif
- int (*get_configuration_directive)(const char *name, uint name_length, zval *contents);
- void (*ticks_function)(int ticks);
- void (*on_timeout)(int seconds TSRMLS_DC);
- int (*stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
- int (*vspprintf_function)(char **pbuf, size_t max_len, const char *format, va_list ap);
- char *(*getenv_function)(char *name, size_t name_len TSRMLS_DC);
- char *(*resolve_path_function)(const char *filename, int filename_len TSRMLS_DC);
-} zend_utility_functions;
-
-typedef struct _zend_utility_values {
- char *import_use_extension;
- uint import_use_extension_length;
- zend_bool html_errors;
-} zend_utility_values;
-
-typedef int (*zend_write_func_t)(const char *str, uint str_length);
-
-#undef MIN
-#undef MAX
-#define MAX(a, b) (((a)>(b))?(a):(b))
-#define MIN(a, b) (((a)<(b))?(a):(b))
-#define ZEND_STRL(str) (str), (sizeof(str)-1)
-#define ZEND_STRS(str) (str), (sizeof(str))
-#define ZEND_NORMALIZE_BOOL(n) \
- ((n) ? (((n)>0) ? 1 : -1) : 0)
-#define ZEND_TRUTH(x) ((x) ? 1 : 0)
-#define ZEND_LOG_XOR(a, b) (ZEND_TRUTH(a) ^ ZEND_TRUTH(b))
-
-/* data types */
-/* All data types <= IS_BOOL have their constructor/destructors skipped */
-#define IS_NULL 0
-#define IS_LONG 1
-#define IS_DOUBLE 2
-#define IS_BOOL 3
-#define IS_ARRAY 4
-#define IS_OBJECT 5
-#define IS_STRING 6
-#define IS_RESOURCE 7
-#define IS_CONSTANT 8
-#define IS_CONSTANT_ARRAY 9
-#define IS_CALLABLE 10
-
-/* Ugly hack to support constants as static array indices */
-#define IS_CONSTANT_TYPE_MASK 0x00f
-#define IS_CONSTANT_UNQUALIFIED 0x010
-#define IS_CONSTANT_INDEX 0x080
-#define IS_LEXICAL_VAR 0x020
-#define IS_LEXICAL_REF 0x040
-#define IS_CONSTANT_IN_NAMESPACE 0x100
-
-/* overloaded elements data types */
-#define OE_IS_ARRAY (1<<0)
-#define OE_IS_OBJECT (1<<1)
-#define OE_IS_METHOD (1<<2)
-
-int zend_startup(zend_utility_functions *utility_functions, char **extensions TSRMLS_DC);
-void zend_shutdown(TSRMLS_D);
-void zend_register_standard_ini_entries(TSRMLS_D);
-void zend_post_startup(TSRMLS_D);
-void zend_set_utility_values(zend_utility_values *utility_values);
-
-BEGIN_EXTERN_C()
-ZEND_API void _zend_bailout(char *filename, uint lineno);
-END_EXTERN_C()
-
-#define zend_bailout() _zend_bailout(__FILE__, __LINE__)
-
-#ifdef HAVE_SIGSETJMP
-# define SETJMP(a) sigsetjmp(a, 0)
-# define LONGJMP(a,b) siglongjmp(a, b)
-# define JMP_BUF sigjmp_buf
-#else
-# define SETJMP(a) setjmp(a)
-# define LONGJMP(a,b) longjmp(a, b)
-# define JMP_BUF jmp_buf
-#endif
-
-#define zend_try \
- { \
- JMP_BUF *__orig_bailout = EG(bailout); \
- JMP_BUF __bailout; \
- \
- EG(bailout) = &__bailout; \
- if (SETJMP(__bailout)==0) {
-#define zend_catch \
- } else { \
- EG(bailout) = __orig_bailout;
-#define zend_end_try() \
- } \
- EG(bailout) = __orig_bailout; \
- }
-#define zend_first_try EG(bailout)=NULL; zend_try
-
-BEGIN_EXTERN_C()
-ZEND_API char *get_zend_version(void);
-ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_copy);
-ZEND_API int zend_print_zval(zval *expr, int indent);
-ZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent);
-ZEND_API void zend_print_zval_r(zval *expr, int indent TSRMLS_DC);
-ZEND_API void zend_print_flat_zval_r(zval *expr TSRMLS_DC);
-ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent TSRMLS_DC);
-ZEND_API void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
-END_EXTERN_C()
-
-void zend_activate(TSRMLS_D);
-void zend_deactivate(TSRMLS_D);
-void zend_call_destructors(TSRMLS_D);
-void zend_activate_modules(TSRMLS_D);
-void zend_deactivate_modules(TSRMLS_D);
-void zend_post_deactivate_modules(TSRMLS_D);
-
-#if ZEND_DEBUG
-#define Z_DBG(expr) (expr)
-#else
-#define Z_DBG(expr)
-#endif
-
-BEGIN_EXTERN_C()
-ZEND_API void free_estring(char **str_p);
-END_EXTERN_C()
-
-/* FIXME: Check if we can save if (ptr) too */
-
-#define STR_FREE(ptr) if (ptr && !IS_INTERNED(ptr)) { efree(ptr); }
-#define STR_FREE_REL(ptr) if (ptr && !IS_INTERNED(ptr)) { efree_rel(ptr); }
-
-#define STR_EMPTY_ALLOC() estrndup("", sizeof("")-1)
-
-#define STR_REALLOC(ptr, size) \
- ptr = (char *) erealloc(ptr, size);
-
-/* output support */
-#define ZEND_WRITE(str, str_len) zend_write((str), (str_len))
-#define ZEND_WRITE_EX(str, str_len) write_func((str), (str_len))
-#define ZEND_PUTS(str) zend_write((str), strlen((str)))
-#define ZEND_PUTS_EX(str) write_func((str), strlen((str)))
-#define ZEND_PUTC(c) zend_write(&(c), 1), (c)
-
-BEGIN_EXTERN_C()
-extern ZEND_API int (*zend_printf)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
-extern ZEND_API zend_write_func_t zend_write;
-extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path TSRMLS_DC);
-#ifndef ZEND_SIGNALS
-extern ZEND_API void (*zend_block_interruptions)(void);
-extern ZEND_API void (*zend_unblock_interruptions)(void);
-#endif
-extern ZEND_API void (*zend_ticks_function)(int ticks);
-extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
-extern void (*zend_on_timeout)(int seconds TSRMLS_DC);
-extern ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
-extern int (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, va_list ap);
-extern ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC);
-extern ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len TSRMLS_DC);
-
-ZEND_API void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
-
-void zenderror(const char *error);
-
-/* The following #define is used for code duality in PHP for Engine 1 & 2 */
-#define ZEND_STANDARD_CLASS_DEF_PTR zend_standard_class_def
-extern ZEND_API zend_class_entry *zend_standard_class_def;
-extern ZEND_API zend_utility_values zend_uv;
-extern ZEND_API zval zval_used_for_init;
-
-END_EXTERN_C()
-
-#define ZEND_UV(name) (zend_uv.name)
-
-#ifndef ZEND_SIGNALS
-#define HANDLE_BLOCK_INTERRUPTIONS() if (zend_block_interruptions) { zend_block_interruptions(); }
-#define HANDLE_UNBLOCK_INTERRUPTIONS() if (zend_unblock_interruptions) { zend_unblock_interruptions(); }
-#else
-#include "zend_signal.h"
-
-#define HANDLE_BLOCK_INTERRUPTIONS() SIGG(depth)++;
-#define HANDLE_UNBLOCK_INTERRUPTIONS() if (UNEXPECTED((--SIGG(depth))==SIGG(blocked))) { zend_signal_handler_unblock(TSRMLS_C); }
-#endif
-
-BEGIN_EXTERN_C()
-ZEND_API void zend_message_dispatcher(long message, void *data TSRMLS_DC);
-
-ZEND_API int zend_get_configuration_directive(const char *name, uint name_length, zval *contents);
-END_EXTERN_C()
-
-/* Messages for applications of Zend */
-#define ZMSG_FAILED_INCLUDE_FOPEN 1L
-#define ZMSG_FAILED_REQUIRE_FOPEN 2L
-#define ZMSG_FAILED_HIGHLIGHT_FOPEN 3L
-#define ZMSG_MEMORY_LEAK_DETECTED 4L
-#define ZMSG_MEMORY_LEAK_REPEATED 5L
-#define ZMSG_LOG_SCRIPT_NAME 6L
-#define ZMSG_MEMORY_LEAKS_GRAND_TOTAL 7L
-
-#define INIT_PZVAL(z) \
- (z)->refcount__gc = 1; \
- (z)->is_ref__gc = 0;
-
-#define INIT_ZVAL(z) z = zval_used_for_init;
-
-#define ALLOC_INIT_ZVAL(zp) \
- ALLOC_ZVAL(zp); \
- INIT_ZVAL(*zp);
-
-#define MAKE_STD_ZVAL(zv) \
- ALLOC_ZVAL(zv); \
- INIT_PZVAL(zv);
-
-#define PZVAL_IS_REF(z) Z_ISREF_P(z)
-
-#define ZVAL_COPY_VALUE(z, v) \
- do { \
- (z)->value = (v)->value; \
- Z_TYPE_P(z) = Z_TYPE_P(v); \
- } while (0)
-
-#define INIT_PZVAL_COPY(z, v) \
- do { \
- ZVAL_COPY_VALUE(z, v); \
- Z_SET_REFCOUNT_P(z, 1); \
- Z_UNSET_ISREF_P(z); \
- } while (0)
-
-#define SEPARATE_ZVAL(ppzv) \
- do { \
- if (Z_REFCOUNT_PP((ppzv)) > 1) { \
- zval *new_zv; \
- Z_DELREF_PP(ppzv); \
- ALLOC_ZVAL(new_zv); \
- INIT_PZVAL_COPY(new_zv, *(ppzv)); \
- *(ppzv) = new_zv; \
- zval_copy_ctor(new_zv); \
- } \
- } while (0)
-
-#define SEPARATE_ZVAL_IF_NOT_REF(ppzv) \
- if (!PZVAL_IS_REF(*ppzv)) { \
- SEPARATE_ZVAL(ppzv); \
- }
-
-#define SEPARATE_ZVAL_TO_MAKE_IS_REF(ppzv) \
- if (!PZVAL_IS_REF(*ppzv)) { \
- SEPARATE_ZVAL(ppzv); \
- Z_SET_ISREF_PP((ppzv)); \
- }
-
-#define COPY_PZVAL_TO_ZVAL(zv, pzv) \
- (zv) = *(pzv); \
- if (Z_REFCOUNT_P(pzv)>1) { \
- zval_copy_ctor(&(zv)); \
- Z_DELREF_P((pzv)); \
- } else { \
- FREE_ZVAL(pzv); \
- } \
- INIT_PZVAL(&(zv));
-
-#define MAKE_COPY_ZVAL(ppzv, pzv) \
- INIT_PZVAL_COPY(pzv, *(ppzv)); \
- zval_copy_ctor((pzv));
-
-#define REPLACE_ZVAL_VALUE(ppzv_dest, pzv_src, copy) { \
- int is_ref, refcount; \
- \
- SEPARATE_ZVAL_IF_NOT_REF(ppzv_dest); \
- is_ref = Z_ISREF_PP(ppzv_dest); \
- refcount = Z_REFCOUNT_PP(ppzv_dest); \
- zval_dtor(*ppzv_dest); \
- ZVAL_COPY_VALUE(*ppzv_dest, pzv_src); \
- if (copy) { \
- zval_copy_ctor(*ppzv_dest); \
- } \
- Z_SET_ISREF_TO_PP(ppzv_dest, is_ref); \
- Z_SET_REFCOUNT_PP(ppzv_dest, refcount); \
-}
-
-#define SEPARATE_ARG_IF_REF(varptr) \
- if (PZVAL_IS_REF(varptr)) { \
- zval *original_var = varptr; \
- ALLOC_ZVAL(varptr); \
- INIT_PZVAL_COPY(varptr, original_var); \
- zval_copy_ctor(varptr); \
- } else { \
- Z_ADDREF_P(varptr); \
- }
-
-#define READY_TO_DESTROY(zv) \
- (Z_REFCOUNT_P(zv) == 1 && \
- (Z_TYPE_P(zv) != IS_OBJECT || \
- zend_objects_store_get_refcount(zv TSRMLS_CC) == 1))
-
-#define ZEND_MAX_RESERVED_RESOURCES 4
-
-#include "zend_gc.h"
-#include "zend_operators.h"
-#include "zend_variables.h"