spl_autoload_register(function ($className) {
    $namespace = str_replace("\\", "/", __NAMESPACE__);
    $className = str_replace("\\", "/", $className);
    $class = "classes/" . (empty($namespace) ? "" : $namespace . "/") . "{$className}.php";
    include_once $class;
});
try {
    $locale = $_GET['locale'];
    $type = $_GET['type'];
    $reactIntlEditor = new \ReactIntlEditor\ReactIntlEditor($locale);
    switch ($type) {
        case 'matching':
            $stringsArray = $reactIntlEditor->getMatchingStrings();
            break;
        case 'missing':
            $stringsArray = $reactIntlEditor->getMissingStrings();
            break;
        default:
            throw new \ReactIntlEditor\Exception('Unknown String Type Specified in Querystring');
            break;
    }
} catch (\ReactIntlEditor\Exception $e) {
    echo '<div style="color:black;border:3px solid red;padding:15px;max-width:800px;width:100%;">';
    echo '<p>An error has occured during startup:</p><p>' . $e->getMessage() . '</p>';
    echo '</div>';
    die;
}
?>
<html lang="en">
	<head>
		<title>React Intl Editor</title>