diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2015-02-21 16:59:54 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2015-02-21 16:59:54 +0100 |
commit | e1f97c494ae31b9d67e85c6b17a18bb925bc2989 (patch) | |
tree | f7c240f082aad70f35de024bdc229504a0cc5f0a /zend/eval.cpp | |
parent | 9889100041bf14d8bc1b97f1cab4070de36e3e8f (diff) |
initial implementation of the Php::dl() function
Diffstat (limited to 'zend/eval.cpp')
-rw-r--r-- | zend/eval.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/zend/eval.cpp b/zend/eval.cpp index c332898..7ab4957 100644 --- a/zend/eval.cpp +++ b/zend/eval.cpp @@ -21,7 +21,7 @@ namespace Php { * @param phpCode The PHP code to evaluate * @return Value The result of the evaluation */ -Value eval(const std::string &phpCode) +Value eval(const char *phpCode) { // we have a script for this return Script(phpCode).execute(); @@ -32,7 +32,7 @@ Value eval(const std::string &phpCode) * @param filename * @return Value */ -Value include(const std::string &filename) +Value include(const char *filename) { // we can simply execute a file return File(filename).execute(); @@ -43,7 +43,7 @@ Value include(const std::string &filename) * @param filename * @return Value */ -Value include_once(const std::string &filename) +Value include_once(const char *filename) { // we can simply execute a file return File(filename).once(); @@ -55,7 +55,7 @@ Value include_once(const std::string &filename) * @param filename * @return Value */ -Value require(const std::string &filename) +Value require(const char *filename) { // create the file File file(filename); @@ -76,7 +76,7 @@ Value require(const std::string &filename) * @param filename * @return Value */ -Value require_once(const std::string &filename) +Value require_once(const char *filename) { // create the file File file(filename); @@ -91,6 +91,18 @@ Value require_once(const std::string &filename) return nullptr; } +/** + * Implementation of the dl() function - activate a different PHP extension + * @param filename + */ +bool dl(const char *filename) +{ + // create the module + Module module(filename); + + // start the module + return module.start(); +} /** * End of namespace |