'Afrikaans',				# Afrikaans
	'ar' => 'العربية',					# Arabic
	'bg' => 'Български',				# Bulgarian
	'ca' => 'Català',					# Catalan
	'cs' => 'Česky',					# Czech
	'da' => 'Dansk',					# Danish
	'de' => 'Deutsch',					# German
	'el' => 'Ελληνικά',					# Greek
	'en' => 'English',					# English
	'es' => 'Español',					# Spanish
	'et' => 'eesti',					# Estonian
	'fi' => 'Suomi',					# Finnish
	'fo' => 'Føroyskt',					# Faroese
	'fr' => 'Français',					# French
	'gl' => 'Galego',					# Galician
	'hr' => 'hrvatski',					# Croatian
	'hu' => 'Magyar',					# Hungarian
	'is' => 'Íslenska',					# Icelandic
	'it' => 'Italiano',					# Italian
	'ja' => '日本語',					# Japanese
	'lt' => 'Lietuvių',					# Lithuanian
	'nl' => 'Nederlands',				# Dutch
	'no' => 'Norsk',					# Norwegian
	'pl' => 'Polski',					# Polish
	'pt' => 'Português',				# Portuguese
	'pt-br' => 'Português do Brasil',	# Brazilian Portuguese
	'ro' => 'Română',					# Romanian
	'ru' => 'Русский',					# Russian
	'sk' => 'Slovenčina',				# Slovak
	'sl' => 'Slovenščina',				# Slovenian
	'sv' => 'Svenska',					# Swedish
	'tr' => 'Türkçe',					# Turkish
	'uk' => 'Українська',				# Ukrainian
	'zh' => '中文',						# (Zhōng Wén) - Chinese
];
$gpversion			= gpversion; // @deprecated 3.5b2
$addonDataFolder	= $addonCodeFolder = false; // deprecated
$addonPathData		= $addonPathCode = false;
$wbErrorBuffer		= $gp_not_writable = $wbMessageBuffer = [];
require_once('deprecated.php');
/* from wordpress
 * wp-settings.php
 * see also classes.php
 */
// Fix for IIS, which doesn't set REQUEST_URI
if( empty($_SERVER['REQUEST_URI']) ){
	// IIS Mod-Rewrite
	if( isset($_SERVER['HTTP_X_ORIGINAL_URL']) ){
		$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];
	}else if( isset($_SERVER['HTTP_X_REWRITE_URL']) ){
		// IIS Isapi_Rewrite
		$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
	}else{
		// Use ORIG_PATH_INFO if there is no PATH_INFO
		if( !isset($_SERVER['PATH_INFO']) && isset($_SERVER['ORIG_PATH_INFO']) ){
			$_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];
		}
		// Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice)
		if( isset($_SERVER['PATH_INFO']) ){
			if( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] ){
				$_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
			}else{
				$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];
			}
		}
		// Append the query string if it exists and isn't null
		if( isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING']) ){
			$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
		}
	}
}
// Set default timezone in PHP 5.
if ( function_exists('date_default_timezone_set') ){
	date_default_timezone_set( 'UTC' );
}
/**
 * Error Handling
 * Display the error and a debug_backtrace if gpdebug is not false
 * If gpdebug is an email address, send the error message to the address
 * @return false Always returns false so the standard PHP error handler is also used
 *
 */
function showError($errno, $errmsg, $filename, $linenum, $vars=null, $backtrace=null): bool
{
	global $wbErrorBuffer, $addon_current_id, $page, $addon_current_version, $config, $addonFolderName;
	static $reported = [];
	$errortype = array (
		E_ERROR				=> 'Fatal Error',
		E_WARNING			=> 'Warning',
		E_PARSE				=> 'Parsing Error',
		E_NOTICE 			=> 'Notice',
		E_CORE_ERROR		=> 'Core Error',
		E_CORE_WARNING 		=> 'Core Warning',
		E_COMPILE_ERROR		=> 'Compile Error',
		E_COMPILE_WARNING 	=> 'Compile Warning',
		E_USER_ERROR		=> 'User Error',
		E_USER_WARNING 		=> 'User Warning',
		E_USER_NOTICE		=> 'User Notice',
		E_STRICT			=> 'Strict Notice',
		E_RECOVERABLE_ERROR => 'Recoverable Error',
		E_DEPRECATED		=> 'Deprecated',
		E_USER_DEPRECATED	=> 'User Deprecated',
	 );
	// for functions prepended with @ symbol to suppress errors
	$error_reporting = error_reporting();
	if( $error_reporting === 0 ){
		return false;
	}
	// since we supported older versions of php, there may be a lot of strict errors
	if( $errno === E_STRICT ){
		return true;
	}
	//get the backtrace and function where the error was thrown
	if( !$backtrace ){
		$backtrace = debug_backtrace();
	}
	//remove showError() from backtrace
	if( strtolower($backtrace[0]['function']) == 'showerror' ){
		$backtrace = array_slice($backtrace, 1);
	}
	$backtrace = array_slice($backtrace, 0 ,7);
	//record one error per function and only record the error once per request
	if( isset($backtrace[0]['function']) ){
		$uniq = $filename.$backtrace[0]['function'];
	}else{
		$uniq = $filename . $linenum;
	}
	if( isset($reported[$uniq]) ){
		return false;
	}
	$reported[$uniq] = true;
	//disable showError after 20 errors
	if( count($reported) >= 20 ){
		restore_error_handler();
	}
	if( gpdebug === false ){
		//if it's an addon error, only report if the addon was installed remotely
		if( isset($addonFolderName) && $addonFolderName ){
			if( !isset($config['addons'][$addonFolderName]['remote_install'])  ){
				return false;
			}
		//if it's a core error, it should be in the include folder
		}elseif(!str_contains($filename, '/include/')){
			return false;
		}
		//record the error
		$i						= count($wbErrorBuffer);
		$args					= [];
		$args['en' . $i]		= $errno;
		$args['el' . $i]		= $linenum;
		$args['em' . $i]		= substr($errmsg,0,255);
		$args['ef' . $i]		= $filename; //filename length checked later
		if( isset($addon_current_id) ){
			$args['ea' . $i]	= $addon_current_id;
		}
		if( isset($addon_current_version) && $addon_current_version ){
			$args['ev' . $i]	= $addon_current_version;
		}
		if( is_object($page) && !empty($page->title) ){
			$args['ep' . $i]	= $page->title;
		}
		$wbErrorBuffer[$uniq]	= $args;
		return false;
	}
	$mess = '';
	$mess .= '