Exemple #1
0
use Buan\Database;
use Buan\ModelRelation;
/*
# Config variables
*/
Config::set('app.command.urlPrefix', 'do');
Config::set('app.command.parameter', 'do');
Config::set('app.command.default', '');
Config::set('app.dir.controllers', dirname(dirname(__FILE__)) . '/controllers');
Config::set('app.dir.ignored', array('.', '..', '.svn', 'cvs'));
Config::set('app.docRoot', dirname(dirname(__FILE__)));
Config::set('app.domain', 'localhost');
Config::set('app.password', 'password');
Config::set('app.dir.databases', dirname(dirname(__FILE__)) . '/db');
AutoLoader::addClassPath(dirname(dirname(__FILE__)) . '/models');
AutoLoader::addClassPath(dirname(dirname(__FILE__)) . '/models/managers');
/*
# Database
*/
Database::addConnection(array('name' => 'default', 'driver' => 'sqlite', 'dsn' => 'sqlite:' . Config::get('app.dir.databases') . '/model.s3db'));
/* Alternative for testing whilst building test on dev machine
Database::addConnection(array(
	'name'=>'default',
	'driver'=>'mysql',
	'dsn'=>'mysql:host=localhost;dbname=buan_test',
	'username'=>'root',
	'password'=>''
));*/
/*
# Model relationships
*/
Exemple #2
0
Config::set('app.command.default', '/core');
Config::set('app.command.parameter', 'do');
Config::set('app.command.urlPrefix', '');
Config::set('app.dir.controllers', "{$__pwd}/app/controllers");
Config::set('app.dir.ignored', array('.', '..', '.svn', 'cvs'));
Config::set('app.docRoot', "{$__pwd}");
Config::set('app.domain', isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'localhost');
Config::set('app.password', 'admin');
Config::set('app.urlRoot', '');
/*
# Model and ModelManager class paths
# If you use Models and ModelManagers then add their locations to the global
# class path.
*/
AutoLoader::addClassPath("{$__pwd}/models");
AutoLoader::addClassPath("{$__pwd}/models/managers");
/*
# Database connections.
# You may add any number of database connections using Database::addConnection().
# If you are going to use databases at all, you MUST define one named "default".
#
# See documentation for "Database::addConnection()".
*/
/*
# Model relationships.
# Define all the relationships between your Models here.
#
# Sess documentation for "ModelRelation::define()".
*/
/*
# Custom setup