Exception 'DBDoesNotExistException' has occurred

Exception:

At file: /mnt/gaf/gaf-cvs/public/lib/DB.php, line: 512

Stack trace

1 <ROOT>/lib/DB.php line 512?
  • Source
  • 505 $ret.=")";
    506
    507 return $ret;
    508 }
    509
    510 public function changeDatabase($name, $link) {
    511 if ( !mysql_select_db($name,$link) ){
    512 throw new DBDoesNotExistException(mysql_error($link));
    513 }
    514 }
    515 }
2 <ROOT>/search/search_new.php line 10page(logic, vars)
  • Source
  • Arguments
  • 3 if ($burl) {
    4 $BASE_URL = '../' . $BASE_URL;
    5 }
    6 require_once __DIR__.'/../lib/common.php';
    7 require_once __DIR__.'/../util/messages.php';
    8
    9
    10 page('logic', $vars);
    11
    12 function logic() {
    13 global $SSL_BASE_URL;
    14 $vars = array();
    15
    16 $input = FormInput::getGetInput();
    17 $is_auth = auth();
  • logic string (5) "logic"
    vars NULL
3 <ROOT>/lib/common.php line 215exec_func(logic, vars)
  • Source
  • Arguments
  • 208 try {
    209 // if this is admin, we need to turn off cache - do not cache language
    210 if (is_admin()) {
    211 header("Cache-control: no-cache");
    212 }
    213
    214 set_translator_language();
    215 exec_func($logic,$vars);
    216 } catch (RequireCaptchaException $e) {
    217 echo $e->getCaptchaBreakpoint()->getVerificationForm($e->reason);
    218 } catch (ValidationException $e) {
    219 header('HTTP/1.0 400 Bad Request');
    220 }
    221 disconnect_db();
    222 } else
  • logic string (5) "logic"
    vars NULL
4 <ROOT>/lib/common.php line 139logic()
  • Source
  • 132 return $urlParts['scheme']."://".$urlParts['host'].(($urlParts['port']!='')?":".$urlParts['port']:"").$_SERVER['REQUEST_URI'];
    133 }
    134
    135 function exec_func($logic,&$vars)
    136 {
    137 $func = str_replace("/","_",$logic);
    138 if (function_exists($func)) {
    139 echo $func();
    140 } else if (file_exists(__DIR__."/../htm/$logic.htm")) {
    141 echo get_template($logic,$vars);
    142 } else
    143 echo "Not found $logic.php";
    144 }
    145
    146 function getmicrotime(){
5 <ROOT>/search/search_new.php line 49BrowseProjectUtil::isTagBanned(tag)
  • Source
  • Arguments
  • 42
    43 $vars = get_variant($input['t'], $vars);
    44 $searchTerm = $input['keyword'];
    45 if (!$searchTerm || $searchTerm == '') {
    46 $searchTerm = $input['tag'];
    47 }
    48
    49 if ($searchTerm && BrowseProjectUtil::isTagBanned(preg_replace('/[-_]/', ' ', $searchTerm))) {
    50 return get_error_404('Page Not Found');
    51 } else if ($searchTerm && $pageType != '/search/') {
    52 $redirect = BrowseProjectUtil::tagShouldRedirect(preg_replace('/[-_]/', ' ', $searchTerm));
    53 if ($redirect && $redirect[0]['t_to']) {
    54 header("HTTP/1.1 301 Moved Permanently");
    55 header('Location: ' . $pageType . str_replace(' ', '-', $redirect[0]['t_to']) . '/');
    56 exit();
  • tag string (43) "phone camera module interface specification"
6 <ROOT>/util/classes/project/browse/BrowseProjectUtil.php line 52DB::changeDatabase(name, link)
  • Source
  • Arguments
  • 45
    46 /* Filter out hidden tags*/
    47 $sql = "SELECT * FROM tags WHERE tag = %s and hidden = 'Y';";
    48
    49 $config = GafConfig::get();
    50
    51 $db_link = @mysql_connect($config->db->tags->slave->host, $config->db->tags->slave->user, $config->db->tags->slave->password);
    52 DB::changeDatabase($config->db->tags->slave->db, $db_link);
    53 $res = DB::queryLink($db_link, $sql, array($tag));
    54
    55 return !$res->isEmpty();
    56 }
    57
    58 public static function tagShouldRedirect($tag) {
    59
  • name string (8) "gaf_tags"
    link bool FALSE