From 76f8a944540a84b6a5c98135bd9f9e6e996fe37d Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Wed, 10 Jun 2015 15:35:56 +0200 Subject: removed hhvm code, it does not work now and wont work for the foreseeable future --- Makefile | 46 ++++------------------- hhvm/extension.cpp | 104 --------------------------------------------------- hhvm/extensionimpl.h | 56 --------------------------- hhvm/includes.h | 59 ----------------------------- hhvm/streambuf.cpp | 59 ----------------------------- hhvm/streams.cpp | 41 -------------------- 6 files changed, 7 insertions(+), 358 deletions(-) delete mode 100644 hhvm/extension.cpp delete mode 100644 hhvm/extensionimpl.h delete mode 100644 hhvm/includes.h delete mode 100644 hhvm/streambuf.cpp delete mode 100644 hhvm/streams.cpp diff --git a/Makefile b/Makefile index 57c4a93..3c64e35 100644 --- a/Makefile +++ b/Makefile @@ -68,8 +68,6 @@ VERSION = 1.4.0 PHP_SHARED_LIBRARY = libphpcpp.so.$(VERSION) PHP_STATIC_LIBRARY = libphpcpp.a.$(VERSION) -HHVM_SHARED_LIBRARY = libhhvmcpp.so.$(VERSION) -HHVM_STATIC_LIBRARY = libhhvmcpp.a.$(VERSION) # @@ -112,7 +110,6 @@ COMPILER_FLAGS = -Wall -c -std=c++11 -fvisibility=hidden -DBUILDING_PHPCPP SHARED_COMPILER_FLAGS = -fpic STATIC_COMPILER_FLAGS = PHP_COMPILER_FLAGS = ${COMPILER_FLAGS} `${PHP_CONFIG} --includes` -HHVM_COMPILER_FLAGS = ${COMPILER_FLAGS} # # Linker flags @@ -126,7 +123,6 @@ HHVM_COMPILER_FLAGS = ${COMPILER_FLAGS} LINKER_FLAGS = -shared PHP_LINKER_FLAGS = ${LINKER_FLAGS} `${PHP_CONFIG} --ldflags` -HHVM_LINKER_FLAGS = ${LINKER_FLAGS} # @@ -146,29 +142,25 @@ MKDIR = mkdir -p # The source files # # For this we use a special Makefile function that automatically scans the -# common/, zend/ and hhvm/ directories for all *.cpp files. No changes are +# common/ and zend/ directories for all *.cpp files. No changes are # probably necessary here # COMMON_SOURCES = $(wildcard common/*.cpp) PHP_SOURCES = $(wildcard zend/*.cpp) -HHVM_SOURCES = $(wildcard hhvm/*.cpp) # # The object files # # The intermediate object files are generated by the compiler right before -# the linker turns all these object files into the libphpcpp.so and -# libhhvmcpp.so shared libraries. We also use a Makefile function here that -# takes all source files. +# the linker turns all these object files into the libphpcpp.so shared +# library. We also use a Makefile function here that takes all source files. # COMMON_SHARED_OBJECTS = $(COMMON_SOURCES:%.cpp=shared/%.o) PHP_SHARED_OBJECTS = $(PHP_SOURCES:%.cpp=shared/%.o) -HHVM_SHARED_OBJECTS = $(HHVM_SOURCES:%.cpp=shared/%.o) COMMON_STATIC_OBJECTS = $(COMMON_SOURCES:%.cpp=static/%.o) PHP_STATIC_OBJECTS = $(PHP_SOURCES:%.cpp=static/%.o) -HHVM_STATIC_OBJECTS = $(HHVM_SOURCES:%.cpp=static/%.o) # @@ -188,35 +180,23 @@ phpcpp: ${PHP_SHARED_LIBRARY} ${PHP_STATIC_LIBRARY} @echo @echo "Build complete." -hhvmcpp: ${HHVM_SHARED_LIBRARY} ${PHP_STATIC_LIBRARY} - @echo - @echo "Build complete." - ${PHP_SHARED_LIBRARY}: shared_directories ${COMMON_SHARED_OBJECTS} ${PHP_SHARED_OBJECTS} ${LINKER} ${PHP_LINKER_FLAGS} -Wl,-soname,libphpcpp.so.$(SONAME) -o $@ ${COMMON_SHARED_OBJECTS} ${PHP_SHARED_OBJECTS} ${PHP_STATIC_LIBRARY}: static_directories ${COMMON_STATIC_OBJECTS} ${PHP_STATIC_OBJECTS} ${ARCHIVER} $@ ${COMMON_STATIC_OBJECTS} ${PHP_STATIC_OBJECTS} -${HHVM_SHARED_LIBRARY}: shared_directories ${COMMON_SHARED_OBJECTS} ${HHVM_SHARED_OBJECTS} - ${LINKER} ${HHVM_LINKER_FLAGS} -Wl,-soname,libhhvmcpp.so.$(SONAME) -o $@ ${COMMON_SHARED_OBJECTS} ${HHVM_SHARED_OBJECTS} - -${HHVM_STATIC_LIBRARY}: static_directories ${COMMON_STATIC_OBJECTS} ${HHVM_STATIC_OBJECTS} - ${ARCHIVER} $@ ${COMMON_STATIC_OBJECTS} ${HHVM_STATIC_OBJECTS} - shared_directories: ${MKDIR} shared/common ${MKDIR} shared/zend - ${MKDIR} shared/hhvm static_directories: ${MKDIR} static/common ${MKDIR} static/zend - ${MKDIR} static/hhvm clean: - ${RM} shared ${PHP_SHARED_LIBRARY} ${HHVM_SHARED_LIBRARY} - ${RM} static ${PHP_STATIC_LIBRARY} ${HHVM_STATIC_LIBRARY} + ${RM} shared ${PHP_SHARED_LIBRARY} + ${RM} static ${PHP_STATIC_LIBRARY} find -name *.o | xargs ${RM} ${COMMON_SHARED_OBJECTS}: @@ -231,11 +211,6 @@ ${PHP_SHARED_OBJECTS}: ${PHP_STATIC_OBJECTS}: ${COMPILER} ${PHP_COMPILER_FLAGS} ${STATIC_COMPILER_FLAGS} -o $@ ${@:static/%.o=%.cpp} -${HHVM_SHARED_OBJECTS}: - ${COMPILER} ${HHVM_COMPILER_FLAGS} ${SHARED_COMPILER_FLAGS} -o $@ ${@:shared/%.o=%.cpp} - -${HHVM_STATIC_OBJECTS}: - ${COMPILER} ${HHVM_COMPILER_FLAGS} ${STATIC_COMPILER_FLAGS} -o $@ ${@:static/%.o=%.cpp} # The if statements below must be seen as single line by make @@ -251,16 +226,9 @@ install: if [ -e ${PHP_STATIC_LIBRARY} ]; then ${CP} ${PHP_STATIC_LIBRARY} ${INSTALL_LIB}/; \ ${LN} ${INSTALL_LIB}/${PHP_STATIC_LIBRARY} ${INSTALL_LIB}/libphpcpp.a; \ fi - if [ -e ${HHVM_SHARED_LIBRARY} ]; then \ - ${CP} ${HHVM_SHARED_LIBRARY} ${INSTALL_LIB}/; \ - ${LN} ${INSTALL_LIB}/${HHVM_SHARED_LIBRARY} ${INSTALL_LIB}/libhhvmcpp.so.$(SONAME);\ - ${LN} ${INSTALL_LIB}/${HHVM_SHARED_LIBRARY} ${INSTALL_LIB}/libhhvmcpp.so; \ - fi - if [ -e ${HHVM_STATIC_LIBRARY} ]; then \ - ${CP} ${HHVM_STATIC_LIBRARY} ${INSTALL_LIB}/; \ - ${LN} ${INSTALL_LIB}/${HHVM_STATIC_LIBRARY} ${INSTALL_LIB}/libhhvmcpp.a; \ + if `which ldconfig`; then \ + sudo ldconfig; \ fi - sudo ldconfig test: mkdir -p tests/include/zts/phpcpp diff --git a/hhvm/extension.cpp b/hhvm/extension.cpp deleted file mode 100644 index 97fdaed..0000000 --- a/hhvm/extension.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Extension.cpp - * - * @author Emiel Bruijntjes - * @copyright 2013, 2014, 2015 Copernica BV - */ -#include "includes.h" - -/** - * Set up namespace - */ -namespace Php { - -/** - * Constructor that defines a number of functions right away - * @param name Extension name - * @param version Extension version string - * @param apiversion The API version number - */ -Extension::Extension(const char *name, const char *version, int apiversion) : - Namespace(""), _impl(new ExtensionImpl(this, name, version, apiversion)) {} - -/** - * Destructor - */ -Extension::~Extension() -{ - // get rid of the implementation object - delete _impl; -} - -/** - * Register a function to be called when the PHP engine is ready - * @param callback - * @return Extension - */ -Extension &Extension::onStartup(const Callback &callback) -{ - // pass on to the implementation - _impl->onStartup(callback); - - // allow chaining - return *this; -} - -/** - * Register a function to be called when the PHP engine is going to stop - * @param callback - * @return Extension - */ -Extension &Extension::onShutdown(const Callback &callback) -{ - // pass on to the implementation - _impl->onShutdown(callback); - - // allow chaining - return *this; -} - -/** - * Register a callback that is called at the beginning of each pageview/request - * @param callback - */ -Extension &Extension::onRequest(const Callback &callback) -{ - // pass on to the implementation - _impl->onRequest(callback); - - // allow chaining - return *this; -} - -/** - * Register a callback that is called to cleanup things after a pageview/request - * @param callback - */ -Extension &Extension::onIdle(const Callback &callback) -{ - // pass on to the implementation - _impl->onIdle(callback); - - // allow chaining - return *this; -} - -/** - * Retrieve the module pointer - * - * This is the memory address that should be exported by the get_module() - * function. - * - * @return void* - */ -void *Extension::module() -{ - // pass on to the implementation - return _impl->module(); -} - -/** - * End of namespace - */ -} - diff --git a/hhvm/extensionimpl.h b/hhvm/extensionimpl.h deleted file mode 100644 index 3444f8b..0000000 --- a/hhvm/extensionimpl.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * ExtensionImpl.h - * - * Implementation of the extension object for the HHVM engine - * - * @author Emiel Bruijntjes - * @copyright 2014 Copernica BV - */ - -/** - * Namespace - */ -namespace Php { - -/** - * Class definition - */ -class ExtensionImpl : public ExtensionBase -{ -private: - /** - * Pointer to the extension object that is filled by the extension programmer - * @var Extension - */ - Extension *_data; - -public: - /** - * Constructor - * @param data Pointer to the extension object created by the extension programmer - * @param name Name of the extension - * @param version Version identifier of the extension - * @param apiversion API version number - */ - ExtensionImpl(Extension *data, const char *name, const char *version, int apiversion) : ExtensionBase(data) {} - - /** - * Destructor - */ - virtual ~ExtensionImpl() {} - - /** - * Pointer to the module that is loaded by HHVM - * @return void* - */ - void *module() - { - return nullptr; - } -}; - -/** - * End of namespace - */ -} - diff --git a/hhvm/includes.h b/hhvm/includes.h deleted file mode 100644 index 191e390..0000000 --- a/hhvm/includes.h +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Includes.h - * - * All includes for compiling the HHVM implementation of PHP-CPP - * - * @author Emiel Bruijntjes - * @copyright 2014 Copernica BV - */ - -/** - * Standard C and C++ libraries - */ -#include -#include -#include -#include -#include -#include -#include -#include - -/** - * HHVM includes - */ - - -/** - * Public include files - */ -#include "../include/version.h" -#include "../include/type.h" -#include "../include/hashparent.h" -#include "../include/ini.h" -#include "../include/inivalue.h" -#include "../include/value.h" -#include "../include/parameters.h" -#include "../include/classtype.h" -#include "../include/argument.h" -#include "../include/modifiers.h" -#include "../include/classbase.h" -#include "../include/interface.h" -#include "../include/iterator.h" -#include "../include/traversable.h" -#include "../include/serializable.h" -#include "../include/class.h" -#include "../include/namespace.h" -#include "../include/extension.h" - -/** - * Generic implementation header files - */ -#include "../common/extensionbase.h" -#include "../common/streambuf.h" - -/** - * Specific HHVM header files for the implementation only - */ -#include "extensionimpl.h" - diff --git a/hhvm/streambuf.cpp b/hhvm/streambuf.cpp deleted file mode 100644 index 805fc0f..0000000 --- a/hhvm/streambuf.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/** - * StreamBuf.cpp - * - * Implementation file for the StreamBuf class - * - * @see http://www.mr-edd.co.uk/blog/beginners_guide_streambuf - * - * @author Emiel Bruijntjes - * @copyright 2014 Copernica BV - */ -#include "includes.h" - -/** - * Set up namespace - */ -namespace Php { - -/** - * Called when the internal buffer should be synchronized - * @return int - */ -int StreamBuf::sync() -{ - // current buffer size - size_t size = pptr() - pbase(); - - // is this the error stream or the regular output stream? - if (_error) - { - // write to error (the zend_error() method is a varargs function, - // which means that we have to include a printf() like format as first - // parameter. We can not specify pbase() directly, because (1) it is - // not null terminated and (2) it could contain % signs and allow all - // sorts of buffer overflows. - - // @todo hhvm implementation - -// zend_error(_error, "%.*s", (int)size, pbase()); - - } - else - { - // @todo hhvm implementation - - // write to zend -// zend_write(pbase(), size); - } - - // reset the buffer - pbump(-size); - - // done - return 0; -} - -/** - * End namespace - */ -} diff --git a/hhvm/streams.cpp b/hhvm/streams.cpp deleted file mode 100644 index de327e2..0000000 --- a/hhvm/streams.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Streams.cpp - * - * Implementation of the streams - * - * @author Emiel Bruijntjes - * @copyright 2014 Copernica BV - */ -#include "includes.h" - -/** - * Set up namespace - */ -namespace Php { - -/** - * Some static buffers for writing data - * @var StreamBuf - */ -// @todo find the right constants -static StreamBuf bufOut (0); -static StreamBuf bufError (0); //E_ERROR); -static StreamBuf bufWarning (0); //E_WARNING); -static StreamBuf bufNotice (0); //E_NOTICE); -static StreamBuf bufDeprecated (0); //E_DEPRECATED); - -/** - * Create the actual steams - * @var std::ostream - */ -std::ostream out (&bufOut); -std::ostream error (&bufError); -std::ostream warning (&bufWarning); -std::ostream notice (&bufNotice); -std::ostream deprecated (&bufDeprecated); - -/** - * End namespace - */ -} - -- cgit v1.2.3