mirror of
https://github.com/the-programmers-hangout/Mimic.git
synced 2026-09-04 17:26:01 +02:00
29 lines
659 B
PHP
29 lines
659 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
$directories = ['app', 'bootstrap', 'config', 'database'];
|
|
|
|
foreach ($directories as $directory) {
|
|
if (! is_dir($directory)) {
|
|
continue;
|
|
}
|
|
|
|
$iterator = new RecursiveIteratorIterator(
|
|
new RecursiveDirectoryIterator($directory, FilesystemIterator::SKIP_DOTS)
|
|
);
|
|
|
|
foreach ($iterator as $file) {
|
|
if (! $file->isFile() || $file->getExtension() !== 'php') {
|
|
continue;
|
|
}
|
|
|
|
$command = sprintf('php -l %s', escapeshellarg($file->getPathname()));
|
|
passthru($command, $exitCode);
|
|
|
|
if ($exitCode !== 0) {
|
|
exit($exitCode);
|
|
}
|
|
}
|
|
}
|