Export version information to PHP constants
@@ -366,6 +366,19 @@ int swow_module_init(INIT_FUNC_ARGS)
CAT_MODULE_UNION_TYPE_MAP(SWOW_MODULE_UNION_TYPE_GEN)
#undef SWOW_MODULE_UNION_TYPE_GEN
+ /* Version constants */
+#define SWOW_VERSION_MAP(XX) \
+ XX(MAJOR_VERSION, LONG) \
+ XX(MINOR_VERSION, LONG) \
+ XX(RELEASE_VERSION, LONG) \
+ XX(EXTRA_VERSION, STRING) \
+ XX(VERSION, STRING) \
+ XX(VERSION_ID, LONG)
+
+#define SWOW_VERSION_GEN(name, type) REGISTER_##type##_CONSTANT("Swow\\" #name, SWOW_##name, CONST_CS | CONST_PERSISTENT);
+ SWOW_VERSION_MAP(SWOW_VERSION_GEN)
+#undef SWOW_VERSION_GEN
+
return SUCCESS;
}
