diff options
author | Alex Legler <a3li@gentoo.org> | 2009-08-14 11:00:25 +0000 |
---|---|---|
committer | Alex Legler <a3li@gentoo.org> | 2009-08-14 11:00:25 +0000 |
commit | eb91a9520ada618db9988c365d5f8dce03464305 (patch) | |
tree | f8980617ffa6f8a577f6fec85de9d23a721906b8 /dev-php5/eaccelerator | |
parent | Remove obsolete directory. (diff) | |
download | historical-eb91a9520ada618db9988c365d5f8dce03464305.tar.gz historical-eb91a9520ada618db9988c365d5f8dce03464305.tar.bz2 historical-eb91a9520ada618db9988c365d5f8dce03464305.zip |
Non-maintainer commit: Revbump to remove the vulnerable encoder for security bug 277293.
Package-Manager: portage-2.2_rc33/cvs/Linux x86_64
Diffstat (limited to 'dev-php5/eaccelerator')
-rw-r--r-- | dev-php5/eaccelerator/ChangeLog | 13 | ||||
-rw-r--r-- | dev-php5/eaccelerator/Manifest | 18 | ||||
-rw-r--r-- | dev-php5/eaccelerator/eaccelerator-0.9.5.3-r1.ebuild (renamed from dev-php5/eaccelerator/eaccelerator-0.9.5.1.ebuild) | 13 | ||||
-rw-r--r-- | dev-php5/eaccelerator/eaccelerator-0.9.5.3.ebuild | 111 | ||||
-rw-r--r-- | dev-php5/eaccelerator/files/eaccelerator-0.9.5.1-optimize-catch-exceptions.patch | 30 | ||||
-rw-r--r-- | dev-php5/eaccelerator/files/eaccelerator-remove-encoder.patch | 417 |
6 files changed, 452 insertions, 150 deletions
diff --git a/dev-php5/eaccelerator/ChangeLog b/dev-php5/eaccelerator/ChangeLog index 79c9ca719cc7..8cc8350a1a75 100644 --- a/dev-php5/eaccelerator/ChangeLog +++ b/dev-php5/eaccelerator/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for dev-php5/eaccelerator # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-php5/eaccelerator/ChangeLog,v 1.21 2009/05/26 17:00:42 arfrever Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-php5/eaccelerator/ChangeLog,v 1.22 2009/08/14 11:00:24 a3li Exp $ + +*eaccelerator-0.9.5.3-r1 (14 Aug 2009) + + 14 Aug 2009; Alex Legler <a3li@gentoo.org> -eaccelerator-0.9.5.1.ebuild, + -files/eaccelerator-0.9.5.1-optimize-catch-exceptions.patch, + -eaccelerator-0.9.5.3.ebuild, +eaccelerator-0.9.5.3-r1.ebuild, + +files/eaccelerator-remove-encoder.patch: + Non-mainatiner commit: Removing encoder because it a) contains a + vulnerabilitiy and b) is already deprecated by upstream and will be gone + anyway in the next upstream release. Security bug 277293. Removing + vulnerable versions. 26 May 2009; Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> eaccelerator-0.9.5.1.ebuild, eaccelerator-0.9.5.3.ebuild: diff --git a/dev-php5/eaccelerator/Manifest b/dev-php5/eaccelerator/Manifest index 1c68be0ac603..fb7d9636cb4b 100644 --- a/dev-php5/eaccelerator/Manifest +++ b/dev-php5/eaccelerator/Manifest @@ -1,7 +1,15 @@ -AUX eaccelerator-0.9.5.1-optimize-catch-exceptions.patch 1221 RMD160 1329381073936f6431d43a1f0d0bde12f12c4207 SHA1 709f90356a97af00dd737d7753697a95885c02d4 SHA256 8c6f4fc7b9d00f2964872146ac57fa70b416a8d02fb4d00adf61f04c4b84a79c -DIST eaccelerator-0.9.5.1.tar.bz2 122279 RMD160 871ab91e2fe94bc214ed7dfe927a57289e2e3485 SHA1 2789f56d713549a360871accd9869a6bb4a0b514 SHA256 dadef8cfe4624ea8a42aacd1b7db8eb47672a13ed7f78dd9028ce9edc33c2de2 +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +AUX eaccelerator-remove-encoder.patch 14612 RMD160 553c8681f82d95962e2f94be1083ae5bc7a0eb53 SHA1 c144550a94ddf51675fea631d37272fc711f690b SHA256 ddc22103c0e4bf0d348b14407e95ef566a557a5ad23fa56f35db0b71bc643b61 DIST eaccelerator-0.9.5.3.tar.bz2 555631 RMD160 9da55beec18e7a36761b5556d3bb4d5292d21650 SHA1 6671a105497f41c4e93e0b84da516b72df159fc5 SHA256 aa4f0e7817e0193d698db71cc858f45461c2820266941ae2034eb1b82c379e45 -EBUILD eaccelerator-0.9.5.1.ebuild 4207 RMD160 d8c4ecb4d294954ff46e308f0b152f4d30b186a8 SHA1 a8fc273444be08a0b2b81830d68b2ea9ad528bd9 SHA256 09784223f761d69858c930f1f36efcd37131a7c88c43631e9c8054c37cd7de63 -EBUILD eaccelerator-0.9.5.3.ebuild 4080 RMD160 26f6b6b99f0067995945ccfe6e027b3ca6107a36 SHA1 0db3a17a36dabd3bae769f539ee80cb45f5f685d SHA256 abeebf3fbd5f7b189190c526bda7bcbdc0e24d6a44e4767e3bcee9fc9eb2df26 -MISC ChangeLog 3493 RMD160 c4f5a7940f17426b5010b917d6100d1166bb3e77 SHA1 68be5517fa3b6f262da93cd2c147dae5b2957370 SHA256 a3e85a8d040bac1683933a89da01d321a5468e802e1d90586033e239d0861e71 +EBUILD eaccelerator-0.9.5.3-r1.ebuild 4433 RMD160 d783c695617e6b8e588ba8d88cff5b0569e9b9cc SHA1 41899b77f2e69d51ef0855ace026fe20e82044ec SHA256 ec9a7b5915323f3a7ad4b018a2d17a26e1a7f721607e25ae5ba90d8bd2c86d9b +MISC ChangeLog 4011 RMD160 c4c9900c27f1a32ea7222a643596b0b9e4f49cf9 SHA1 5606d92f00e93898ee83ec5c58219f2826052151 SHA256 c8638023560eeac4534902f5a0e83fe4c84c62104784fb3113d86aa346594f3e MISC metadata.xml 353 RMD160 e15ebd8ee1a6ead2ae7b19972fdf20b7e0afa6c4 SHA1 344c0b3d4e75a97c322e8373bb6b2a082b5ab3ed SHA256 88b9d7ebf67f03f4e5b30b31dbeac3d7f1911cc91b9b9be37a394350b85e2d65 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.11 (GNU/Linux) + +iEYEARECAAYFAkqFQ8EACgkQaGsKqSU7eCQQfQCfUB8W7/eAPdguEi2VsV06YJJ0 +JTsAn3amiTa++K5HyxvviuQ8t1y8VljN +=v2CB +-----END PGP SIGNATURE----- diff --git a/dev-php5/eaccelerator/eaccelerator-0.9.5.1.ebuild b/dev-php5/eaccelerator/eaccelerator-0.9.5.3-r1.ebuild index ad324b36926d..906f324f497c 100644 --- a/dev-php5/eaccelerator/eaccelerator-0.9.5.1.ebuild +++ b/dev-php5/eaccelerator/eaccelerator-0.9.5.3-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-php5/eaccelerator/eaccelerator-0.9.5.1.ebuild,v 1.6 2009/05/26 17:00:42 arfrever Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-php5/eaccelerator/eaccelerator-0.9.5.3-r1.ebuild,v 1.1 2009/08/14 11:00:24 a3li Exp $ PHP_EXT_NAME="eaccelerator" PHP_EXT_INI="yes" @@ -8,7 +8,7 @@ PHP_EXT_ZENDEXT="yes" [[ -z "${EACCELERATOR_CACHEDIR}" ]] && EACCELERATOR_CACHEDIR="/var/cache/eaccelerator-php5/" -inherit php-ext-source-r1 eutils depend.apache +inherit php-ext-source-r1 eutils depend.apache autotools KEYWORDS="~amd64 ~sparc ~x86" @@ -61,7 +61,14 @@ pkg_setup() { src_unpack() { unpack ${A} cd "${S}" - epatch "${FILESDIR}"/${P}-optimize-catch-exceptions.patch + + # Remove the badly broken encoder, already done by upstream in SVN trunk + # Also needed for security bug 277293. + rm loader.c encoder.{php,c} doc/php/{loader,encoder}.php || die "Cannot remove encoder" + epatch "${FILESDIR}/${PN}-remove-encoder.patch" + + eautoconf + eautomake php-ext-source-r1_phpize } diff --git a/dev-php5/eaccelerator/eaccelerator-0.9.5.3.ebuild b/dev-php5/eaccelerator/eaccelerator-0.9.5.3.ebuild deleted file mode 100644 index 0eebfc4b00af..000000000000 --- a/dev-php5/eaccelerator/eaccelerator-0.9.5.3.ebuild +++ /dev/null @@ -1,111 +0,0 @@ -# Copyright 1999-2009 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-php5/eaccelerator/eaccelerator-0.9.5.3.ebuild,v 1.2 2009/05/26 17:00:42 arfrever Exp $ - -PHP_EXT_NAME="eaccelerator" -PHP_EXT_INI="yes" -PHP_EXT_ZENDEXT="yes" - -[[ -z "${EACCELERATOR_CACHEDIR}" ]] && EACCELERATOR_CACHEDIR="/var/cache/eaccelerator-php5/" - -inherit php-ext-source-r1 eutils depend.apache - -KEYWORDS="~amd64 ~sparc ~x86" - -DESCRIPTION="A PHP Accelerator & Encoder." -HOMEPAGE="http://www.eaccelerator.net/" -SRC_URI="http://bart.eaccelerator.net/source/${PV}/${P}.tar.bz2" -LICENSE="GPL-2" -SLOT="0" -IUSE="contentcache debug disassembler inode session sharedmem" - -DEPEND="!dev-php5/pecl-apc !dev-php5/xcache" -RDEPEND="${DEPEND}" - -# Webserver user and group, here for Apache by default -HTTPD_USER="${HTTPD_USER:-apache}" -HTTPD_GROUP="${HTTPD_GROUP:-apache}" - -need_php_by_category -want_apache - -pkg_setup() { - depend.apache_pkg_setup - - has_php - - require_php_sapi_from cgi apache2 - - if use session ; then - require_php_with_use session zlib - else - require_php_with_use zlib - fi - - if ! use apache2 ; then - if [[ ${HTTPD_USER} == "apache" ]] || [[ ${HTTPD_GROUP} == "apache" ]] ; then - eerror "You did not enable apache2 USE flag, so you need to define" - eerror "the user and group that will be used for ${PN} yourself." - eerror - eerror "This should (generally) match the user and group that your webserver uses, e.g.:" - eerror "HTTPD_USER=\"lighttpd\" HTTPD_GROUP=\"lighttpd\" if using www-servers/lighttpd" - eerror - die "Either enable USE=\"apache2\" or re-emerge this with HTTPD_USER and HTTPD_GROUP set" - else - enewgroup ${HTTPD_GROUP} - enewuser ${HTTPD_USER} -1 -1 /var/www ${HTTPD_GROUP} - fi - fi -} - -src_compile() { - has_php - - my_conf="--enable-eaccelerator=shared --with-eaccelerator-userid=`id -u ${HTTPD_USER}`" - - use contentcache && my_conf="${my_conf} --with-eaccelerator-content-caching" - use debug && my_conf="${my_conf} --with-eaccelerator-debug" - use disassembler && my_conf="${my_conf} --with-eaccelerator-disassembler" - ! use inode && my_conf="${my_conf} --without-eaccelerator-use-inode" - use session && my_conf="${my_conf} --with-eaccelerator-sessions" - use sharedmem && my_conf="${my_conf} --with-eaccelerator-shared-memory" - - php-ext-source-r1_src_compile -} - -src_install() { - php-ext-source-r1_src_install - - keepdir "${EACCELERATOR_CACHEDIR}" - fowners ${HTTPD_USER}:${HTTPD_GROUP} "${EACCELERATOR_CACHEDIR}" - fperms 750 "${EACCELERATOR_CACHEDIR}" - - insinto "/usr/share/${PN}-php5/" - doins -r doc/php/ - dodoc-php AUTHORS ChangeLog COPYING NEWS README README.eLoader - - php-ext-base-r1_addtoinifiles "eaccelerator.shm_size" '"28"' - php-ext-base-r1_addtoinifiles "eaccelerator.cache_dir" "\"${EACCELERATOR_CACHEDIR}\"" - php-ext-base-r1_addtoinifiles "eaccelerator.enable" '"1"' - php-ext-base-r1_addtoinifiles "eaccelerator.optimizer" '"1"' - php-ext-base-r1_addtoinifiles "eaccelerator.debug" '"0"' - php-ext-base-r1_addtoinifiles ";eaccelerator.log_file" '"/var/log/eaccelerator_log"' - php-ext-base-r1_addtoinifiles "eaccelerator.check_mtime" '"1"' - php-ext-base-r1_addtoinifiles "eaccelerator.filter" '""' - php-ext-base-r1_addtoinifiles "eaccelerator.shm_max" '"0"' - php-ext-base-r1_addtoinifiles "eaccelerator.shm_ttl" '"0"' - php-ext-base-r1_addtoinifiles "eaccelerator.shm_prune_period" '"0"' - php-ext-base-r1_addtoinifiles "eaccelerator.shm_only" '"0"' - php-ext-base-r1_addtoinifiles "eaccelerator.compress" '"1"' - php-ext-base-r1_addtoinifiles "eaccelerator.compress_level" '"9"' - php-ext-base-r1_addtoinifiles "eaccelerator.keys" '"shm_and_disk"' - php-ext-base-r1_addtoinifiles "eaccelerator.sessions" '"shm_and_disk"' - php-ext-base-r1_addtoinifiles "eaccelerator.content" '"shm_and_disk"' - php-ext-base-r1_addtoinifiles ";eaccelerator.allowed_admin_path" '"/path/where/admin/files/shall/be/allowed"' -} - -pkg_postinst() { - elog "Please see the files in ${ROOT}usr/share/${PN}-php5/ for some" - elog "examples and informations on how to use the functions that" - elog "eAccelerator adds to PHP." -} diff --git a/dev-php5/eaccelerator/files/eaccelerator-0.9.5.1-optimize-catch-exceptions.patch b/dev-php5/eaccelerator/files/eaccelerator-0.9.5.1-optimize-catch-exceptions.patch deleted file mode 100644 index 2add432d630c..000000000000 --- a/dev-php5/eaccelerator/files/eaccelerator-0.9.5.1-optimize-catch-exceptions.patch +++ /dev/null @@ -1,30 +0,0 @@ -Index: eaccelerator/trunk/ChangeLog -=================================================================== ---- eaccelerator/trunk/ChangeLog (revision 308) -+++ eaccelerator/trunk/ChangeLog (revision 323) -@@ -1,2 +1,8 @@ -+2007-08-14 Hans Rakers <hans at react.nl> -+ -+ * Optimizer fix for #242. PHP-5.2.1 introduces a ZEND_JMP before a -+ ZEND_FETCH_CLASS/ZEND_CATCH which the optimizer did not handle -+ correctly, resulting in uncaught exceptions. (Thanks to warwickshaw) -+ - 2007-05-09 Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> - -Index: eaccelerator/trunk/optimize.c -=================================================================== ---- eaccelerator/trunk/optimize.c (revision 322) -+++ eaccelerator/trunk/optimize.c (revision 323) -@@ -2976,4 +2976,11 @@ - op->extended_value = 0; - } -+# if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 2 && PHP_RELEASE_VERSION >= 1) || PHP_MAJOR_VERSION >= 6 -+ /* php > 5.2.1 introduces a ZEND_JMP before a ZEND_FETCH_CLASS and ZEND_CATCH -+ this leaves those blocks intact */ -+ else if ((op+1)->opcode == ZEND_FETCH_CLASS && (op+2)->opcode == ZEND_CATCH) { /* fix for #242 */ -+ p->follow = &bb[line_num]; -+ } -+# endif - #endif - break; - diff --git a/dev-php5/eaccelerator/files/eaccelerator-remove-encoder.patch b/dev-php5/eaccelerator/files/eaccelerator-remove-encoder.patch new file mode 100644 index 000000000000..6a77dcc56675 --- /dev/null +++ b/dev-php5/eaccelerator/files/eaccelerator-remove-encoder.patch @@ -0,0 +1,417 @@ +Removing the encoder which has a security issue and is deprectated by upstream anyway. Bug 277293. +Changes from upstream SVN r246, backported by a3li@gentoo.org. +Note the rm'ed files in the ebuild, too. + +diff -Naur a/config.m4 b/config.m4 +--- a/config.m4 2007-05-16 21:07:31.000000000 +0200 ++++ b/config.m4 2009-08-13 18:54:15.759128874 +0200 +@@ -29,20 +29,6 @@ + eaccelerator_optimizer=yes + ]) + +-AC_ARG_WITH(eaccelerator-encoder, +-[ --without-eaccelerator-encoder Do not include eaccelerator encoder],[ +- eaccelerator_encoder=$withval +-],[ +- eaccelerator_encoder=yes +-]) +- +-AC_ARG_WITH(eaccelerator-loader, +-[ --without-eaccelerator-loader Do not include eaccelerator loader],[ +- eaccelerator_loader=$withval +-],[ +- eaccelerator_loader=yes +-]) +- + AC_ARG_WITH(eaccelerator-shared-memory, + [ --with-eaccelerator-shared-memory Include eaccelerator shared memory functions],[ + eaccelerator_shm=$withval +@@ -124,12 +110,6 @@ + if test "$eaccelerator_optimizer" = "yes"; then + AC_DEFINE(WITH_EACCELERATOR_OPTIMIZER, 1, [Define if you like to use peephole opcode optimization]) + fi +- if test "$eaccelerator_encoder" = "yes"; then +- AC_DEFINE(WITH_EACCELERATOR_ENCODER, 1, [Define if you like to use eAccelerator enoder]) +- fi +- if test "$eaccelerator_loader" = "yes"; then +- AC_DEFINE(WITH_EACCELERATOR_LOADER, 1, [Define if you like to load files encoded by eAccelerator encoder]) +- fi + if test "$eaccelerator_shm" = "yes"; then + AC_DEFINE(WITH_EACCELERATOR_SHM, 1, [Define if you like to use the eAccelerator functions to store keys in shared memory]) + fi +diff -Naur a/eaccelerator.c b/eaccelerator.c +--- a/eaccelerator.c 2008-05-18 11:04:20.000000000 +0200 ++++ b/eaccelerator.c 2009-08-13 18:54:15.759128874 +0200 +@@ -1408,52 +1408,6 @@ + ((stat(file_handle->opened_path, &buf) == 0) && S_ISREG(buf.st_mode)))) { + DBG(ea_debug_printf, (EA_TEST_PERFORMANCE, "\t[%d] compile_file: storing in cache (%ld)\n", getpid(), ea_debug_elapsed_time(&tv_start))); + DBG(ea_debug_printf, (EA_DEBUG, "\t[%d] compile_file: storing in cache\n", getpid())); +-#ifdef WITH_EACCELERATOR_LOADER +- if (t->last >= 3 && +- t->opcodes[0].opcode == ZEND_SEND_VAL && +- t->opcodes[1].opcode == ZEND_DO_FCALL && +- t->opcodes[2].opcode == ZEND_RETURN && +- t->opcodes[1].op1.op_type == IS_CONST && +- t->opcodes[1].op1.u.constant.type == IS_STRING && +- t->opcodes[1].op1.u.constant.value.str.len == sizeof("eaccelerator_load")-1 && +- (memcmp(t->opcodes[1].op1.u.constant.value.str.val, "eaccelerator_load", sizeof("eaccelerator_load")-1) == 0) && +- t->opcodes[0].op1.op_type == IS_CONST && +- t->opcodes[0].op1.u.constant.type == IS_STRING) { +- zend_op_array* new_t = NULL; +- zend_bool old_in_compilation = CG(in_compilation); +- char* old_filename = CG(compiled_filename); +- int old_lineno = CG(zend_lineno); +- +- CG(in_compilation) = 1; +- zend_set_compiled_filename(t->filename TSRMLS_CC); +- CG(zend_lineno) = t->opcodes[1].lineno; +- +- zend_try { +- new_t = eaccelerator_load( +- t->opcodes[0].op1.u.constant.value.str.val, +- t->opcodes[0].op1.u.constant.value.str.len TSRMLS_CC); +- } zend_catch { +- CG(function_table) = orig_function_table; +- CG(class_table) = orig_class_table; +- ea_bailout = 1; +- } zend_end_try(); +- if (ea_bailout) { +- zend_bailout (); +- } +- CG(in_compilation) = old_in_compilation; +- CG(compiled_filename) = old_filename; +- CG(zend_lineno) = old_lineno; +- if (new_t != NULL) { +-#ifdef ZEND_ENGINE_2 +- destroy_op_array(t TSRMLS_CC); +-#else +- destroy_op_array(t); +-#endif +- efree(t); +- t = new_t; +- } +- } +-#endif + function_table_tail = function_table_tail?function_table_tail->pListNext:CG(function_table)->pListHead; + class_table_tail = class_table_tail?class_table_tail->pListNext:CG(class_table)->pListHead; + if (eaccelerator_store(file_handle->opened_path, &buf, nreloads, t, function_table_tail, class_table_tail TSRMLS_CC)) { +@@ -1907,7 +1861,6 @@ + eaccelerator_globals->cache_dir = NULL; + eaccelerator_globals->optimizer_enabled = 1; + eaccelerator_globals->compiler = 0; +- eaccelerator_globals->encoder = 0; + eaccelerator_globals->cond_list = NULL; + eaccelerator_globals->content_headers = NULL; + #ifdef WITH_EACCELERATOR_SESSIONS +@@ -1986,15 +1939,6 @@ + } + } + #endif +-#ifdef WITH_EACCELERATOR_LOADER +- if (zend_hash_exists(&module_registry, EACCELERATOR_LOADER_EXTENSION_NAME, +- sizeof(EACCELERATOR_LOADER_EXTENSION_NAME))) { +- zend_error(E_CORE_WARNING,"Extension \"%s\" is not need with \"%s\". Remove it from php.ini\n", +- EACCELERATOR_LOADER_EXTENSION_NAME, EACCELERATOR_EXTENSION_NAME); +- zend_hash_del(&module_registry, EACCELERATOR_LOADER_EXTENSION_NAME, +- sizeof(EACCELERATOR_LOADER_EXTENSION_NAME)); +- } +-#endif + } + if (!eaccelerator_check_php_version(TSRMLS_C)) { + return FAILURE; +@@ -2115,7 +2059,6 @@ + EAG(in_request) = 1; + EAG(used_entries) = NULL; + EAG(compiler) = 0; +- EAG(encoder) = 0; + EAG(refcount_helper) = 1; + EAG(compress_content) = 1; + EAG(content_headers) = NULL; +@@ -2242,14 +2185,6 @@ + PHP_FE(eaccelerator_removed_scripts, NULL) + PHP_FE(eaccelerator_list_keys, NULL) + #endif +-#ifdef WITH_EACCELERATOR_ENCODER +- PHP_FE(eaccelerator_encode, eaccelerator_second_arg_force_ref) +-#endif +-#ifdef WITH_EACCELERATOR_LOADER +- PHP_FE(eaccelerator_load, NULL) +- PHP_FE(_eaccelerator_loader_file, NULL) +- PHP_FE(_eaccelerator_loader_line, NULL) +-#endif + #ifdef WITH_EACCELERATOR_SESSIONS + #ifndef HAVE_PHP_SESSIONS_SUPPORT + PHP_FE(_eaccelerator_session_open, NULL) +diff -Naur a/eaccelerator.h b/eaccelerator.h +--- a/eaccelerator.h 2007-05-16 21:07:31.000000000 +0200 ++++ b/eaccelerator.h 2009-08-13 18:54:15.751121331 +0200 +@@ -117,7 +117,6 @@ + #endif + + #ifdef HAVE_EACCELERATOR +-#ifndef HAVE_EACCELERATOR_STANDALONE_LOADER + + #include "mm.h" + +@@ -185,7 +184,6 @@ + + /******************************************************************************/ + +-#endif /* HAVE_EACCELERATOR_STANDALONE_LOADER */ + + #ifndef offsetof + # define offsetof(str,fld) ((size_t)&(((str*)NULL)->fld)) +@@ -275,7 +273,6 @@ + char htabkey[1]; /* must be last element */ + } mm_fc_entry; + +-#ifndef HAVE_EACCELERATOR_STANDALONE_LOADER + + /* + * A mm_cache_entry is a bucket for one PHP script file. +@@ -423,11 +420,6 @@ + void eaccelerator_optimize (zend_op_array * op_array); + # endif + +-#ifdef WITH_EACCELERATOR_ENCODER +-PHP_FUNCTION (eaccelerator_encode); +-#endif +-#endif /* HAVE_EACCELERATOR_STANDALONE_LOADER */ +- + #ifdef ZTS + # define EAG(v) TSRMG(eaccelerator_globals_id, zend_eaccelerator_globals*, v) + #else +@@ -444,13 +436,6 @@ + struct _mm_cond_entry *next; + } mm_cond_entry; + +-#ifdef WITH_EACCELERATOR_LOADER +-zend_op_array *eaccelerator_load (char *src, int src_len TSRMLS_DC); +-PHP_FUNCTION (eaccelerator_load); +-PHP_FUNCTION (_eaccelerator_loader_file); +-PHP_FUNCTION (_eaccelerator_loader_line); +-#endif +- + /* + * Globals (different for each process/thread) + */ +@@ -461,7 +446,6 @@ + zend_bool optimizer_enabled; + zend_bool compression_enabled; + zend_bool compiler; +-zend_bool encoder; + zend_bool compress; + zend_bool compress_content; + zend_bool in_request; +@@ -508,16 +492,9 @@ + ZEND_EXTERN_MODULE_GLOBALS (eaccelerator) + + #define EACCELERATOR_EXTENSION_NAME "eAccelerator" +-#define EACCELERATOR_LOADER_EXTENSION_NAME "eLoader" + + #define EA_MAGIC "EACCELERATOR" + +-#define EA_ENCODER_VERSION 0x00000004 +-#define EA_ENCODER_END 0x00 +-#define EA_ENCODER_NAMESPACE 0x01 +-#define EA_ENCODER_CLASS 0x02 +-#define EA_ENCODER_FUNCTION 0x03 +- + #define EACCELERATOR_VERSION_GUID "PHPE8EDA1B6-806A-4851-B1C8-A6B4712F44FB" + #define EACCELERATOR_LOGO_GUID "PHPE6F78DE9-13E4-4dee-8518-5FA2DACEA803" + #define EACCELERATOR_VERSION_STRING ("eAccelerator " EACCELERATOR_VERSION " (PHP " PHP_VERSION ")") +diff -Naur a/ea_store.c b/ea_store.c +--- a/ea_store.c 2007-05-16 21:07:31.000000000 +0200 ++++ b/ea_store.c 2009-08-13 18:54:15.755134601 +0200 +@@ -42,9 +42,8 @@ + #endif + static void calc_string(char *str, int len TSRMLS_DC) + { +- if (len > MAX_DUP_STR_LEN || zend_hash_add(&EAG(strings), str, len, +- &str, sizeof(char *), +- NULL) == SUCCESS) { ++ if (len > MAX_DUP_STR_LEN || ++ zend_hash_add(&EAG(strings), str, len, &str, sizeof(char *), NULL) == SUCCESS) { + EACCELERATOR_ALIGN(EAG(mem)); + EAG(mem) += len; + } +@@ -360,7 +359,6 @@ + return (size_t) EAG(mem); + } + +-/** Functions to store a script **/ + static inline char *store_string(char *str, int len TSRMLS_DC) + { + char *p; +diff -Naur a/Makefile.in b/Makefile.in +--- a/Makefile.in 2007-05-16 21:07:31.000000000 +0200 ++++ b/Makefile.in 2009-08-13 18:54:15.755134601 +0200 +@@ -1,5 +1,5 @@ + LTLIBRARY_NAME = libeaccelerator.la +-LTLIBRARY_SOURCES = eaccelerator.c optimize.c encoder.c loader.c opcodes.c content.c mm.c session.c shm.c debug.c cache.c ea_restore.c ea_store.c ea_info.c ea_dasm.c ++LTLIBRARY_SOURCES = eaccelerator.c optimize.c opcodes.c content.c mm.c session.c shm.c debug.c cache.c ea_restore.c ea_store.c ea_info.c ea_dasm.c + LTLIBRARY_SHARED_NAME = eaccelerator.la + + EXTRA_CFLAGS = -O2 -g -Wall +diff -Naur a/optimize.c b/optimize.c +--- a/optimize.c 2007-08-14 13:14:00.000000000 +0200 ++++ b/optimize.c 2009-08-13 18:54:15.755134601 +0200 +@@ -1496,88 +1496,77 @@ + } + + static int opt_get_constant(const char* name, int name_len, zend_constant** result TSRMLS_DC) { +- if (!EAG(encoder) || +- (name_len == sizeof("false")-1 && strcmp(name,"false") == 0) || +- (name_len == sizeof("true")-1 && strcmp(name,"true") == 0)) { +- union { +- zend_constant *v; +- void *ptr; +- } c; +- int retval; +- char *lookup_name = do_alloca(name_len+1); +- memcpy(lookup_name, name, name_len); +- lookup_name[name_len] = '\0'; ++ union { ++ zend_constant *v; ++ void *ptr; ++ } c; ++ int retval; ++ char *lookup_name = do_alloca(name_len+1); ++ memcpy(lookup_name, name, name_len); ++ lookup_name[name_len] = '\0'; ++ ++ if (zend_hash_find(EG(zend_constants), lookup_name, name_len+1, &c.ptr)==SUCCESS) { ++ *result = c.v; ++ retval=1; ++ } else { ++ zend_str_tolower(lookup_name, name_len); + + if (zend_hash_find(EG(zend_constants), lookup_name, name_len+1, &c.ptr)==SUCCESS) { +- *result = c.v; +- retval=1; +- } else { +- zend_str_tolower(lookup_name, name_len); +- +- if (zend_hash_find(EG(zend_constants), lookup_name, name_len+1, &c.ptr)==SUCCESS) { +- if ((c.v->flags & CONST_CS) && (memcmp(c.v->name, name, name_len)!=0)) { +- retval=0; +- } else { +- *result = c.v; +- retval=1; +- } +- } else { ++ if ((c.v->flags & CONST_CS) && (memcmp(c.v->name, name, name_len)!=0)) { + retval=0; ++ } else { ++ *result = c.v; ++ retval=1; + } ++ } else { ++ retval=0; + } +- free_alloca(lookup_name); +- return retval; +- } else { +- return 0; + } ++ free_alloca(lookup_name); ++ return retval; + } + + static int opt_function_exists(const char* name, int name_len TSRMLS_DC) { +- if (!EAG(encoder)) { +- char *lcname; +- char *lcfname; +- Bucket *p; +- +- lcname = estrndup(name,name_len+1); +- zend_str_tolower(lcname, name_len); +- p = module_registry.pListHead; +- while (p != NULL) { +- zend_module_entry *m = (zend_module_entry*)p->pData; +- if (m->type == MODULE_PERSISTENT) { +- zend_function_entry* f = m->functions; +- if (f != NULL) { +- while (f->fname) { +- lcfname = estrdup(f->fname); +- zend_str_tolower(lcfname, strlen(lcfname)); +- if (strcmp(lcname,lcfname) == 0) { +- efree(lcfname); +- efree(lcname); +- return 1; +- } +- efree(lcfname); +- f++; +- } ++ char *lcname; ++ char *lcfname; ++ Bucket *p; ++ ++ lcname = estrndup(name,name_len+1); ++ zend_str_tolower(lcname, name_len); ++ p = module_registry.pListHead; ++ while (p != NULL) { ++ zend_module_entry *m = (zend_module_entry*)p->pData; ++ if (m->type == MODULE_PERSISTENT) { ++ zend_function_entry* f = m->functions; ++ if (f != NULL) { ++ while (f->fname) { ++ lcfname = estrdup(f->fname); ++ zend_str_tolower(lcfname, strlen(lcfname)); ++ if (strcmp(lcname,lcfname) == 0) { ++ efree(lcfname); ++ efree(lcname); ++ return 1; ++ } ++ efree(lcfname); ++ f++; + } + } +- p = p->pListNext; + } +- efree(lcname); ++ p = p->pListNext; + } ++ efree(lcname); + return 0; + } + + static int opt_extension_loaded(const char* name, int name_len TSRMLS_DC) { +- if (!EAG(encoder)) { +- Bucket *p = module_registry.pListHead; +- while (p != NULL) { +- zend_module_entry *m = (zend_module_entry*)p->pData; +- if (m->type == MODULE_PERSISTENT && strcmp(m->name,name) == 0) { +- return 1; +- } +- p = p->pListNext; ++ Bucket *p = module_registry.pListHead; ++ while (p != NULL) { ++ zend_module_entry *m = (zend_module_entry*)p->pData; ++ if (m->type == MODULE_PERSISTENT && strcmp(m->name,name) == 0) { ++ return 1; + } ++ p = p->pListNext; + } +- return 0; + } + + static int opt_result_is_numeric(zend_op* x) { +diff -Naur a/README b/README +--- a/README 2007-05-16 21:07:31.000000000 +0200 ++++ b/README 2009-08-13 18:54:15.759128874 +0200 +@@ -19,14 +19,6 @@ + by several engines. Files that can't fit in shared memory are cached on disk + only. + +-eAccelerator contains a PHP encoder and loader. You can encode PHP scripts +-using encoder.php in order to distribute them without sources. Encoded files +-can be run on any site which runs PHP with eAccelerator. The sources of +-encoded scripts can't be restored because they are stored in a compiled form +-and the encoded version doesn't contain the source. Of course, some internals +-of the scripts can be restored with different reverse engineering tools +-(disassemblers, debuggers, etc), but it is not trivial. +- + eAccelerator is compatible with Zend Optimizer's loader. Zend Optimizer must + be installed after eAccelerator in php.ini. If you don't use scripts encoded + with Zend Encoder we do not recommend to install Zend Optimizer with |