Files
dotfiles/php/includes/functions.php
2025-06-24 14:19:03 +02:00

25 lines
455 B
PHP

<?php
use JetBrains\PhpStorm\NoReturn;
function path(...$segments): string
{
return implode(DIRECTORY_SEPARATOR, $segments);
}
function line(string $line): void
{
echo $line . PHP_EOL;
}
#[NoReturn] function lexit(string $line, int $code = 0): void
{
line($line);
exit($code);
}
function execInDirectory(string $dir, string $command): ?string
{
return shell_exec(sprintf('cd %s && %s', $dir, $command));
}