From aa53d52798687aa884e5b95d36a013f33c694eaf Mon Sep 17 00:00:00 2001 From: Toon Schoenmakers Date: Fri, 13 Mar 2015 11:55:14 +0100 Subject: Implemented a simple sapi_name() method which will return the current sapi --- zend/includes.h | 1 + zend/sapi.cpp | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 zend/sapi.cpp (limited to 'zend') diff --git a/zend/includes.h b/zend/includes.h index aa33c71..c092a07 100644 --- a/zend/includes.h +++ b/zend/includes.h @@ -37,6 +37,7 @@ #include #include #include +#include /** * Macro to convert results to success status diff --git a/zend/sapi.cpp b/zend/sapi.cpp new file mode 100644 index 0000000..79393f7 --- /dev/null +++ b/zend/sapi.cpp @@ -0,0 +1,31 @@ +/** + * Sapi.cpp + * + * This file holds the implementation for the Php::sapi_name() function + * + * @author Toon Schoenmakers + */ + +/** + * Dependencies + */ +#include "includes.h" + +/** + * Open PHP namespace + */ +namespace Php { + +/** + * Retrieve the sapi name we're running on + * @return const char* + */ +const char *sapi_name() +{ + return sapi_module.name; +} + +/** + * End of namespace + */ +} -- cgit v1.2.3