summaryrefslogtreecommitdiffstats
path: root/strip.php
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-08-05 18:58:15 +0200
committerRemi Collet <fedora@famillecollet.com>2016-08-05 18:58:15 +0200
commit35a4d072c7b6ff0242911a5f8db19251a52f39cc (patch)
treed7c0a659e12bcafec84118cd105a3608c69ac181 /strip.php
parentc09c659844def14cf1602ccc847b0688f978ae69 (diff)
php-pear: improve default configuration (avoid change in scriplet)
Diffstat (limited to 'strip.php')
-rw-r--r--strip.php35
1 files changed, 0 insertions, 35 deletions
diff --git a/strip.php b/strip.php
deleted file mode 100644
index 5c5216b..0000000
--- a/strip.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-#
-# strip.php /path/to/file key_name
-#
-# Takes a file as input and a string prefix; reads
-# the file as a serialized data blob and removes a
-# key with name key_name from the hash.
-# Serializes again and writes output to stdout.
-#
-
-$file = $_SERVER['argv'][1];
-$key = $_SERVER['argv'][2];
-
-function remove_key($array, $name) {
- if (array_key_exists($name, $array)) {
- unset($array[$name]);
- }
-
- return $array;
-}
-
-$input = file_get_contents($file);
-
-# Special case for /etc/pear.conf.
-if (strncmp($input, "#PEAR_Config 0.9\n", 17) == 0) {
- echo substr($input, 0, 17);
- $s = substr($input, 17);
-} else {
- $s = $input;
-}
-
-echo serialize(remove_key(unserialize($s), $key));
-
-?> \ No newline at end of file