aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/jbroadway/urlify/scripts
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-10-22 07:46:30 +0000
committerMario <mario@mariovavti.com>2021-10-22 07:46:30 +0000
commit22588e58f31f60586445c19031979aaffcd95714 (patch)
tree2df842da4a6a826668d95d392566e2b4a5e37399 /vendor/jbroadway/urlify/scripts
parent69ba4eb0558938845fdc96957850672940965e11 (diff)
downloadvolse-hubzilla-22588e58f31f60586445c19031979aaffcd95714.tar.gz
volse-hubzilla-22588e58f31f60586445c19031979aaffcd95714.tar.bz2
volse-hubzilla-22588e58f31f60586445c19031979aaffcd95714.zip
install urlify via composer
Diffstat (limited to 'vendor/jbroadway/urlify/scripts')
-rw-r--r--vendor/jbroadway/urlify/scripts/downcode.php25
-rw-r--r--vendor/jbroadway/urlify/scripts/filter.php25
-rw-r--r--vendor/jbroadway/urlify/scripts/transliterate.php25
3 files changed, 75 insertions, 0 deletions
diff --git a/vendor/jbroadway/urlify/scripts/downcode.php b/vendor/jbroadway/urlify/scripts/downcode.php
new file mode 100644
index 000000000..018e7d4fa
--- /dev/null
+++ b/vendor/jbroadway/urlify/scripts/downcode.php
@@ -0,0 +1,25 @@
+<?php
+
+//
+// Downcode the provided argument or stdin if the argument was not present
+//
+
+require_once \dirname(__DIR__) . '/vendor/autoload.php';
+require_once \dirname(__DIR__) . '/URLify.php';
+
+// Print usage and exit if arguments are invalid
+if ($argc < 1 || $argc > 2) {
+ die('Usage (argument): php ' . \basename(__FILE__) . " \"<text to downcode>\"\nUsage (pipe): <Arbitrary command> | php " . \basename(__FILE__) . "\n");
+}
+
+// Process the provided argument
+$piped = false;
+if ($argc === 2) {
+ $s = $argv[1];
+// Or read from stdin if the argument wasn't present
+} else {
+ $piped = true;
+ $s = \file_get_contents('php://stdin');
+}
+
+echo URLify::downcode($s) . ($piped ? "\n" : '');
diff --git a/vendor/jbroadway/urlify/scripts/filter.php b/vendor/jbroadway/urlify/scripts/filter.php
new file mode 100644
index 000000000..d20c31594
--- /dev/null
+++ b/vendor/jbroadway/urlify/scripts/filter.php
@@ -0,0 +1,25 @@
+<?php
+
+//
+// Filter the provided argument or stdin if the argument was not present
+//
+
+require_once \dirname(__DIR__) . '/vendor/autoload.php';
+require_once \dirname(__DIR__) . '/URLify.php';
+
+// Print usage and exit if arguments are invalid
+if ($argc < 1 || $argc > 2) {
+ die('Usage (argument): php ' . \basename(__FILE__) . " \"<text to filter>\"\nUsage (pipe): <Arbitrary command> | php " . \basename(__FILE__) . "\n");
+}
+
+// Process the provided argument
+$piped = false;
+if ($argc === 2) {
+ $s = $argv[1];
+// Or read from stdin if the argument wasn't present
+} else {
+ $piped = true;
+ $s = \file_get_contents('php://stdin');
+}
+
+echo URLify::filter($s) . ($piped ? "\n" : '');
diff --git a/vendor/jbroadway/urlify/scripts/transliterate.php b/vendor/jbroadway/urlify/scripts/transliterate.php
new file mode 100644
index 000000000..1970b506c
--- /dev/null
+++ b/vendor/jbroadway/urlify/scripts/transliterate.php
@@ -0,0 +1,25 @@
+<?php
+
+//
+// Transliterate the provided argument or stdin if the argument was not present
+//
+
+require_once \dirname(__DIR__) . '/vendor/autoload.php';
+require_once \dirname(__DIR__) . '/URLify.php';
+
+// Print usage and exit if arguments are invalid
+if ($argc < 1 || $argc > 2) {
+ die('Usage (argument): php ' . \basename(__FILE__) . " \"<text to transliterate>\"\nUsage (pipe): <Arbitrary command> | php " . \basename(__FILE__) . "\n");
+}
+
+// Process the provided argument
+$piped = false;
+if ($argc === 2) {
+ $s = $argv[1];
+// Or read from stdin if the argument wasn't present
+} else {
+ $piped = true;
+ $s = \file_get_contents('php://stdin');
+}
+
+echo URLify::transliterate($s) . ($piped ? "\n" : '');