provide RTLD_LAZY compatibility
authorMichael Wallner <mike@php.net>
Tue, 21 Jul 2015 09:16:43 +0000 (11:16 +0200)
committerMichael Wallner <mike@php.net>
Tue, 21 Jul 2015 09:16:43 +0000 (11:16 +0200)
package.xml
php_raphf.c
php_raphf.h

index ec9d962faec945c8283f50f9befcc6dfa8b5a6ea..f64b6250cef711613aa10b06b3ebeca0f73ec23a 100644 (file)
@@ -19,9 +19,9 @@ http://pear.php.net/dtd/package-2.0.xsd">
   <email>mike@php.net</email>
   <active>yes</active>
  </lead>
- <date>2013-12-04</date>
+ <date>2015-07-21</date>
  <version>
-  <release>1.0.5</release>
+  <release>1.1.0</release>
   <api>1.0.0</api>
  </version>
  <stability>
@@ -30,7 +30,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
  </stability>
  <license>BSD, revised</license>
  <notes><![CDATA[
-* Source code documentation available at http://php.github.io/pecl-php-raphf
+* Fixed php module dependency check with RTLD_LAZY
++ Source code documentation available at http://m6w6.github.io/ext-raphf
 ]]></notes>
  <contents>
   <dir name="/">
@@ -60,8 +61,6 @@ http://pear.php.net/dtd/package-2.0.xsd">
   </required>
  </dependencies>
  <providesextension>raphf</providesextension>
- <extsrcrelease>
-  <configureoption default="yes" name="enable-raphf" prompt="whether to enable raphf support" />
- </extsrcrelease>
+ <extsrcrelease/>
 </package>
 
index 43cfa79b3d8edbcff3ed2a6f81266ebb2e8e9745..1de0fc0c2bc780bad5b1f9815b9f021cc1f6d1c2 100644 (file)
@@ -125,6 +125,20 @@ void php_resource_factory_handle_dtor(php_resource_factory_t *f,
        }
 }
 
+php_resource_factory_t *php_persistent_handle_resource_factory_init(
+               php_resource_factory_t *a, php_persistent_handle_factory_t *pf)
+{
+       return php_resource_factory_init(a,
+                       php_persistent_handle_get_resource_factory_ops(), pf,
+                       (void(*)(void*)) php_persistent_handle_abandon);
+}
+
+zend_bool php_resource_factory_is_persistent(php_resource_factory_t *a)
+{
+       return a->dtor == (void(*)(void *)) php_persistent_handle_abandon;
+}
+
+
 static inline php_persistent_handle_list_t *php_persistent_handle_list_init(
                php_persistent_handle_list_t *list)
 {
index 3447059839da35916272224ea0e1e1f12b5ea200..4ca7b87de8ef29434acb7a50bb46dc4b0db97707 100644 (file)
@@ -18,7 +18,7 @@
 extern zend_module_entry raphf_module_entry;
 #define phpext_raphf_ptr &raphf_module_entry
 
-#define PHP_RAPHF_VERSION "1.0.4"
+#define PHP_RAPHF_VERSION "1.1.0"
 
 #ifdef PHP_WIN32
 #      define PHP_RAPHF_API __declspec(dllexport)
@@ -362,7 +362,7 @@ PHP_RAPHF_API void *php_persistent_handle_accrete(
  *         pf = php_persistent_handle_concede(NULL, "my", 2,
  *             persistent_id_str, persistent_id_len, NULL, NULL TSRMLS_CC);
  *
- *         rf = php_resource_factory_init(NULL, ops, pf, php_persistent_handle_abandon);
+ *         rf = php_persistent_handle_resource_factory_init(NULL, pf);
  *     } else {
  *         rf = php_resource_factory_init(NULL, &myops, NULL, NULL);
  *     }
@@ -373,6 +373,27 @@ PHP_RAPHF_API void *php_persistent_handle_accrete(
 PHP_RAPHF_API php_resource_factory_ops_t *
 php_persistent_handle_get_resource_factory_ops(void);
 
+/**
+ * Create a resource factory for persistent handles.
+ *
+ * This will create a resource factory with persistent handle ops, which wraps
+ * the provided reource factory \a pf.
+ *
+ * @param a the persistent handle resource factory to initialize
+ * @param pf the resource factory to wrap
+ */
+PHP_RAPHF_API php_resource_factory_t *
+php_persistent_handle_resource_factory_init(php_resource_factory_t *a,
+               php_persistent_handle_factory_t *pf);
+
+/**
+ * Check whether a resource factory is a persistent handle resource factory.
+ *
+ * @param a the resource factory to check
+ */
+PHP_RAPHF_API zend_bool php_resource_factory_is_persistent(
+               php_resource_factory_t *a);
+
 /**
  * Clean persistent handles up.
  *