Location: PHPKode > projects > Thin PHP Framework > tool/setup-db/connect.php
<?php
	define('BASE', dirname(__FILE__).'/../..');
	require_once BASE.'/app/includes.php';
	require_once BASE.'/app/model/base/DBFactory.php';
	
	$dbenv = $db_i[$db_i['env']];

	// ------ DB ------ //
	function connect_DB()
	{		
		return DBFactory::getDBHandler();
	}

	// get the left part of the string from $fromst. ex: left_from("hide@address.com", "@");
    function left_from($st, $fromst)
    {
    	$p = strpos ($st, $fromst);
		if ($p === false) return $st; // not found $fromst
		return substr($st, 0, $p);
    }

Return current item: Thin PHP Framework