diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2015-01-12 18:40:12 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2015-01-12 18:40:12 +0100 |
commit | a3007b9915a0ca3eec024b714cecc609e6356e17 (patch) | |
tree | e643f7ae433dbf12e6e1828950d694b855e4ec0a /include | |
parent | 74388e2735e806837cd31052c513451ec3942c0a (diff) |
fixed compiling in ZTS environments (reported in issue #57)
Diffstat (limited to 'include')
-rw-r--r-- | include/opcodes.h | 69 | ||||
-rw-r--r-- | include/script.h | 19 |
2 files changed, 9 insertions, 79 deletions
diff --git a/include/opcodes.h b/include/opcodes.h deleted file mode 100644 index 5a40d05..0000000 --- a/include/opcodes.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Opcodes.h - * - * Class represents a set of opcodes of a PHP script that can be executed. This - * is an internal file that you normally do not have to instantiate yourself. - * Better use the Php::Script of Php::File classes. - * - * @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com> - * @copyright 2014 Copernica BV - */ - -/** - * Forward declarations - */ -struct _zend_op_array; - -/** - * Namespace - */ -namespace Php { - -/** - * Class definition - */ -class Opcodes -{ -public: - /** - * Constructor - * @param opcodes - */ - Opcodes(struct _zend_op_array *opcodes) : _opcodes(opcodes) - { - // no other initialisation is necessary - } - - /** - * Destructor - */ - virtual ~Opcodes(); - - /** - * Are the opcodes valid? - * @return bool - */ - bool valid() const - { - return _opcodes != nullptr; - } - - /** - * Execute the opcodes - * @return Value - */ - Value execute() const; - -private: - /** - * The opcodes - * @var zend_op_array - */ - struct _zend_op_array *_opcodes; -}; - -/** - * End of namespace - */ -} - diff --git a/include/script.h b/include/script.h index a9c2921..af68a59 100644 --- a/include/script.h +++ b/include/script.h @@ -21,6 +21,11 @@ struct _zend_op_array; namespace Php { /** + * Forward declarations + */ +class Opcodes; + +/** * Class definition */ class Script @@ -62,33 +67,27 @@ public: /** * Destructor */ - virtual ~Script() {} + virtual ~Script(); /** * Is the script a valid PHP script without syntax errors? * @return bool */ - bool valid() const - { - return _opcodes.valid(); - } + bool valid() const; /** * Execute the script * The return value of the script is returned * @return Value */ - Value execute() const - { - return _opcodes.execute(); - } + Value execute() const; private: /** * The opcodes * @var Opcodes */ - Opcodes _opcodes; + Opcodes *_opcodes; /** * Helper function to compile the source code |