From 6b5506dfe7b0f5ac9ce923c1d9cdd2ebc4c72a7c Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Mon, 14 Apr 2014 09:21:35 +0200 Subject: added Php::IniValue constructor to the Php::Value class, so that "return Php::ini_get("extension.x");" can be implemented --- include/call.h | 18 ++++++++---------- include/value.h | 1 + 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/call.h b/include/call.h index f881782..16de1fe 100644 --- a/include/call.h +++ b/include/call.h @@ -57,22 +57,20 @@ inline Value echo(const std::string &input) { out << input; return nullptr; } inline Value empty(const Value &value) { return value.isNull() || !value.boolValue(); } inline Value empty(const HashMember &member) { return !member.exists() || empty(member.value()); } inline Value empty(const HashMember &member) { return !member.exists() || empty(member.value()); } - -inline IniValue ini_get(const char* name) -{ - return IniValue(name, false); -} -inline IniValue ini_get_orig(const char* name) -{ - return IniValue(name, true); -} - inline Value is_array(const Value &value) { return value.isArray(); } inline Value strlen(const Value &value) { return call("strlen", value); } inline void unset(const HashMember &member) { member.unset(); } inline void unset(const HashMember &member) { member.unset(); } inline void unset(const HashMember &member) { member.unset(); } +/** + * The 'ini_get' function returns an IniValue, so that it can also be used + * before the PHP engine is started. + */ +inline IniValue ini_get(const char* name) { return IniValue(name, false); } +inline IniValue ini_get_orig(const char* name) { return IniValue(name, true); } + + /** * The isset function conflicts with the 'isset' macro defined by the Zend engine */ diff --git a/include/value.h b/include/value.h index d64eeed..63e8e6f 100644 --- a/include/value.h +++ b/include/value.h @@ -59,6 +59,7 @@ public: Value(const std::string &value); Value(const char *value, int size = -1); Value(double value); + Value(const IniValue &value); /** * Construct to a specific type -- cgit v1.2.3