Esempio n. 1
0
    if (file_exists($prefix . '/.maintenance')) {
        require_once $prefix . '/.maintenance';
    }
}
require_once $prefix . '/lib/general.lib.php';
require_once $prefix . '/lib/class/ampconfig.class.php';
require_once $prefix . '/lib/class/core.class.php';
// Define some base level config options
AmpConfig::set('prefix', $prefix);
// Register autoloaders
spl_autoload_register(array('Core', 'autoload'), true, true);
$composer_autoload = $prefix . '/lib/vendor/autoload.php';
if (file_exists($composer_autoload)) {
    require_once $composer_autoload;
    require_once $prefix . '/lib/vendor/Afterster/php-echonest-api/lib/EchoNest/Autoloader.php';
    EchoNest_Autoloader::register();
}
// Check to see if this is http or https
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
    $http_type = 'https://';
} else {
    $http_type = 'http://';
}
if (isset($_SERVER['HTTP_X_FORWARDED_PORT'])) {
    $http_port = $_SERVER['HTTP_X_FORWARDED_PORT'];
} else {
    if (isset($_SERVER['SERVER_PORT'])) {
        $http_port = $_SERVER['SERVER_PORT'];
    }
}
if (!isset($http_port) || empty($http_port)) {
 public function testAutoload()
 {
     $this->assertFalse(class_exists('FooBarFoo'), '->autoload() does not try to load classes that does not begin with EchoNest');
     $autoloader = new EchoNest_Autoloader();
     $this->assertNull($autoloader->autoload('Foo'), '->autoload() returns false if it is not able to load a class');
 }