Minor changes
This commit is contained in:
parent
068542bc3a
commit
ee00f549be
2 changed files with 34 additions and 16 deletions
|
@ -23,27 +23,16 @@
|
|||
|
||||
if(isset($args['no-banner']) == false)
|
||||
{
|
||||
$basic_ascii = false;
|
||||
|
||||
if(isset($args['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');
|
||||
$basic_ascii = true;
|
||||
}
|
||||
|
||||
$banner_version = NCC_VERSION_BRANCH . ' ' . NCC_VERSION_NUMBER;
|
||||
$banner_version = str_pad($banner_version, 21);
|
||||
|
||||
$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);
|
||||
// TODO: Make copyright not hard-coded.
|
||||
print(\ncc\Utilities\Functions::getBanner(NCC_VERSION_BRANCH . ' ' . NCC_VERSION_NUMBER, 'Copyright (c) 2022-2022 Nosial', $basic_ascii) . PHP_EOL);
|
||||
}
|
||||
|
||||
|
||||
switch(strtolower($args['ncc-cli']))
|
||||
{
|
||||
|
|
|
@ -152,4 +152,33 @@
|
|||
|
||||
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