vito/app/Support/helpers.php
Saeed Vaziry b2083fc6b2
Migrate to HTMX (#114)
Dropped Livewire
Added HTMX
Added Blade code lint
Drop Mysql and Redis
Migrate to SQLite
2024-03-06 17:02:59 +01:00

32 lines
634 B
PHP
Executable File

<?php
use App\Helpers\HtmxResponse;
function generate_public_key($privateKeyPath, $publicKeyPath): void
{
chmod($privateKeyPath, 0400);
exec("ssh-keygen -y -f {$privateKeyPath} > {$publicKeyPath}");
}
function generate_key_pair($path): void
{
exec("ssh-keygen -t ed25519 -m PEM -N '' -f {$path}");
chmod($path, 0400);
}
/**
* @throws Exception
*/
function date_with_timezone($date, $timezone): string
{
$dt = new DateTime('now', new DateTimeZone($timezone));
$dt->setTimestamp(strtotime($date));
return $dt->format('Y-m-d H:i:s');
}
function htmx(): HtmxResponse
{
return new HtmxResponse();
}