mirror of
https://github.com/php/php-src.git
synced 2024-12-02 14:24:10 +08:00
03bbdf275a
This patch makes few remaining PHP development tools files executable and adds a shebang to them. The `#!/usr/bin/env php` shebang provides running the script via `./script.php` and uses env to find PHP script location on the system. At the same time it still provides running the script with a user defined PHP location using `php script.php`. Shebang is not visible in the output of the generated file.
19 lines
418 B
PHP
Executable File
19 lines
418 B
PHP
Executable File
#!/usr/bin/env php
|
|
/* This is a generated file, do not modify */
|
|
/* Usage: php create_data_file.php /path/to/magic.mgc > data_file.c */
|
|
<?php
|
|
$dta = file_get_contents( $argv[1] );
|
|
$dta_l = strlen($dta);
|
|
$j = 0;
|
|
|
|
echo "const unsigned char php_magic_database[$dta_l] = {\n";
|
|
for ($i = 0; $i < $dta_l; $i++) {
|
|
printf("0x%02X, ", ord($dta[$i]));
|
|
if ($j % 16 == 15) {
|
|
echo "\n";
|
|
}
|
|
$j++;
|
|
}
|
|
echo "};\n";
|
|
?>
|