<?php
/**
 * @version        Somao_Search X1.0 9:23 2012-1-1 Somao $
 * @package        Somao_Search.Site
 * @copyright      Copyright (c) 2009 - 2012, Somao, Inc.
 * @license        http://www.somao123.com/
 * @link           http://www.somao.cc/
 */
error_reporting(0);
define("PATH",getdirname(__FILE__));
define("ROOT","/");
session_save_path(PATH."data/sessions");
session_start();
require PATH."data/db_config.php";
require PATH."data/site_config.php";
require PATH."include/db_mysql.class.php";
require PATH."include/common.inc.php";
require PATH."include/global_func.php";
require PATH."include/global_sub_function.php";
require PATH."include/spider/spider_class.php";
require PATH."include/runtime.class.php";
require PATH."include/mac.class.php";
date_default_timezone_set('PRC');
$db=new db_mysql;
$db->connect($dbhost,$dbuser,$dbpw,$dbname,$dbpconnect,$dbcharset);
function getdirname($path=null){
	if (!empty($path)) {
		if (strpos($path,'\\')!==false) {
			return substr($path,0,strrpos($path,'\\')).'/';
		} elseif (strpos($path,'/')!==false) {
			return substr($path,0,strrpos($path,'/')).'/';
		}
	}
	return './';
}
//sphinx定义总开关
if($config["sphinx_article"]>0)
{
//require PATH."include/sphinxapi.php";  IIS下请注释掉、Apache下请加上。
require PATH."include/sphinx.class.php";
}
else
{
require PATH."include/search.class.php";
}
?>