| |||||||||||||||||||||||||||||||||||||
list($primary_server, $fallback_server) = self::sdc2connect($sdc);
Cache_SHM::put('mongo_dead_'.$primary_server, time(), 3600);
# if(PHP_SAPI == 'cli'){
# hash_unset(static::$is_dead, $primary_server);
# }
throw new MongoServerDeadException("mongo server $primary_server MONGO Exception: ".$e->getMessage());
}
static function isDead($server) { # bool
if(!isset(static::$is_dead[$server])){ // Check static flag first
static::$is_dead[$server] = (bool) Cache_SHM::get('mongo_dead_'.$server);
}
|
| M::onConnectionError($this->sdc, $e);
| 1 : geo.city
1 : {"xdebug_message":"<***./functions.php<b>:</b>535</td></tr>\n"}
| $fields=$this->_fields($fields);
#vd($fields);
try {
$r = $this->MC()->findOne($query, $fields);
} catch (MongoDB\Driver\Exception\ConnectionException $e) {
M::onConnectionError($this->sdc, $e);
}
Profiler::out();
return $r;
}
// SPECIAL query fields: ":sort", ":skip", ":limit"
|
| $c=M("geo.city")->findOne( array("region" => (int) $region, "city" => (int) $city) );
| 1 : {"region":34,"city":2764}
| }
static function city_location($region, $city, $main_city=true) { # loc[lat,long]
if ($main_city && $main_city_id=self::main_city($region, $city)){
$city = $main_city_id;
}
$c=M("geo.city")->findOne( array("region" => (int) $region, "city" => (int) $city) );
if (!$c)
return [];
return $c['loc'] ?? [];
}
/**
|
| $geo = Geo::city_location($loc["region"], $t);
| 1 : 34
1 : 2764
| }
}
if (isset($loc["region"])) {
$t = NVL($loc["city"]??0, $loc["city_main"]??0);
if ($t) {
$geo = Geo::city_location($loc["region"], $t);
if($geo){
$loc["geo"] = $geo;
return 1;
}
}
| Geo
|
| 1 : {"city":2764,"region*** NY","city_name":"Palmyra","state":"NY"}
| $d = Phone::p7_item($i, $phone, "prefix_listing");
if ($loc = ($i['loc']??'')) {
$l_key = ($loc['region']??'').'-'.($loc['city']??'');
if (!isset($prefix_info['locations'][$l_key]) && ($loc['city_state']??0)) {
list($loc['city_name'], $loc['state']) = HB::explode(', ', $loc['city_state'], 2);
Geo::resolveLoc($loc);
$loc['phones_cnt'] = 1;
$prefix_info['locations'][$l_key] = $loc;
} else {
$prefix_info['locations'][$l_key]['phones_cnt'] = ($prefix_info['locations'][$l_key]['phones_cnt']??0) + 1;
}
|
| return call_user_func_array( [$this, $method], $r);
| 1 : 80083250
| }
} catch(Exception $ex) {
\Log::alert( $ex->getMessage() );
}
try {
return call_user_func_array( [$this, $method], $r);
} catch(RedirectException $ex) {
return $ex->getMessage();
}
}
function page404() {
|
| return $this->_reflection_call($method);
| 1 : prefix7
| if (method_exists($this, $method) )
$mex=1;
}
}
if ($mex)
return $this->_reflection_call($method);
// use template name (same as url)
return $url;
}
/* internal */
// serve method (normal or gzipped)
|
| $r = $A->_call($method, $path);
| 1 : prefix7
1 : 80083250
| Profiler::disable();
CD::set("AJAX", 1);
}
Profiler::in("{$class}::$method", $p);
$A = new $class($p);
$r = $A->_call($method, $path);
Profiler::out();
//respect called action's desire to act as AJAX.
$is_ajax = CD("AJAX");
// AJAX methods - default - no templates
if ($is_ajax) {
|
| $template = self::action($url, $params); // PARAM by REF!
| 1 : 80083250
1 : {"cssTableClass":"ow*** 832-5015","f_phone7e":"(800) 832-5076"}
| self::$layout=$layout;
if ($r = strpos($url,"?"))
$url = substr($url, 0, $r);
$url = substr($url,1); // remove leading "/"
restore_msg($params);
$template = self::action($url, $params); // PARAM by REF!
if (isset($_GET['TPL']) ) {
echo "<div style='padding-left: 3px; background: #eee'>";
vvv($params);
echo "</div>";
}
|
| Controller::dispatch($_SERVER["REDIRECT_URL"], $_GET + $_POST, "_layout");
| 1 : 80083250
1 : {"cssTableClass":"ow*** 832-5015","f_phone7e":"(800) 832-5076"} 1 : _layout
| <?
Controller::dispatch($_SERVER["REDIRECT_URL"], $_GET + $_POST, "_layout");
exit; |
#0 lib.framework/ext/Mongo-PHP-ORM/M/Collection.php:569 M::onConnectionError('...', Object(MongoDB\Driver\Exception\ConnectionTimeoutException)) #1 lib.framework/Geo/Geo.php:1450 M_Collection->findOne(Array) #2 lib.framework/Geo/Geo.php:1802 Geo::city_location(34, 2764) #3 vhosts/phone/lib/Action/Phone/Root.php:430 Geo::resolveLoc(Array) #4 lib.framework/Action/Action.php:242 Action_Phone_Root->prefix7('...') #5 lib.framework/Action/Action.php:177 Action->_reflection_call('...') #6 lib.framework/Controller/Controller.php:265 Action->_call('...', '...') #7 lib.framework/Controller/Controller.php:169 Controller::action('...', Array) #8 vhosts/phone/phoneowner.us/www/index.php:2 Controller::dispatch('...', Array, '...') #9 {main}