<?php

require_once("db/AppManager.php");
$pm = AppManager::getPM();
$sql = "SELECT * FROM amazon_key";
$key = $pm->fetchResult($sql);
define('AWS_ACCESS_KEY_ID', $key[0]['aws_access_key_id']);
define('AWS_SECRET_ACCESS_KEY', $key[0]['aws_secret_key_id']);
define('APPLICATION_NAME', 'PHP-App');
define('APPLICATION_VERSION', '1.0');
define('MERCHANT_ID', $key[0]['merchant_id']);
define('MARKETPLACE_ID', $key[0]['market_place_id']);
define('CODICE', $key[0]['market_place']);
set_include_path(get_include_path() . PATH_SEPARATOR . '../../.');

function __autoload($className)
{
    $filePath = str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
    $includePaths = explode(PATH_SEPARATOR, get_include_path());

    foreach ($includePaths as $includePath) {
        if (file_exists(dirname(__FILE__) . "/" . $filePath)) {
            require_once $filePath;
            return;
        }
    }
}
