chore: code cleanup.

This commit is contained in:
James Cole
2023-05-29 13:56:55 +02:00
parent 7f7644c92f
commit 1b52147a05
295 changed files with 12418 additions and 12324 deletions

View File

@@ -91,6 +91,30 @@ class InstallController extends Controller
return view('install.index');
}
/**
* Create specific RSA keys.
*/
public function keys(): void
{
// switch on PHP version.
$keys = [];
// switch on class existence.
Log::info('Will run PHP8 code.');
$keys = RSA::createKey(4096);
[$publicKey, $privateKey] = [
Passport::keyPath('oauth-public.key'),
Passport::keyPath('oauth-private.key'),
];
if (file_exists($publicKey) || file_exists($privateKey)) {
return;
}
file_put_contents($publicKey, $keys['publickey']);
file_put_contents($privateKey, $keys['privatekey']);
}
/**
* @param Request $request
*
@@ -161,28 +185,4 @@ class InstallController extends Controller
return true;
}
/**
* Create specific RSA keys.
*/
public function keys(): void
{
// switch on PHP version.
$keys = [];
// switch on class existence.
Log::info('Will run PHP8 code.');
$keys = RSA::createKey(4096);
[$publicKey, $privateKey] = [
Passport::keyPath('oauth-public.key'),
Passport::keyPath('oauth-private.key'),
];
if (file_exists($publicKey) || file_exists($privateKey)) {
return;
}
file_put_contents($publicKey, $keys['publickey']);
file_put_contents($privateKey, $keys['privatekey']);
}
}