public static function GetAllFields()
 {
     global $database;
     $db_table = $database->config["database_fields"];
     $fields = $database->Select("SELECT * FROM " . $db_table);
     if (count($fields) > 0) {
         return json_encode(ConfigityField::ConvertArray($fields));
     }
     return ConfigityErrors::FieldNoRows();
 }
<?php

require 'configity-manager.php';
$clientKey = !empty($_GET["clientKey"]) ? $_GET["clientKey"] : "";
$fieldName = !empty($_GET["fieldName"]) ? $_GET["fieldName"] : "";
$method = $_GET["method"];
if ($clientKey == $database->config["configity_clientkey"]) {
    header('Content-Type: application/json');
    switch ($method) {
        case "FIELDS_SINGLE":
            echo ConfigityManager::GetField($fieldName);
            break;
        case "FIELDS_ALL":
            echo ConfigityManager::GetAllFields();
            break;
        default:
            echo ConfigityErrors::RequestError();
            break;
    }
} else {
    echo ConfigityErrors::WrongClientKey();
}
 public static function WrongMasterKey()
 {
     return ConfigityErrors::NewError("The sent master key doesn't match the servers master key, please check that the master key sent is correct!");
 }