From: Christoph M. Becker Date: Thu, 1 Aug 2019 08:49:05 +0000 (+0200) Subject: Remove upgrade-pcre.php script X-Git-Tag: php-7.4.0beta2~9^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b419b24ead933491453ecc5f45e38a20418c530e;p=php Remove upgrade-pcre.php script This script has not been updated for PCRE2, and it's mostly useless anyway. Therefore we remove it altogether. --- diff --git a/ext/pcre/upgrade-pcre.php b/ext/pcre/upgrade-pcre.php deleted file mode 100644 index b0da6cdb44..0000000000 --- a/ext/pcre/upgrade-pcre.php +++ /dev/null @@ -1,137 +0,0 @@ - 1) { - echo "more than one '$pattern' file. aborting\n"; - print_r($newpcre); - exit; -} - -if (count($newpcre) == 0) { - die("need one '$pattern' file. aborting.\n"); -} - - -$newpcre = $newpcre[0]; - -if (strpos($newpcre, 'gz')) { - system("tar xfz $newpcre"); -} elseif (strpos($newpcre, 'bz2')) { - system("tar xfj $newpcre"); -} else { - die("file type not recognized: $newpcre\n"); -} - -$newpcre = substr($newpcre, 0, strpos($newpcre, '.tar')); -$dirlen = strlen('pcrelib'); - -function recurse($path) -{ - global $newpcre, $dirlen; - - foreach (scandir($path) as $file) { - - if ($file[0] === '.' || - $file === 'CVS' || - @substr_compare($file, '.lo', -3, 3) === 0 || - @substr_compare($file, '.loT', -4, 4) === 0 || - @substr_compare($file, '.o', -2, 2) === 0) continue; - - $file = "$path/$file"; - - if (is_dir($file)) { - recurse($file); - continue; - } - - echo "processing $file... "; - - $newfile = $newpcre . substr($file, $dirlen); - - if (is_file($tmp = $newfile . '.generic') || is_file($tmp = $newfile . '.dist')) { - $newfile = $tmp; - } - - - if (!is_file($newfile)) { - die("$newfile is not available any more\n"); - } - - // maintain file mtimes so that cvs doesn't get crazy - if (file_get_contents($newfile) !== file_get_contents($file)) { - copy($newfile, $file); - } - - // always include the config.h file - $content = file_get_contents($newfile); - //$newcontent = preg_replace('/#\s*ifdef HAVE_CONFIG_H\s*(.+)\s*#\s*endif/', '$1', $content); - - //if ($content !== $newcontent) { - // file_put_contents($file, $newcontent); - //} - - echo "OK\n"; - } - -} - - -recurse('pcrelib'); - -$dirorig = scandir('pcrelib/testdata'); -$k = array_search('CVS', $dirorig); -if ($k !== false) - unset($dirorig[$k]); - -$k = array_search('.svn', $dirorig); -if ($k !== false) - unset($dirorig[$k]); - -$dirnew = scandir("$newpcre/testdata"); -$diff = array_diff($dirorig, $dirnew); - -foreach ($diff as $file) { - $file2 = 'pcrelib'.substr($file, strlen($newpcre)); - copy($file, $file2); -} - - -// the config.h needs special care -$prepend_config_h = ' -#include - -#ifndef PHP_WIN32 -# include -#endif - -#undef PACKAGE_NAME -#undef PACKAGE_VERSION -#undef PACKAGE_TARNAME -#undef PACKAGE_STRING - -#define SUPPORT_UCP -#define SUPPORT_UTF8 - -#if defined(__GNUC__) && __GNUC__ >= 4 -# ifdef __cplusplus -# define PCRE_EXP_DECL extern "C" __attribute__ ((visibility("default"))) -# else -# define PCRE_EXP_DECL extern __attribute__ ((visibility("default"))) -# endif -# define PCRE_EXP_DEFN __attribute__ ((visibility("default"))) -# define PCRE_EXP_DATA_DEFN __attribute__ ((visibility("default"))) -#endif - - -'; - -file_put_contents('pcrelib/config.h', $prepend_config_h . file_get_contents('pcrelib/config.h')); - - -echo "\nThe End :-)\n\n" - -?>