Wasting like <#DTT#> hrs and minutes here.. and no finish in sight

This commit is contained in:
2020-08-05 06:00:56 +02:00
parent 98d5d2147e
commit 74d64f93ba
4 changed files with 19 additions and 6 deletions

51
website.class.inc.php Normal file
View File

@ -0,0 +1,51 @@
<?php
/**
* Class website
* 2xx error codes
*/
class website
{
public function buildWebsite(): string
{
try
{
$website = file_get_contents( __DIR__ . '/website.html' );
$website = $this->replaceDefaultThings( $website );
$website = $this->setQuestions( $website );
return $website;
} catch( Exception $e )
{
throw new RuntimeException( 'Cannot load the website.html file', 201 );
}
}
private function replaceDefaultThings( $website )
{
$website = str_replace(
array(
'[LANG]', '[TITLE]', '[MAIN_TITLE]', '[DESCRIPTION]', '[PROJECT_DESCRIPTION]', '[HELP_US]', '[REQUEST_MORE]','[SOCIAL_MEDIA]', '[JOIN_DISCORD]' ),
array(
substr( language::$lang, 0, 2 ),
language::$lang_file[language::TITLE],
language::$lang_file[language::MAIN_TITLE],
language::$lang_file[language::DESCRIPTION],
language::$lang_file[language::PROJECT_DESCRIPTION],
language::$lang_file[language::HELP_US],
language::$lang_file[language::REQUEST_MORE],
language::$lang_file[language::SOCIAL_MEDIA],
language::$lang_file[language::JOIN_DISCORD]
), $website );
return $website;
}
private function setQuestions( $website ) : string
{
return $website; // todo
}
}