Skip to content

Commit

Permalink
First commit of AmfExt (PHP 5.3.3)
Browse files Browse the repository at this point in the history
  • Loading branch information
protetore committed Jan 13, 2013
1 parent 908b18a commit 1661b42
Show file tree
Hide file tree
Showing 53 changed files with 83,083 additions and 0 deletions.
Empty file added .deps
Empty file.
1 change: 1 addition & 0 deletions CREDITS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Emanuele Ruffaldi
107 changes: 107 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
2008-07-17 Emanuele Ruffaldi <[email protected]>
version 0.9.1
- fixed pecl bug 12668 on anonymous serialization

2007-02-21 Emanuele Ruffaldi <[email protected]>
version 0.9
- added "version" in "serverInfo" for AM0 while sending recordset
- charset handling

2007-02-20 Emanuele Ruffaldi <[email protected]>
- cleaned comments, AMF_DEALLOC macro and if

2007-02-18 Emanuele Ruffaldi <[email protected]>
- added "version" in "serverInfo" for AM0 while sending recordset

2007-02-16 Emanuele Ruffaldi <[email protected]>
version 0.9
- changed back the callback
- fixed reference issue in callback, caused by callback function with &

2007-02-14 Emanuele Ruffaldi <[email protected]>
- finished implementation of the charset handling
- small test with testCharset
- fixed all tests with the new serialization callback
- added AMF_TRANSLATE_CHARSET_NOASCII in decoding to skip UTF8 that are US-ASCII (that is lower than 0x7F):
UTF-8, ISO-8859-1 have the first part in common to US-ASCII

AMF_TRANSLATE_CHARSET_NOASCII cannot be used in encoding Big5
Big5 is double byte: first byte is ASCII or in 0x81-0xFE, second in 0x40 to 0x7e, 0xa1 to 0xfe
Shift_JIS is double byte: first byte is is ASCII (with exception) or over, second can be low or high


2007-02-13 Emanuele Ruffaldi <[email protected]>
- initial implementation of the charset handling.
- TODO: check the use of shared
- TODO: check the new scheme for encoding callback
- TODO: check the use of raw

2007-02-08 Emanuele Ruffaldi <[email protected]>
version 0.8.9
- added AMF_TRANSLATE_CHARSET flag, AMFE_TRANSLATE_CHARSET event and added event to the callback
for supporting different charsets. Changes have been applied to: amf3_write_string,amf3_write_string_zval
amf0_serialize_string,amf0_serialize_zstring,amf0_write_string. In AMF3 the transliteration is performed
AFTER the cache check. TODOOOOO!

2007-02-01 Emanuele Ruffaldi <[email protected]>
version 0.8.8
- StringBuilder as resource
- AMF_AS_STRING_BUILDER in amf_encode for returing a StringBuilder resource
- fixed bug in the amf4.dsp creating bad PHP4 modules

2007-01-27 Emanuele Ruffaldi <[email protected]>
- removed warning in linux build

2007-01-20 Emanuele Ruffaldi <[email protected]>
version 0.8.7
- fixed encoding of private member variables

2007-01-13 Emanuele Ruffaldi <[email protected]>

- fixed head of AMF3_OBJECT that was written as byte
- fixed case of rows shorter than columns in recordset

2007-01-12 Emanuele Ruffaldi <[email protected]>
version 0.8.5 and change name to AMF
- fixed IS_ARRAY

2007-01-11 Emanuele Ruffaldi <[email protected]>
version: 0.8.3
- added AMFC_BYTEARRAY in encoding callback for encoding ByteArray
- added AMFE_BYTEARRAY for decoding ByteArray as a callback
- no more AMFE_MAP for objects with empty classname

2007-01-08 Emanuele Ruffaldi <[email protected]>
- added phpinfo
- added nextStringIndex for future optimized zval lookup
-
- fixed caching of zval with handling of is_ref

2007-01-07 Emanuele Ruffaldi <[email protected]>
- fixed return of classname from encoding callback
- added __amfphp_recordset__ for AMF0 exposing it as RecordSet object
- fixed array count in decoding array

2007-01-06 Emanuele Ruffaldi <[email protected]>

- arrays inited to
- stdclass class is mapped to anonymous object in AMF3
- added AMFE_POST_XML
- added AMFE_MAP_EXTERNABLIZABLE
- negative integer keys

2007-01-05 Emanuele Ruffaldi <[email protected]>

- added support for resources
- fixed type check in encoding callbacks
- added documentation
- cleaned numeric string array test

2007-01-02 Emanuele Ruffaldi <[email protected]>
- optimized encoding by replacing smart_str with chunked string builder
- fixed arrays in AMF3
- corrected reference counts

2006-12-27 Emanuele Ruffaldi <[email protected]>

- Initial version
21 changes: 21 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@


Windows
====================

For PHP4 use windows\php4\php_amf.dll and copy into ext folder of PHP
For PHP5 use windows\php5\php_amf.dll and copy into ext folder of PHP

Then update the php.ini with the line

extension=php_amf.dll


Linux/Others
====================

Build from sources and copy the amf.so library into the
ext folder of PHP (typically /usr/lib/php/modules).
The update php.ini under /etc

extension=amf.so
68 changes: 68 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
--------------------------------------------------------------------
The PHP License, version 3.01
Copyright (c) 1999 - 2006 The PHP Group. All rights reserved.
--------------------------------------------------------------------

Redistribution and use in source and binary forms, with or without
modification, is permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.

3. The name "PHP" must not be used to endorse or promote products
derived from this software without prior written permission. For
written permission, please contact [email protected].

4. Products derived from this software may not be called "PHP", nor
may "PHP" appear in their name, without prior written permission
from [email protected]. You may indicate that your software works in
conjunction with PHP by saying "Foo for PHP" instead of calling
it "PHP Foo" or "phpfoo"

5. The PHP Group may publish revised and/or new versions of the
license from time to time. Each version will be given a
distinguishing version number.
Once covered code has been published under a particular version
of the license, you may always continue to use it under the terms
of that version. You may also choose to use such covered code
under the terms of any subsequent version of the license
published by the PHP Group. No one other than the PHP Group has
the right to modify the terms applicable to covered code created
under this License.

6. Redistributions of any form whatsoever must retain the following
acknowledgment:
"This product includes PHP software, freely available from
<http://www.php.net/software/>".

THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND
ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP
DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.

--------------------------------------------------------------------

This software consists of voluntary contributions made by many
individuals on behalf of the PHP Group.

The PHP Group can be contacted via Email at [email protected].

For more information on the PHP Group and the PHP project,
please see <http://www.php.net>.

PHP includes the Zend Engine, freely available at
<http://www.zend.com>.
172 changes: 172 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
srcdir = /var/devtools/amfext
builddir = /var/devtools/amfext
top_srcdir = /var/devtools/amfext
top_builddir = /var/devtools/amfext
EGREP = /bin/grep -E
SED = /bin/sed
CONFIGURE_COMMAND = './configure' '--enable-amf'
CONFIGURE_OPTIONS = '--enable-amf'
SHLIB_SUFFIX_NAME = so
SHLIB_DL_SUFFIX_NAME = so
ZEND_EXT_TYPE = zend_extension
RE2C = exit 0;
AWK = nawk
shared_objects_amf = amf.lo
PHP_PECL_EXTENSION = amf
AMF_SHARED_LIBADD =
PHP_MODULES = $(phplibdir)/amf.la
PHP_ZEND_EX =
all_targets = $(PHP_MODULES) $(PHP_ZEND_EX)
install_targets = install-modules install-headers
prefix = /usr
exec_prefix = $(prefix)
libdir = ${exec_prefix}/lib
prefix = /usr
phplibdir = /var/devtools/amfext/modules
phpincludedir = /usr/include/php5
CC = cc
CFLAGS = -g -O2
CFLAGS_CLEAN = $(CFLAGS)
CPP = cc -E
CPPFLAGS = -DHAVE_CONFIG_H
CXX =
CXXFLAGS =
CXXFLAGS_CLEAN = $(CXXFLAGS)
EXTENSION_DIR = /usr/lib/php5/20090626
PHP_EXECUTABLE = /usr/bin/php
EXTRA_LDFLAGS =
EXTRA_LIBS =
INCLUDES = -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib
LFLAGS =
LDFLAGS =
SHARED_LIBTOOL =
LIBTOOL = $(SHELL) $(top_builddir)/libtool
SHELL = /bin/bash
INSTALL_HEADERS =
mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
INSTALL = $(top_srcdir)/build/shtool install -c
INSTALL_DATA = $(INSTALL) -m 644

DEFS = -DPHP_ATOM_INC -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir)
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH)

all: $(all_targets)
@echo
@echo "Build complete."
@echo "Don't forget to run 'make test'."
@echo

build-modules: $(PHP_MODULES) $(PHP_ZEND_EX)

libphp$(PHP_MAJOR_VERSION).la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@
-@$(LIBTOOL) --silent --mode=install cp $@ $(phptempdir)/$@ >/dev/null 2>&1

libs/libphp$(PHP_MAJOR_VERSION).bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
$(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp$(PHP_MAJOR_VERSION).so

install: $(all_targets) $(install_targets)

install-sapi: $(OVERALL_TARGET)
@echo "Installing PHP SAPI module: $(PHP_SAPI)"
-@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
-@if test ! -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME); then \
for i in 0.0.0 0.0 0; do \
if test -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME).$$i; then \
$(LN_S) $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME).$$i $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME); \
break; \
fi; \
done; \
fi
@$(INSTALL_IT)

install-modules: build-modules
@test -d modules && \
$(mkinstalldirs) $(INSTALL_ROOT)$(EXTENSION_DIR)
@echo "Installing shared extensions: $(INSTALL_ROOT)$(EXTENSION_DIR)/"
@rm -f modules/*.la >/dev/null 2>&1
@$(INSTALL) modules/* $(INSTALL_ROOT)$(EXTENSION_DIR)

install-headers:
-@if test "$(INSTALL_HEADERS)"; then \
for i in `echo $(INSTALL_HEADERS)`; do \
i=`$(top_srcdir)/build/shtool path -d $$i`; \
paths="$$paths $(INSTALL_ROOT)$(phpincludedir)/$$i"; \
done; \
$(mkinstalldirs) $$paths && \
echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \
for i in `echo $(INSTALL_HEADERS)`; do \
if test "$(PHP_PECL_EXTENSION)"; then \
src=`echo $$i | $(SED) -e "s#ext/$(PHP_PECL_EXTENSION)/##g"`; \
else \
src=$$i; \
fi; \
if test -f "$(top_srcdir)/$$src"; then \
$(INSTALL_DATA) $(top_srcdir)/$$src $(INSTALL_ROOT)$(phpincludedir)/$$i; \
elif test -f "$(top_builddir)/$$src"; then \
$(INSTALL_DATA) $(top_builddir)/$$src $(INSTALL_ROOT)$(phpincludedir)/$$i; \
else \
(cd $(top_srcdir)/$$src && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i; \
cd $(top_builddir)/$$src && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i) 2>/dev/null || true; \
fi \
done; \
fi

PHP_TEST_SETTINGS = -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1'
PHP_TEST_SHARED_EXTENSIONS = ` \
if test "x$(PHP_MODULES)" != "x"; then \
for i in $(PHP_MODULES)""; do \
. $$i; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
done; \
fi; \
if test "x$(PHP_ZEND_EX)" != "x"; then \
for i in $(PHP_ZEND_EX)""; do \
. $$i; $(top_srcdir)/build/shtool echo -n -- " -d $(ZEND_EXT_TYPE)=$(top_builddir)/modules/$$dlname"; \
done; \
fi`
PHP_DEPRECATED_DIRECTIVES_REGEX = '^(define_syslog_variables|register_(globals|long_arrays)?|safe_mode|magic_quotes_(gpc|runtime|sybase)?|(zend_)?extension(_debug)?(_ts)?)[\t\ ]*='
test: all
-@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
INI_FILE=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r 'echo php_ini_loaded_file();' 2> /dev/null`; \
if test "$$INI_FILE"; then \
$(EGREP) -h -v $(PHP_DEPRECATED_DIRECTIVES_REGEX) "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
else \
echo > $(top_builddir)/tmp-php.ini; \
fi; \
INI_SCANNED_PATH=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r '$$a = explode(",\n", trim(php_ini_scanned_files())); echo $$a[0];' 2> /dev/null`; \
if test "$$INI_SCANNED_PATH"; then \
INI_SCANNED_PATH=`$(top_srcdir)/build/shtool path -d $$INI_SCANNED_PATH`; \
$(EGREP) -h -v $(PHP_DEPRECATED_DIRECTIVES_REGEX) "$$INI_SCANNED_PATH"/*.ini >> $(top_builddir)/tmp-php.ini; \
fi; \
TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \
TEST_PHP_SRCDIR=$(top_srcdir) \
CC="$(CC)" \
$(PHP_EXECUTABLE) -n -c $(top_builddir)/tmp-php.ini $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -n -c $(top_builddir)/tmp-php.ini -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
rm $(top_builddir)/tmp-php.ini; \
else \
echo "ERROR: Cannot run tests without CLI sapi."; \
fi
clean:
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*
distclean: clean
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp
$(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f
.PHONY: all clean install distclean test
.NOEXPORT:
$(phplibdir)/amf.la: ./amf.la
$(LIBTOOL) --mode=install cp ./amf.la $(phplibdir)
./amf.la: $(shared_objects_amf) $(AMF_SHARED_DEPENDENCIES)
$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_amf) $(AMF_SHARED_LIBADD)
amf.lo: /var/devtools/amfext/amf.c
$(LIBTOOL) --mode=compile $(CC) -I. -I/var/devtools/amfext $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -c /var/devtools/amfext/amf.c -o amf.lo
Empty file added Makefile.fragments
Empty file.
Loading

0 comments on commit 1661b42

Please sign in to comment.