diff --git a/Source/Modules/php.cxx b/Source/Modules/php.cxx index 295039ba1..4bc0eecd3 100644 --- a/Source/Modules/php.cxx +++ b/Source/Modules/php.cxx @@ -96,6 +96,7 @@ static String *all_cs_entry; static String *pragma_incl; static String *pragma_code; static String *pragma_phpinfo; +static String *pragma_version; static String *s_oowrappers; static String *s_fakeoowrappers; static String *s_phpclasses; @@ -359,6 +360,7 @@ public: /* sub-sections of the php file */ pragma_code = NewStringEmpty(); pragma_incl = NewStringEmpty(); + pragma_version = NULL; /* Initialize the rest of the module */ @@ -515,7 +517,11 @@ public: } else { Printf(s_init, " NULL, /* No MINFO code */\n"); } - Printf(s_init, " NO_VERSION_YET,\n"); + if (Len(pragma_version) > 0) { + Printf(s_init, " \"%s\",\n", pragma_version); + } else { + Printf(s_init, " NO_VERSION_YET,\n"); + } Printf(s_init, " STANDARD_MODULE_PROPERTIES\n"); Printf(s_init, "};\n"); Printf(s_init, "zend_module_entry* SWIG_module_entry = &%s_module_entry;\n\n", module); @@ -2007,6 +2013,10 @@ done: if (value) { Printf(pragma_phpinfo, "%s\n", value); } + } else if (Strcmp(type, "version") == 0) { + if (value) { + pragma_version = value; + } } else { Swig_warning(WARN_PHP_UNKNOWN_PRAGMA, input_file, line_number, "Unrecognized pragma <%s>.\n", type); } diff --git a/Source/Modules/php5.cxx b/Source/Modules/php5.cxx index e31b81ecb..7726a2f6c 100644 --- a/Source/Modules/php5.cxx +++ b/Source/Modules/php5.cxx @@ -96,6 +96,7 @@ static String *all_cs_entry; static String *pragma_incl; static String *pragma_code; static String *pragma_phpinfo; +static String *pragma_version; static String *s_oowrappers; static String *s_fakeoowrappers; static String *s_phpclasses; @@ -391,6 +392,7 @@ public: /* sub-sections of the php file */ pragma_code = NewStringEmpty(); pragma_incl = NewStringEmpty(); + pragma_version = NULL; /* Initialize the rest of the module */ @@ -549,7 +551,11 @@ public: Printf(s_init, " PHP_RINIT(%s),\n", module); Printf(s_init, " PHP_RSHUTDOWN(%s),\n", module); Printf(s_init, " PHP_MINFO(%s),\n", module); - Printf(s_init, " NO_VERSION_YET,\n"); + if (Len(pragma_version) > 0) { + Printf(s_init, " \"%s\",\n", pragma_version); + } else { + Printf(s_init, " NO_VERSION_YET,\n"); + } Printf(s_init, " STANDARD_MODULE_PROPERTIES\n"); Printf(s_init, "};\n"); Printf(s_init, "zend_module_entry* SWIG_module_entry = &%s_module_entry;\n\n", module); @@ -1993,6 +1999,10 @@ done: if (value) { Printf(pragma_phpinfo, "%s\n", value); } + } else if (Strcmp(type, "version") == 0) { + if (value) { + pragma_version = value; + } } else { Swig_warning(WARN_PHP_UNKNOWN_PRAGMA, input_file, line_number, "Unrecognized pragma <%s>.\n", type); }