Remove support for PHP5

PHP5 is no longer actively supported by the PHP developers and security
support for it ends completely at the end of 2018, so it doesn't make
sense to include support for it in the upcoming SWIG 4.0.0 release.

See #701.
This commit is contained in:
Olly Betts 2018-06-07 18:04:45 +12:00
commit d6d5db122b
201 changed files with 94 additions and 11358 deletions

View file

@ -62,7 +62,6 @@ eswig_SOURCES = CParse/cscanner.c \
Modules/overload.cxx \
Modules/perl5.cxx \
Modules/php.cxx \
Modules/php5.cxx \
Modules/pike.cxx \
Modules/python.cxx \
Modules/r.cxx \

View file

@ -65,7 +65,7 @@ static const char *usage1 = (const char *) "\
-copyctor - Automatically generate copy constructors wherever possible\n\
-cpperraswarn - Treat the preprocessor #error statement as #warning (default)\n\
-cppext <ext> - Change file extension of generated C++ files to <ext>\n\
(default is cxx, except for PHP5 which uses cpp)\n\
(default is cxx)\n\
-copyright - Display copyright notices\n\
-debug-classes - Display information about the classes found in the interface\n\
-debug-module <n>- Display module parse tree at stages 1-4, <n> is a csv list of stages\n\

View file

@ -12,7 +12,7 @@
* -----------------------------------------------------------------------------
*/
/* FIXME: PHP5 OO wrapping TODO list:
/* FIXME: PHP OO wrapping TODO list:
*
* Medium term:
*
@ -530,7 +530,7 @@ public:
Printf(s_init, "extern \"C\" {\n");
Printf(s_init, "#endif\n");
// We want to write "SWIGEXPORT ZEND_GET_MODULE(%s)" but ZEND_GET_MODULE
// in PHP5 has "extern "C" { ... }" around it so we can't do that.
// in PHP7 has "extern "C" { ... }" around it so we can't do that.
Printf(s_init, "SWIGEXPORT zend_module_entry *get_module(void) { return &%s_module_entry; }\n", module);
Printf(s_init, "#ifdef __cplusplus\n");
Printf(s_init, "}\n");
@ -1462,14 +1462,6 @@ public:
/* We need $this to refer to the current class, so can't allow it
* to be used as a parameter. */
Setattr(seen, "this", seen);
/* We use $r to store the return value, so disallow that as a parameter
* name in case the user uses the "call-time pass-by-reference" feature
* (it's deprecated and off by default in PHP5, but we want to be
* maximally portable). Similarly we use $c for the classname or new
* stdClass object.
*/
Setattr(seen, "r", seen);
Setattr(seen, "c", seen);
for (int argno = 0; argno < max_num_of_arguments; ++argno) {
String *&pname = arg_names[argno];
@ -2207,7 +2199,6 @@ done:
}
Printf(s_phpclasses, "\t}\n");
/* Create __isset for PHP 5.1 and later; PHP 5.0 will just ignore it. */
/* __isset() should return true for read-only properties, so check for
* *_get() not *_set(). */
Printf(s_phpclasses, "\n\tfunction __isset($var) {\n");
@ -2870,3 +2861,17 @@ static Language *new_swig_php() {
extern "C" Language *swig_php(void) {
return new_swig_php();
}
extern "C" Language *swig_php4(void) {
Printf(stderr, "*** -php4 is no longer supported.\n"
"*** Either upgrade to PHP5 or use SWIG 1.3.36 or earlier.\n");
SWIG_exit(EXIT_FAILURE);
return NULL; // To avoid compiler warnings.
}
extern "C" Language *swig_php5(void) {
Printf(stderr, "*** -php5 is no longer supported.\n"
"*** Either upgrade to PHP7 or use SWIG < 4.0.0.\n");
SWIG_exit(EXIT_FAILURE);
return NULL; // To avoid compiler warnings.
}

File diff suppressed because it is too large Load diff

View file

@ -84,9 +84,9 @@ static swig_module modules[] = {
{"-octave", swig_octave, "Octave"},
{"-perl", swig_perl5, "Perl"},
{"-perl5", swig_perl5, 0},
{"-php", swig_php5, 0},
{"-php", swig_php, 0},
{"-php4", swig_php4, 0},
{"-php5", swig_php5, "PHP5"},
{"-php5", swig_php5, 0},
{"-php7", swig_php, "PHP7"},
{"-pike", swig_pike, "Pike"},
{"-python", swig_python, "Python"},