Fuente: https://github.com/chamilo/chamilo-lms/releases/download/v1.11.40/chamilo-1.11.40.zip sha256: 1cf4bf2cc7bae1ef1a1eff643235db1d552f78ddf4b6dd1e2d2dac9868679439 Snapshot independiente (rama huerfana); diffable vs 1.11.38. vendor incluido.
21 lines
599 B
PHP
21 lines
599 B
PHP
<?php
|
|
//Downcode the provided argument or stdin if the argument was not present
|
|
|
|
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
|
|
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" : "");
|