Beispiel #1
0
 function testConfigRead()
 {
     $c = new Dase_Config(BASE_PATH);
     $c->load('inc/config.php');
     $c->load('inc/local_config.php');
     $test = $c->getAppSettings('test');
     $this->assertTrue('dase' == $test);
 }
Beispiel #2
0
 function testDatabaseSelect()
 {
     $c = new Dase_Config(BASE_PATH);
     $c->load('inc/config.php');
     $c->load('inc/local_config.php');
     $db = new Dase_DB($c);
     $c = Dase_DBO_Collection::get($db, 'test');
     $this->assertTrue('Test Collection' == $c->collection_name);
 }
Beispiel #3
0
 function testDataIsCached()
 {
     $c = new Dase_Config(BASE_PATH);
     $c->load('inc/config.php');
     $c->load('inc/local_config.php');
     $cache = Dase_Cache::get($c);
     $cache->setData('my_cache_file', 'hello world');
     $data = $cache->getData('my_cache_file');
     $this->assertTrue('hello world' == $data);
 }
Beispiel #4
0
<?php

ini_set('include_path', BASE_PATH . '/lib');
function __autoload($class_name)
{
    $class_name = str_replace('_', '/', $class_name) . '.php';
    @(include $class_name);
}
//set up configuration object
$config = new Dase_Config(BASE_PATH);
$config->load('inc/config.php');
$config->load('inc/local_config.php');
if ($config->getAppSettings('force_https')) {
    if ('on' != $_SERVER['HTTPS']) {
        $secure_url = "https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
        header("Location:{$secure_url}");
    }
}
//imagemagick
define('CONVERT', $config->getAppSettings('convert'));
//log file
define('LOG_FILE', $config->getLogDir() . '/dase.log');
define('FAILED_SEARCH_LOG', $config->getLogDir() . '/failed_searches.log');
define('DEBUG_LOG', $config->getLogDir() . '/debug.log');
//log level
define('LOG_LEVEL', $config->getAppSettings('log_level'));
//media directory
define('MEDIA_DIR', $config->getMediaDir());
//db table prefix
define('TABLE_PREFIX', $config->getDb('table_prefix'));
//cache type
Beispiel #5
0
<?php

ini_set('include_path', BASE_PATH . '/lib');
function __autoload($class_name)
{
    $class_name = str_replace('_', '/', $class_name) . '.php';
    include $class_name;
}
//set up configuration object
$config = new Dase_Config(BASE_PATH);
$config->load('inc/config.php');
$config->load('inc/local_config.php');
define('SMARTY_CACHE_DIR', BASE_PATH . '/templates_c');
//timer
define('START_TIME', Dase_Util::getTime());