r3-v2/utils.php

36 lines
800 B
PHP
Raw Normal View History

2021-06-21 11:43:10 +02:00
<?php
if (isset($argc)) {
for ($i = 0; $i < $argc; $i++) {
echo "Argument #" . $i . " - " . $argv[$i] . "\n";
}
}
else {
echo "argc and argv disabled\n";
}
$files = [];
if ($argv[1] == 'all') {
$files = scandir('src/r3/', SCANDIR_SORT_DESCENDING);
$systemFiles = scandir('src/r3/r3-system', SCANDIR_SORT_DESCENDING);
$newFiles = [];
for ($i = 0; $i < sizeof($files); $i++) {
if (preg_match('/\.js$/', $files[$i])) {
array_push($newFiles, 'src/r3/' . $files[$i]);
}
}
for ($i = 0; $i < sizeof($systemFiles); $i++) {
if (preg_match('/\.js$/', $systemFiles[$i])) {
array_push($newFiles, 'src/r3/r3-system/' . $systemFiles[$i]);
}
}
$files = $newFiles;
} else {
$files = [$argv[1]];
}