From 71a6e83b2e06f357e6d759c50703a81847065755 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Tue, 5 Dec 2023 04:45:52 +0000 Subject: [PATCH] Remove process.php script and related apply scripts Those are clearly not used anymore as they use ereg/eregi functions which have been removed in PHP 7.0. --- scripts/apply/README | 8 -- scripts/apply/fix_modelines.php | 76 ---------------- scripts/apply/func2methodsyn.php | 147 ------------------------------- scripts/apply/lower.php | 20 ----- scripts/apply/tfn.php | 42 --------- scripts/process.php | 116 ------------------------ 6 files changed, 409 deletions(-) delete mode 100644 scripts/apply/README delete mode 100644 scripts/apply/fix_modelines.php delete mode 100644 scripts/apply/func2methodsyn.php delete mode 100644 scripts/apply/lower.php delete mode 100644 scripts/apply/tfn.php delete mode 100755 scripts/process.php diff --git a/scripts/apply/README b/scripts/apply/README deleted file mode 100644 index 33fb586cf..000000000 --- a/scripts/apply/README +++ /dev/null @@ -1,8 +0,0 @@ -Some useful scripts for maintaining consistency in phpdoc. - -Use these scripts with scripts/process.php to consequently -modify/test things in XML source files. These are mostly -one-time scripts, but instead of writing each time a new -script, it's better to base it on an existing one. - -Note, that these scripts cannot be used standalone. diff --git a/scripts/apply/fix_modelines.php b/scripts/apply/fix_modelines.php deleted file mode 100644 index 24b1b94c1..000000000 --- a/scripts/apply/fix_modelines.php +++ /dev/null @@ -1,76 +0,0 @@ -$line) { - if (preg_match("/Keep this comment at the end of the file/i", $line)) { - - // we're on top of the comment - if ($nr + 20 < $numlines) { - // there's too much of lines left, bail out - ?> - ERROR in this file, modelines seems to be not at end of file! - - -HEREDOC; - - return $output; -} diff --git a/scripts/apply/func2methodsyn.php b/scripts/apply/func2methodsyn.php deleted file mode 100644 index 9e913b3f9..000000000 --- a/scripts/apply/func2methodsyn.php +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - opt - - - - - - - - - - - - - - - - - - - - - - - - - - - mixed... - - - -'; - -$xslt_processor = false; - -function apply($input) { - global $conversion_xsl, $xslt_processor; - $output=""; - $flag=false; - - if(!function_exists("xslt_create")) { - die("this conversion requires a PHP executable with XSLT extension"); - } - - $xmlhead="\n"; - - $lines = explode("\n",$input); - for($nr=0;$nr"))) { - $flag=true; - $funcsyn = $xmlhead."\n".str_replace("&","&",$line); - do { - $line=$lines[++$nr]."\n";; - $funcsyn .= str_replace("&","&",$line); - } while(!strstr($line,(""))); - $arguments = array('/_xml' => $funcsyn, - '/_xsl' => $conversion_xsl - ); - if(!is_resource($xslt_processor)) { - $xslt_processor = xslt_create(); - } - $result = xslt_process($xslt_processor, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments); - - if(is_string($result)) { - $result = str_replace("&","&",$result); - $result = explode("\n",$result); - unset($result[0]); - $output .= rtrim(utf8_decode(join("\n",$result)))."\n"; - } else { - echo "line $nr\n"; - echo $funcsyn; - return false; - } - } else if (strstr($line,(" diff --git a/scripts/apply/lower.php b/scripts/apply/lower.php deleted file mode 100644 index 63d6cf30e..000000000 --- a/scripts/apply/lower.php +++ /dev/null @@ -1,20 +0,0 @@ -([^<]*)", $input, $matches)) { - $name = $matches[1]; - $lower = strtolower($name); - if($lower != $name) { - $input = str_replace("$name", "$lower", $input); - $flag = true; - } - } - - return $flag ? $input : false ; -} - -?> diff --git a/scripts/apply/tfn.php b/scripts/apply/tfn.php deleted file mode 100644 index be8cc76e3..000000000 --- a/scripts/apply/tfn.php +++ /dev/null @@ -1,42 +0,0 @@ - entities - -function apply($input) -{ - $from = '/([^a-zA-Z$._-])(true|false|null)([^a-zA-Z$_-])/i'; - $to = "\\1&\\2;\\3"; - - $lines = explode("\n",$input); - - $active = TRUE; - - foreach ($lines as $nr => $line) - { - $active = $active && !ereg('&null;','null',$output); - - return $output; - -} diff --git a/scripts/process.php b/scripts/process.php deleted file mode 100755 index 3b483c11f..000000000 --- a/scripts/process.php +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/php -q - | - +----------------------------------------------------------------------+ - - $Id$ -*/ - -set_time_limit(0); -ob_implicit_flush(); - -if ($argc < 2 || $argc > 3) { ?> -Process the manual to do some replacements. - - Usage: - [] - - must contain the function apply($input), - which recieves a whole xml-file, and should return - the new file, or false if no modification needed. - Apply scripts reside in the apply folder below this - script. You only need to give the file name. - - With you can specify in which dir - to start looking recursively for xml files. - - Written by jeroen@php.net - - - -### FATAL ERROR ### - -In you should define a function: - string apply(string $string) - -