Minor changes
This commit is contained in:
parent
068542bc3a
commit
ee00f549be
2 changed files with 34 additions and 16 deletions
|
@ -23,28 +23,17 @@
|
||||||
|
|
||||||
if(isset($args['no-banner']) == false)
|
if(isset($args['no-banner']) == false)
|
||||||
{
|
{
|
||||||
|
$basic_ascii = false;
|
||||||
|
|
||||||
if(isset($args['basic-ascii']))
|
if(isset($args['basic-ascii']))
|
||||||
{
|
{
|
||||||
$banner = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'banner_basic');
|
$basic_ascii = true;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$banner = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'banner_extended');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$banner_version = NCC_VERSION_BRANCH . ' ' . NCC_VERSION_NUMBER;
|
// TODO: Make copyright not hard-coded.
|
||||||
$banner_version = str_pad($banner_version, 21);
|
print(\ncc\Utilities\Functions::getBanner(NCC_VERSION_BRANCH . ' ' . NCC_VERSION_NUMBER, 'Copyright (c) 2022-2022 Nosial', $basic_ascii) . PHP_EOL);
|
||||||
|
|
||||||
$banner_copyright = 'Copyright (c) 2022-2022 Nosial';
|
|
||||||
$banner_copyright = str_pad($banner_copyright, 30);
|
|
||||||
|
|
||||||
$banner = str_ireplace('%A', $banner_version, $banner);
|
|
||||||
$banner = str_ireplace('%B', $banner_copyright, $banner);
|
|
||||||
|
|
||||||
print($banner . PHP_EOL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
switch(strtolower($args['ncc-cli']))
|
switch(strtolower($args['ncc-cli']))
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -152,4 +152,33 @@
|
||||||
|
|
||||||
return $current_count;
|
return $current_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the banner for the CLI menu (Really fancy stuff!)
|
||||||
|
*
|
||||||
|
* @param string $version
|
||||||
|
* @param string $copyright
|
||||||
|
* @param bool $basic_ascii
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function getBanner(string $version, string $copyright, bool $basic_ascii=false): string
|
||||||
|
{
|
||||||
|
if($basic_ascii)
|
||||||
|
{
|
||||||
|
$banner = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'banner_basic');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$banner = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'banner_extended');
|
||||||
|
}
|
||||||
|
|
||||||
|
$banner_version = str_pad($version, 21);
|
||||||
|
$banner_copyright = str_pad($copyright, 30);
|
||||||
|
|
||||||
|
$banner = str_ireplace('%A', $banner_version, $banner);
|
||||||
|
/** @noinspection PhpUnnecessaryLocalVariableInspection */
|
||||||
|
$banner = str_ireplace('%B', $banner_copyright, $banner);
|
||||||
|
|
||||||
|
return $banner;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue