예제 #1
0
파일: DB.php 프로젝트: radicaldesigns/amp
    if (isset($MM_HOSTNAME) && isset($MM_USERNAME) && isset($MM_PASSWORD) && isset($MM_DATABASE)) {
        if (isset($MM_DBTYPE)) {
            define('AMP_DB_TYPE', $MM_DBTYPE);
        }
        define('AMP_DB_HOST', $MM_HOSTNAME);
        define('AMP_DB_USER', $MM_USERNAME);
        define('AMP_DB_PASS', $MM_PASSWORD);
        define('AMP_DB_NAME', $MM_DATABASE);
    } elseif (!(defined('AMP_DB_HOST') && defined('AMP_DB_USER') && defined('AMP_DB_PASS') && defined('AMP_DB_NAME'))) {
        die("Incomplete database configuration. Please contact your system administrator.");
    }
} else {
    die("Couldn't find a local site configuration file. Please contact your system administrator.");
}
if (!isset($ADODB_CACHE_DIR) || !is_dir($ADODB_CACHE_DIR) || !is_writable($ADODB_CACHE_DIR)) {
    $ADODB_CACHE_DIR = AMP_urlFlip(AMP_LOCAL_PATH . '/cache');
}
if (!defined('AMP_BASE_PATH')) {
    define('AMP_BASE_PATH', $_SERVER['DOCUMENT_ROOT']);
}
if (!defined('AMP_BASE_INCLUDE_PATH')) {
    define('AMP_BASE_INCLUDE_PATH', $_SERVER['DOCUMENT_ROOT'] . '/include/');
}
// turn on APD debugger when set by config file
if (defined('AMP_DEBUG_MODE_APD') && AMP_DEBUG_MODE_APD && function_exists('apd_set_pprof_trace')) {
    apd_set_pprof_trace();
}
// Connect to the database.
if (!defined('AMP_DB_TYPE')) {
    define('AMP_DB_TYPE', 'mysql');
}
예제 #2
0
 function getURL($image_type = AMP_IMAGE_CLASS_OPTIMIZED)
 {
     if (array_search($image_type, $this->getImageClasses()) === FALSE) {
         return false;
     }
     if (strpos($this->filename, '/') !== FALSE) {
         return $this->filename;
     }
     $url_filename = AMP_IMAGE_PATH . $image_type . '/' . $this->filename;
     $url_filename = AMP_urlFlip($url_filename);
     return $url_filename;
 }