From 3d0e061845312a4554bd7f6a1352872d5b9a8e92 Mon Sep 17 00:00:00 2001
From: Maxim Leontyev
Date: Thu, 20 Dec 2018 11:02:36 +0400
Subject: [PATCH 1/6] Cmake: joined phpcpp-common and phpcpp libraries in
single library to be able to use it statically in linux
---
CMakeLists.txt | 207 ++++++++-----------------------------------------
1 file changed, 33 insertions(+), 174 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d05d87fb..a16c109b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,9 +11,9 @@ PROJECT(phpcpp)
LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR})
IF(CMAKE_BUILD_TYPE MATCHES DEBUG)
- ADD_DEFINITIONS(-DZEND_DEBUG=1)
+ ADD_DEFINITIONS(-DZEND_DEBUG=1)
ELSE()
- ADD_DEFINITIONS(-DZEND_DEBUG=0)
+ ADD_DEFINITIONS(-DZEND_DEBUG=0)
ENDIF()
IF (PHPCPP_COMPILE_TS)
@@ -54,13 +54,13 @@ IF (MSVC)
ENDIF ()
INCLUDE_DIRECTORIES(
- "${PHPCPP_PHP_PATH}/"
- "${PHPCPP_PHP_PATH}/main"
- "${PHPCPP_PHP_PATH}/Zend"
- "${PHPCPP_PHP_PATH}/TSRM"
- "${PHPCPP_PHP_PATH}/ext"
- "${PHPCPP_PHP_PATH}/build/main"
- "${PHPCPP_PHP_PATH}/build/Zend"
+ "${PHPCPP_PHP_PATH}/"
+ "${PHPCPP_PHP_PATH}/main"
+ "${PHPCPP_PHP_PATH}/Zend"
+ "${PHPCPP_PHP_PATH}/TSRM"
+ "${PHPCPP_PHP_PATH}/ext"
+ "${PHPCPP_PHP_PATH}/build/main"
+ "${PHPCPP_PHP_PATH}/build/Zend"
)
SET(PHP_LIBS "php")
SET(PHP_LIB_PATH "")
@@ -87,179 +87,38 @@ ELSE()
ENDIF()
ENDIF()
-SET(PHPCPP_COMMON_SOURCES
- common/modifiers.cpp
- common/streambuf.cpp
-)
-
-SET(PHPCPP_COMMON_HEADERS
- common/extensionbase.h
- common/includes.h
- common/streambuf.h
-)
-
-ADD_LIBRARY(phpcpp-common STATIC
- ${PHPCPP_COMMON_HEADERS}
- ${PHPCPP_COMMON_SOURCES}
-)
-
-set_target_properties(phpcpp-common
- PROPERTIES
- ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
- LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
- RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
-)
+FILE(GLOB PHPCPP_COMMON_SOURCES common/*.cpp)
+FILE(GLOB PHPCPP_COMMON_HEADERS common/*.h)
+FILE(GLOB PHPCPP_ZEND_SOURCES zend/*.cpp)
+FILE(GLOB PHPCPP_ZEND_HEADERS zend/*.h)
+FILE(GLOB PHPCPP_HEADERS_INCLUDE include/*.h)
-SET(PHPCPP_ZEND_SOURCES
- zend/base.cpp
- zend/callable.cpp
- zend/classbase.cpp
- zend/classimpl.cpp
- zend/constant.cpp
- zend/constantfuncs.cpp
- zend/eval.cpp
- zend/exception_handler.cpp
- zend/exists.cpp
- zend/extension.cpp
- zend/extensionimpl.cpp
- zend/fatalerror.cpp
- zend/file.cpp
- zend/function.cpp
- zend/functor.cpp
- zend/global.cpp
- zend/globals.cpp
- zend/hashmember.cpp
- zend/ini.cpp
- zend/inivalue.cpp
- zend/iteratorimpl.cpp
- zend/members.cpp
- zend/module.cpp
- zend/namespace.cpp
- zend/object.cpp
- zend/sapi.cpp
- zend/script.cpp
- zend/streambuf.cpp
- zend/streams.cpp
- zend/super.cpp
- zend/value.cpp
- zend/valueiterator.cpp
- zend/zendcallable.cpp
- zend/zval.cpp
-)
-
-SET(PHPCPP_ZEND_HEADERS
- zend/arithmetic.h
- zend/boolmember.h
- zend/callable.h
- zend/classimpl.h
- zend/compileroptions.h
- zend/constantimpl.h
- zend/delayedfree.h
- zend/executestate.h
- zend/extensionimpl.h
- zend/extensionpath.h
- zend/floatmember.h
- zend/functor.h
- zend/hashiterator.h
- zend/includes.h
- zend/init.h
- zend/invaliditerator.h
- zend/iteratorimpl.h
- zend/lowercase.h
- zend/member.h
- zend/method.h
- zend/module.h
- zend/nativefunction.h
- zend/notimplemented.h
- zend/nullmember.h
- zend/numericmember.h
- zend/objectimpl.h
- zend/opcodes.h
- zend/origexception.h
- zend/parametersimpl.h
- zend/property.h
- zend/string.h
- zend/stringmember.h
- zend/symbol.h
- zend/symbol.h
- zend/traverseiterator.h
- zend/valueiteratorimpl.h
-)
-
-SET(PHPCPP_HEADERS_INCLUDE
- include/argument.h
- include/array.h
- include/arrayaccess.h
- include/base.h
- include/byref.h
- include/byval.h
- include/call.h
- include/class.h
- include/classbase.h
- include/classtype.h
- include/constant.h
- include/countable.h
- include/deprecated.h
- include/errors.h
- include/exception.h
- include/extension.h
- include/fatalerror.h
- include/file.h
- include/function.h
- include/global.h
- include/globals.h
- include/hashmember.h
- include/hashparent.h
- include/ini.h
- include/inivalue.h
- include/interface.h
- include/iterator.h
- include/modifiers.h
- include/namespace.h
- include/noexcept.h
- include/object.h
- include/parameters.h
- include/platform.h
- include/script.h
- include/serializable.h
- include/streams.h
- include/super.h
- include/thread_local.h
- include/traversable.h
- include/type.h
- include/value.h
- include/valueiterator.h
- include/version.h
- include/visibility.h
- include/zendcallable.h
- include/zval.h
-)
LINK_DIRECTORIES(${PHP_LIB_PATH})
IF (PHPCPP_SHARED)
ADD_LIBRARY(phpcpp SHARED
- ${PHPCPP_HEADERS_INCLUDE}
- ${PHPCPP_ZEND_HEADERS}
- ${PHPCPP_ZEND_SOURCES}
- phpcpp.h
- )
-
- TARGET_LINK_LIBRARIES(phpcpp phpcpp-common ${PHP_LIBS})
+ ${PHPCPP_COMMON_HEADERS}
+ ${PHPCPP_COMMON_SOURCES}
+ ${PHPCPP_HEADERS_INCLUDE}
+ ${PHPCPP_ZEND_HEADERS}
+ ${PHPCPP_ZEND_SOURCES}
+ phpcpp.h
+ )
ELSE()
ADD_LIBRARY(phpcpp STATIC
- ${PHPCPP_HEADERS_INCLUDE}
- ${PHPCPP_ZEND_HEADERS}
- ${PHPCPP_ZEND_SOURCES}
- phpcpp.h
- )
-
- TARGET_LINK_LIBRARIES(phpcpp STATIC phpcpp-common ${PHP_LIBS})
+ ${PHPCPP_COMMON_HEADERS}
+ ${PHPCPP_COMMON_SOURCES}
+ ${PHPCPP_HEADERS_INCLUDE}
+ ${PHPCPP_ZEND_HEADERS}
+ ${PHPCPP_ZEND_SOURCES}
+ phpcpp.h
+ )
ENDIF()
SET_TARGET_PROPERTIES(phpcpp
- PROPERTIES
- ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
- LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
- RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
-)
+ PROPERTIES
+ ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
+ LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
+ )
From 33be76fc5c404aff98c881926be63da8445d4ba2 Mon Sep 17 00:00:00 2001
From: Maxim Leontyev
Date: Thu, 20 Dec 2018 11:04:41 +0400
Subject: [PATCH 2/6] Move headers to be able to use without installation
---
CMakeLists.txt | 2 +-
Makefile | 2 +-
include/{ => phpcpp}/argument.h | 0
include/{ => phpcpp}/array.h | 0
include/{ => phpcpp}/arrayaccess.h | 0
include/{ => phpcpp}/base.h | 0
include/{ => phpcpp}/byref.h | 0
include/{ => phpcpp}/byval.h | 0
include/{ => phpcpp}/call.h | 0
include/{ => phpcpp}/class.h | 0
include/{ => phpcpp}/classbase.h | 0
include/{ => phpcpp}/classtype.h | 0
include/{ => phpcpp}/constant.h | 0
include/{ => phpcpp}/countable.h | 0
include/{ => phpcpp}/deprecated.h | 0
include/{ => phpcpp}/errors.h | 0
include/{ => phpcpp}/exception.h | 0
include/{ => phpcpp}/extension.h | 0
include/{ => phpcpp}/fatalerror.h | 0
include/{ => phpcpp}/file.h | 0
include/{ => phpcpp}/function.h | 0
include/{ => phpcpp}/global.h | 0
include/{ => phpcpp}/globals.h | 0
include/{ => phpcpp}/hashmember.h | 0
include/{ => phpcpp}/hashparent.h | 0
include/{ => phpcpp}/ini.h | 0
include/{ => phpcpp}/inivalue.h | 0
include/{ => phpcpp}/interface.h | 0
include/{ => phpcpp}/iterator.h | 0
include/{ => phpcpp}/modifiers.h | 0
include/{ => phpcpp}/namespace.h | 0
include/{ => phpcpp}/noexcept.h | 0
include/{ => phpcpp}/object.h | 0
include/{ => phpcpp}/parameters.h | 0
include/{ => phpcpp}/platform.h | 0
include/{ => phpcpp}/script.h | 0
include/{ => phpcpp}/serializable.h | 0
include/{ => phpcpp}/streams.h | 0
include/{ => phpcpp}/super.h | 0
include/{ => phpcpp}/thread_local.h | 0
include/{ => phpcpp}/traversable.h | 0
include/{ => phpcpp}/type.h | 0
include/{ => phpcpp}/value.h | 0
include/{ => phpcpp}/valueiterator.h | 0
include/{ => phpcpp}/version.h | 0
include/{ => phpcpp}/visibility.h | 0
include/{ => phpcpp}/zendcallable.h | 0
include/{ => phpcpp}/zval.h | 0
48 files changed, 2 insertions(+), 2 deletions(-)
rename include/{ => phpcpp}/argument.h (100%)
rename include/{ => phpcpp}/array.h (100%)
rename include/{ => phpcpp}/arrayaccess.h (100%)
rename include/{ => phpcpp}/base.h (100%)
rename include/{ => phpcpp}/byref.h (100%)
rename include/{ => phpcpp}/byval.h (100%)
rename include/{ => phpcpp}/call.h (100%)
rename include/{ => phpcpp}/class.h (100%)
rename include/{ => phpcpp}/classbase.h (100%)
rename include/{ => phpcpp}/classtype.h (100%)
rename include/{ => phpcpp}/constant.h (100%)
rename include/{ => phpcpp}/countable.h (100%)
rename include/{ => phpcpp}/deprecated.h (100%)
rename include/{ => phpcpp}/errors.h (100%)
rename include/{ => phpcpp}/exception.h (100%)
rename include/{ => phpcpp}/extension.h (100%)
rename include/{ => phpcpp}/fatalerror.h (100%)
rename include/{ => phpcpp}/file.h (100%)
rename include/{ => phpcpp}/function.h (100%)
rename include/{ => phpcpp}/global.h (100%)
rename include/{ => phpcpp}/globals.h (100%)
rename include/{ => phpcpp}/hashmember.h (100%)
rename include/{ => phpcpp}/hashparent.h (100%)
rename include/{ => phpcpp}/ini.h (100%)
rename include/{ => phpcpp}/inivalue.h (100%)
rename include/{ => phpcpp}/interface.h (100%)
rename include/{ => phpcpp}/iterator.h (100%)
rename include/{ => phpcpp}/modifiers.h (100%)
rename include/{ => phpcpp}/namespace.h (100%)
rename include/{ => phpcpp}/noexcept.h (100%)
rename include/{ => phpcpp}/object.h (100%)
rename include/{ => phpcpp}/parameters.h (100%)
rename include/{ => phpcpp}/platform.h (100%)
rename include/{ => phpcpp}/script.h (100%)
rename include/{ => phpcpp}/serializable.h (100%)
rename include/{ => phpcpp}/streams.h (100%)
rename include/{ => phpcpp}/super.h (100%)
rename include/{ => phpcpp}/thread_local.h (100%)
rename include/{ => phpcpp}/traversable.h (100%)
rename include/{ => phpcpp}/type.h (100%)
rename include/{ => phpcpp}/value.h (100%)
rename include/{ => phpcpp}/valueiterator.h (100%)
rename include/{ => phpcpp}/version.h (100%)
rename include/{ => phpcpp}/visibility.h (100%)
rename include/{ => phpcpp}/zendcallable.h (100%)
rename include/{ => phpcpp}/zval.h (100%)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a16c109b..db912ff3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -91,7 +91,7 @@ FILE(GLOB PHPCPP_COMMON_SOURCES common/*.cpp)
FILE(GLOB PHPCPP_COMMON_HEADERS common/*.h)
FILE(GLOB PHPCPP_ZEND_SOURCES zend/*.cpp)
FILE(GLOB PHPCPP_ZEND_HEADERS zend/*.h)
-FILE(GLOB PHPCPP_HEADERS_INCLUDE include/*.h)
+FILE(GLOB PHPCPP_HEADERS_INCLUDE include/phpcpp/*.h)
LINK_DIRECTORIES(${PHP_LIB_PATH})
diff --git a/Makefile b/Makefile
index eff5725d..1220ba45 100644
--- a/Makefile
+++ b/Makefile
@@ -221,7 +221,7 @@ install:
${MKDIR} ${INSTALL_HEADERS}/phpcpp
${MKDIR} ${INSTALL_LIB}
${CP} phpcpp.h ${INSTALL_HEADERS}
- ${CP} include/*.h ${INSTALL_HEADERS}/phpcpp
+ ${CP} include/phpcpp/*.h ${INSTALL_HEADERS}/phpcpp
if [ -e ${PHP_SHARED_LIBRARY} ]; then \
${CP} ${PHP_SHARED_LIBRARY} ${INSTALL_LIB}/; \
${LN} ${INSTALL_LIB}/${PHP_SHARED_LIBRARY} ${INSTALL_LIB}/libphpcpp.so.$(SONAME); \
diff --git a/include/argument.h b/include/phpcpp/argument.h
similarity index 100%
rename from include/argument.h
rename to include/phpcpp/argument.h
diff --git a/include/array.h b/include/phpcpp/array.h
similarity index 100%
rename from include/array.h
rename to include/phpcpp/array.h
diff --git a/include/arrayaccess.h b/include/phpcpp/arrayaccess.h
similarity index 100%
rename from include/arrayaccess.h
rename to include/phpcpp/arrayaccess.h
diff --git a/include/base.h b/include/phpcpp/base.h
similarity index 100%
rename from include/base.h
rename to include/phpcpp/base.h
diff --git a/include/byref.h b/include/phpcpp/byref.h
similarity index 100%
rename from include/byref.h
rename to include/phpcpp/byref.h
diff --git a/include/byval.h b/include/phpcpp/byval.h
similarity index 100%
rename from include/byval.h
rename to include/phpcpp/byval.h
diff --git a/include/call.h b/include/phpcpp/call.h
similarity index 100%
rename from include/call.h
rename to include/phpcpp/call.h
diff --git a/include/class.h b/include/phpcpp/class.h
similarity index 100%
rename from include/class.h
rename to include/phpcpp/class.h
diff --git a/include/classbase.h b/include/phpcpp/classbase.h
similarity index 100%
rename from include/classbase.h
rename to include/phpcpp/classbase.h
diff --git a/include/classtype.h b/include/phpcpp/classtype.h
similarity index 100%
rename from include/classtype.h
rename to include/phpcpp/classtype.h
diff --git a/include/constant.h b/include/phpcpp/constant.h
similarity index 100%
rename from include/constant.h
rename to include/phpcpp/constant.h
diff --git a/include/countable.h b/include/phpcpp/countable.h
similarity index 100%
rename from include/countable.h
rename to include/phpcpp/countable.h
diff --git a/include/deprecated.h b/include/phpcpp/deprecated.h
similarity index 100%
rename from include/deprecated.h
rename to include/phpcpp/deprecated.h
diff --git a/include/errors.h b/include/phpcpp/errors.h
similarity index 100%
rename from include/errors.h
rename to include/phpcpp/errors.h
diff --git a/include/exception.h b/include/phpcpp/exception.h
similarity index 100%
rename from include/exception.h
rename to include/phpcpp/exception.h
diff --git a/include/extension.h b/include/phpcpp/extension.h
similarity index 100%
rename from include/extension.h
rename to include/phpcpp/extension.h
diff --git a/include/fatalerror.h b/include/phpcpp/fatalerror.h
similarity index 100%
rename from include/fatalerror.h
rename to include/phpcpp/fatalerror.h
diff --git a/include/file.h b/include/phpcpp/file.h
similarity index 100%
rename from include/file.h
rename to include/phpcpp/file.h
diff --git a/include/function.h b/include/phpcpp/function.h
similarity index 100%
rename from include/function.h
rename to include/phpcpp/function.h
diff --git a/include/global.h b/include/phpcpp/global.h
similarity index 100%
rename from include/global.h
rename to include/phpcpp/global.h
diff --git a/include/globals.h b/include/phpcpp/globals.h
similarity index 100%
rename from include/globals.h
rename to include/phpcpp/globals.h
diff --git a/include/hashmember.h b/include/phpcpp/hashmember.h
similarity index 100%
rename from include/hashmember.h
rename to include/phpcpp/hashmember.h
diff --git a/include/hashparent.h b/include/phpcpp/hashparent.h
similarity index 100%
rename from include/hashparent.h
rename to include/phpcpp/hashparent.h
diff --git a/include/ini.h b/include/phpcpp/ini.h
similarity index 100%
rename from include/ini.h
rename to include/phpcpp/ini.h
diff --git a/include/inivalue.h b/include/phpcpp/inivalue.h
similarity index 100%
rename from include/inivalue.h
rename to include/phpcpp/inivalue.h
diff --git a/include/interface.h b/include/phpcpp/interface.h
similarity index 100%
rename from include/interface.h
rename to include/phpcpp/interface.h
diff --git a/include/iterator.h b/include/phpcpp/iterator.h
similarity index 100%
rename from include/iterator.h
rename to include/phpcpp/iterator.h
diff --git a/include/modifiers.h b/include/phpcpp/modifiers.h
similarity index 100%
rename from include/modifiers.h
rename to include/phpcpp/modifiers.h
diff --git a/include/namespace.h b/include/phpcpp/namespace.h
similarity index 100%
rename from include/namespace.h
rename to include/phpcpp/namespace.h
diff --git a/include/noexcept.h b/include/phpcpp/noexcept.h
similarity index 100%
rename from include/noexcept.h
rename to include/phpcpp/noexcept.h
diff --git a/include/object.h b/include/phpcpp/object.h
similarity index 100%
rename from include/object.h
rename to include/phpcpp/object.h
diff --git a/include/parameters.h b/include/phpcpp/parameters.h
similarity index 100%
rename from include/parameters.h
rename to include/phpcpp/parameters.h
diff --git a/include/platform.h b/include/phpcpp/platform.h
similarity index 100%
rename from include/platform.h
rename to include/phpcpp/platform.h
diff --git a/include/script.h b/include/phpcpp/script.h
similarity index 100%
rename from include/script.h
rename to include/phpcpp/script.h
diff --git a/include/serializable.h b/include/phpcpp/serializable.h
similarity index 100%
rename from include/serializable.h
rename to include/phpcpp/serializable.h
diff --git a/include/streams.h b/include/phpcpp/streams.h
similarity index 100%
rename from include/streams.h
rename to include/phpcpp/streams.h
diff --git a/include/super.h b/include/phpcpp/super.h
similarity index 100%
rename from include/super.h
rename to include/phpcpp/super.h
diff --git a/include/thread_local.h b/include/phpcpp/thread_local.h
similarity index 100%
rename from include/thread_local.h
rename to include/phpcpp/thread_local.h
diff --git a/include/traversable.h b/include/phpcpp/traversable.h
similarity index 100%
rename from include/traversable.h
rename to include/phpcpp/traversable.h
diff --git a/include/type.h b/include/phpcpp/type.h
similarity index 100%
rename from include/type.h
rename to include/phpcpp/type.h
diff --git a/include/value.h b/include/phpcpp/value.h
similarity index 100%
rename from include/value.h
rename to include/phpcpp/value.h
diff --git a/include/valueiterator.h b/include/phpcpp/valueiterator.h
similarity index 100%
rename from include/valueiterator.h
rename to include/phpcpp/valueiterator.h
diff --git a/include/version.h b/include/phpcpp/version.h
similarity index 100%
rename from include/version.h
rename to include/phpcpp/version.h
diff --git a/include/visibility.h b/include/phpcpp/visibility.h
similarity index 100%
rename from include/visibility.h
rename to include/phpcpp/visibility.h
diff --git a/include/zendcallable.h b/include/phpcpp/zendcallable.h
similarity index 100%
rename from include/zendcallable.h
rename to include/phpcpp/zendcallable.h
diff --git a/include/zval.h b/include/phpcpp/zval.h
similarity index 100%
rename from include/zval.h
rename to include/phpcpp/zval.h
From 322b01d8baab6cf10b77d82b1c89342cf4f34876 Mon Sep 17 00:00:00 2001
From: Maxim Leontyev
Date: Thu, 20 Dec 2018 11:59:14 +0400
Subject: [PATCH 3/6] Documentation for cmake
---
documentation/install.html | 40 ++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/documentation/install.html b/documentation/install.html
index 753de5d9..e3983767 100644
--- a/documentation/install.html
+++ b/documentation/install.html
@@ -86,3 +86,43 @@ Compiling on OSX?
be added to it.
+
+Compiling using cmake
+
+ You could use PHP-CPP as a part of your project. You can install it into your source tree using command
+
+
+
git submodule add git://github.com/CopernicaMarketingSoftware/PHP-CPP.git
+
+
+
+ For example, part of your CMakeLists.txt may look like this:
+
+
+
FIND_PROGRAM(PHP_CONFIG NAMES php-config)
+
+execute_process(
+ COMMAND ${PHP_CONFIG} --include-dir
+ OUTPUT_VARIABLE PHPCPP_PHP_PATH
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+# or: SET(PHPCPP_PHP_PATH "/usr/include/php/20160303" CACHE STRING "")
+SET(PHPCPP_ARCH "x86_64" CACHE STRING "")
+
+add_subdirectory(PHP-CPP)
+target_link_libraries(YourTarget PRIVATE phpcpp)
+
+
+
+ For full list of options look through CMakeLists.txt file comments.
+
+
+ Or you could compile and install PHP-CPP using Makefile and then reference it in your CMakeLists.txt like this:
+
+
+
+
find_library(phpcpp REQUIRED)
+target_link_libraries(YourTarget PRIVATE phpcpp)
+
+
+
From eb6a55d883f2cb290bcbcc5656fcf2ac1221b18d Mon Sep 17 00:00:00 2001
From: Maxim Leontyev
Date: Thu, 20 Dec 2018 12:34:57 +0400
Subject: [PATCH 4/6] Fix headers paths in sources after moving header files
---
common/includes.h | 4 +--
zend/includes.h | 90 +++++++++++++++++++++++------------------------
2 files changed, 47 insertions(+), 47 deletions(-)
diff --git a/common/includes.h b/common/includes.h
index 437f73ec..30a5494d 100644
--- a/common/includes.h
+++ b/common/includes.h
@@ -15,8 +15,8 @@
/**
* Public include files
*/
-#include "../include/visibility.h"
-#include "../include/modifiers.h"
+#include "../include/phpcpp/visibility.h"
+#include "../include/phpcpp/modifiers.h"
/**
* Generic implementation header files
diff --git a/zend/includes.h b/zend/includes.h
index 121c0a20..f4435d58 100644
--- a/zend/includes.h
+++ b/zend/includes.h
@@ -59,51 +59,51 @@
/**
* Include other files from this library
*/
-#include "../include/visibility.h"
-#include "../include/deprecated.h"
-#include "../include/noexcept.h"
-#include "../include/thread_local.h"
-#include "../include/platform.h"
-#include "../include/version.h"
-#include "../include/inivalue.h"
-#include "../include/ini.h"
-#include "../include/exception.h"
-#include "../include/fatalerror.h"
-#include "../include/streams.h"
-#include "../include/type.h"
-#include "../include/errors.h"
-#include "../include/hashparent.h"
-#include "../include/value.h"
-#include "../include/valueiterator.h"
-#include "../include/array.h"
-#include "../include/object.h"
-#include "../include/globals.h"
-#include "../include/argument.h"
-#include "../include/byval.h"
-#include "../include/byref.h"
-#include "../include/global.h"
-#include "../include/hashmember.h"
-#include "../include/super.h"
-#include "../include/parameters.h"
-#include "../include/modifiers.h"
-#include "../include/base.h"
-#include "../include/countable.h"
-#include "../include/arrayaccess.h"
-#include "../include/serializable.h"
-#include "../include/iterator.h"
-#include "../include/traversable.h"
-#include "../include/classtype.h"
-#include "../include/classbase.h"
-#include "../include/interface.h"
-#include "../include/constant.h"
-#include "../include/zendcallable.h"
-#include "../include/class.h"
-#include "../include/namespace.h"
-#include "../include/extension.h"
-#include "../include/call.h"
-#include "../include/script.h"
-#include "../include/file.h"
-#include "../include/function.h"
+#include "../include/phpcpp/visibility.h"
+#include "../include/phpcpp/deprecated.h"
+#include "../include/phpcpp/noexcept.h"
+#include "../include/phpcpp/thread_local.h"
+#include "../include/phpcpp/platform.h"
+#include "../include/phpcpp/version.h"
+#include "../include/phpcpp/inivalue.h"
+#include "../include/phpcpp/ini.h"
+#include "../include/phpcpp/exception.h"
+#include "../include/phpcpp/fatalerror.h"
+#include "../include/phpcpp/streams.h"
+#include "../include/phpcpp/type.h"
+#include "../include/phpcpp/errors.h"
+#include "../include/phpcpp/hashparent.h"
+#include "../include/phpcpp/value.h"
+#include "../include/phpcpp/valueiterator.h"
+#include "../include/phpcpp/array.h"
+#include "../include/phpcpp/object.h"
+#include "../include/phpcpp/globals.h"
+#include "../include/phpcpp/argument.h"
+#include "../include/phpcpp/byval.h"
+#include "../include/phpcpp/byref.h"
+#include "../include/phpcpp/global.h"
+#include "../include/phpcpp/hashmember.h"
+#include "../include/phpcpp/super.h"
+#include "../include/phpcpp/parameters.h"
+#include "../include/phpcpp/modifiers.h"
+#include "../include/phpcpp/base.h"
+#include "../include/phpcpp/countable.h"
+#include "../include/phpcpp/arrayaccess.h"
+#include "../include/phpcpp/serializable.h"
+#include "../include/phpcpp/iterator.h"
+#include "../include/phpcpp/traversable.h"
+#include "../include/phpcpp/classtype.h"
+#include "../include/phpcpp/classbase.h"
+#include "../include/phpcpp/interface.h"
+#include "../include/phpcpp/constant.h"
+#include "../include/phpcpp/zendcallable.h"
+#include "../include/phpcpp/class.h"
+#include "../include/phpcpp/namespace.h"
+#include "../include/phpcpp/extension.h"
+#include "../include/phpcpp/call.h"
+#include "../include/phpcpp/script.h"
+#include "../include/phpcpp/file.h"
+#include "../include/phpcpp/function.h"
/**
* Common header files for internal use only
From d309d46a9effb76765252ed7ddd9cef9c37af4e9 Mon Sep 17 00:00:00 2001
From: Maxim Leontyev
Date: Thu, 20 Dec 2018 12:35:28 +0400
Subject: [PATCH 5/6] Minor fixes and checks to cmake and documentation
---
CMakeLists.txt | 5 +++++
documentation/install.html | 1 +
2 files changed, 6 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index db912ff3..63f08f0d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,6 +8,7 @@ PROJECT(phpcpp)
# PHPCPP_ARCH Set to "x86_64" if architecture and PHP was compiled under x64 or "x86" for 32 bit
# PHPCPP_PHP_PATH The path to PHP sources
+set(CMAKE_CXX_STANDARD 11)
LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR})
IF(CMAKE_BUILD_TYPE MATCHES DEBUG)
@@ -25,6 +26,10 @@ ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
ADD_DEFINITIONS(-DBUILDING_PHPCPP)
ADD_DEFINITIONS(-DZEND_WIN32_KEEP_INLINE)
+IF (NOT EXISTS "${PHPCPP_PHP_PATH}/main/php.h")
+ message(SEND_ERROR "The PHPCPP_PHP_PATH variable does not contain PHP sources path")
+ENDIF()
+
IF (MSVC)
# Should compile MSVC runtime static or dll
IF (PHPCPP_MSVCRT_STATIC)
diff --git a/documentation/install.html b/documentation/install.html
index e3983767..87aaa765 100644
--- a/documentation/install.html
+++ b/documentation/install.html
@@ -109,6 +109,7 @@ Compiling using cmake
# or: SET(PHPCPP_PHP_PATH "/usr/include/php/20160303" CACHE STRING "")
SET(PHPCPP_ARCH "x86_64" CACHE STRING "")
+include_directories(PHP-CPP include)
add_subdirectory(PHP-CPP)
target_link_libraries(YourTarget PRIVATE phpcpp)
From c42984a4f9da87023fb06e7390cb6720c8405395 Mon Sep 17 00:00:00 2001
From: Maxim Leontyev
Date: Thu, 20 Dec 2018 13:15:11 +0400
Subject: [PATCH 6/6] Add cmake flag description to cmake comments
---
CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 63f08f0d..bd9a2887 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,6 +5,7 @@ PROJECT(phpcpp)
# Use CMake File with following options
# PHPCPP_COMPILE_TS Set flag if PHP was compiled with thread safe
# PHPCPP_MSVCRT_STATIC Set flag if you want to compile the MSVC runtime as a static library
+# PHPCPP_SHARED Set flag if you want to compile shared library
# PHPCPP_ARCH Set to "x86_64" if architecture and PHP was compiled under x64 or "x86" for 32 bit
# PHPCPP_PHP_PATH The path to PHP sources