Ejemplo n.º 1
0
    exit;
}
require 'antie/php/antieframework.php';
// Enable javascript cache busting (this should be disabled in production mode)
$javascript_cache_busting = true;
// Set up application ID and path to framework configuration directory
$application_id = "calculatrice";
$antie_config_path = 'antie/config';
// Create an AntieFramework instance
$antie = new AntieFramework($antie_config_path);
// Get brand and model from url parameters, or use
// brand = default, model = webkit
$device_brand = isset($_GET['brand']) ? $_GET['brand'] : 'default';
$device_model = isset($_GET['model']) ? $_GET['model'] : 'webkit';
// Normalises to lower case with spaces replaced by underscores
$device_brand = $antie->normaliseKeyNames($device_brand);
$device_model = $antie->normaliseKeyNames($device_model);
// Framework device config files in format BRAND-MODEL-default.json
// Construct filename from this and config path
$device_configuration_name = $device_brand . "-" . $device_model;
$device_configuration_file_path = $antie_config_path . "/devices/" . $device_configuration_name . "-default.json";
// Load in device configuration
try {
    $device_configuration = @file_get_contents($device_configuration_file_path);
    if (!$device_configuration) {
        throw new Exception("Device ({$device_configuration_name}) not supported");
    }
} catch (Exception $e) {
    echo $e->getMessage();
    exit;
}