25/05/2012 2:04pm

PHP | Problem - config.php


<?php


global $project;
$project = 'mysite';

global $databaseConfig;
$databaseConfig = array(
"type" => 'MySQLDatabase',
"server" => '127.0.0.1:8889',
"username" => 'root',
"password" => 'root',
"database" => 'oset_db',
"path" => ''
);

MySQLDatabase::set_connection_charset('utf8');

// This line set's the current theme. More themes can be
// downloaded from http://www.silverstripe.org/themes/
SSViewer::set_theme('oset');

// Set the site locale
i18n::set_locale('en_GB');

// enable nested URLs for this site (e.g. page/sub-page/)
SiteTree::enable_nested_urls();

Director::set_environment_type("dev"); // 'live', 'dev', 'test'

// automatically flush cache in dev. mode

if (Director::isDev()) {
SSViewer::flush_template_cache();
SSViewer::set_source_file_comments(true);
}

// **************** FirePHP *************************************
$firephpLoaded = @include_once('FirePHPCore/fb.php'); // try to load firephp as a Pear Package
if ($firephpLoaded) $firephpStatus = "as Pear package.";
else {
$firephpLoaded = @include_once('../firephp/lib/FirePHPCore/fb.php'); // try to load firephp from an included folder
if ($firephpLoaded) $firephpStatus = "from a separate folder.";
else {
// if we still cant find firephp , we have to define the class ourselves to prevent errors
class FB {
public static function setEnabled($Enabled) { }
public static function log($Object, $Label=null) { }
public static function info($Object, $Label=null) { }
public static function warn($Object, $Label=null) { }
public static function error($Object, $Label=null) { }
public static function dump($Key, $Variable) { }
public static function trace($Label) { }
public static function table($Label, $Table) { }
}
function fb() { }
$firephpStatus = false;
}
}
// enable firephp
if ((Director::isDev()) OR (Director::isTest())) {

// show paths to used templates and includes as html-comments in output
SSViewer::set_source_file_comments(true);

// setup Firebug-logger
FB::setEnabled(true);

fb::log('SilverStripe in DEV! Firephp loaded ' .$firephpStatus);
}
// disable firephp
else {
FB::setEnabled(false);
}


Post Comment