summaryrefslogtreecommitdiff
path: root/include/extension.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-04-10 12:36:50 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-04-10 12:36:50 +0200
commitec18c8779c6a806c6cbeb5fe12446955cd688221 (patch)
treeddc704bac5574d4727560469874019ecc07aed9e /include/extension.h
parentf0dec5907bd49bb468089b0fe50d8cbf2979272e (diff)
refactored ini settings
Diffstat (limited to 'include/extension.h')
-rw-r--r--include/extension.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/include/extension.h b/include/extension.h
index fcc0f72..e18e787 100644
--- a/include/extension.h
+++ b/include/extension.h
@@ -105,6 +105,52 @@ public:
Extension &onIdle(const Callback &callback);
/**
+ * Add a ini entry to the extension by moving it
+ * @param ini The php.ini setting
+ * @return Extension Same object to allow chaining
+ */
+ Extension &add(Ini &&ini)
+ {
+ // and add it to the list of classes
+ _ini_entries.emplace_back(new Ini(std::move(ini)));
+
+ // allow chaining
+ return *this;
+ }
+
+ /**
+ * Add a ini entry to the extension by copying it
+ * @param ini The php.ini setting
+ * @param Extension Same object to allow chaining
+ */
+ Extension &add(const Ini &ini)
+ {
+ // and add it to the list of classes
+ _ini_entries.emplace_back(new Ini(ini));
+
+ // allow chaining
+ return *this;
+ }
+
+ /**
+ * The total number of php.ini variables
+ * @return size_t
+ */
+ size_t iniVariables() const
+ {
+ return _ini_entries.size();
+ }
+
+ /**
+ * Apply a callback to each php.ini variable
+ *
+ * The callback will be called with a reference to the ini variable.
+ *
+ * @param callback
+ */
+ void iniVariables(const std::function<void(Ini &ini)> &callback);
+
+ /**
* Retrieve the module pointer
*
* This is the memory address that should be exported by the get_module()
@@ -131,6 +177,13 @@ private:
* @var ExtensionImpl
*/
ExtensionImpl *_impl;
+
+ /**
+ * Ini entry defined by the extension
+ * @var list
+ */
+ std::list<std::shared_ptr<Ini>> _ini_entries;
+
};
/**