summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/call.h5
-rw-r--r--include/file.h20
2 files changed, 23 insertions, 2 deletions
diff --git a/include/call.h b/include/call.h
index 1a0c59f..279cbac 100644
--- a/include/call.h
+++ b/include/call.h
@@ -19,13 +19,16 @@ extern bool class_exists(const char *classname, size_t size, bool autoload = tr
inline bool class_exists(const char *classname, bool autoload = true) { return class_exists(classname, strlen(classname), autoload); }
inline bool class_exists(const std::string &classname, bool autoload = true) { return class_exists(classname.c_str(), classname.size(), autoload); }
extern Value eval(const std::string &phpCode);
+extern Value include(const std::string &filename);
+extern Value include_once(const std::string &filename);
inline bool is_a(const Value &obj, const char *classname, size_t size, bool allow_string = false) { return obj.instanceOf(classname, size, allow_string); }
inline bool is_a(const Value &obj, const char *classname, bool allow_string = false) { return is_a(obj, classname, strlen(classname), allow_string); }
inline bool is_a(const Value &obj, const std::string &classname, bool allow_string = false) { return is_a(obj, classname.c_str(), classname.size(), allow_string); }
inline bool is_subclass_of(const Value &obj, const char *classname, size_t size, bool allow_string = true) { return obj.derivedFrom(classname, size, allow_string); }
inline bool is_subclass_of(const Value &obj, const char *classname, bool allow_string = true) { return is_subclass_of(obj, classname, strlen(classname), allow_string); }
inline bool is_subclass_of(const Value &obj, const std::string &classname, bool allow_string = true) { return is_subclass_of(obj, classname.c_str(), classname.size(), allow_string); }
-
+extern Value require(const std::string &filename);
+extern Value require_once(const std::string &filename);
/**
* Call a function in PHP
diff --git a/include/file.h b/include/file.h
index 6e24516..7029bb6 100644
--- a/include/file.h
+++ b/include/file.h
@@ -55,7 +55,19 @@ public:
virtual ~File();
/**
- * Include the file once
+ * Does the file exist?
+ * @return boolean
+ */
+ bool exists();
+
+ /**
+ * Is this a valid file?
+ * @return boolean
+ */
+ bool valid();
+
+ /**
+ * Execute the file once (do nothing if the file already was executed)
* @return Php::Value
*/
Value once();
@@ -78,6 +90,12 @@ private:
* @var Opcodes
*/
Opcodes *_opcodes = nullptr;
+
+ /**
+ * Compile the file
+ * @return bool
+ */
+ bool compile();
};