| |||||||||||||||||||||||||||||||||||||||||
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.zip1
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"
|
| $z=M("geo.zip1")->findOne( array("_id" => (int) $zip) );
| 1 : {"_id":89506}
| // NO $wh support in MONGO!!!
$zip = trim($zip);
$zip = substr($zip, 0, 5);
if ($wh)
\Log::alert("no _zip($wh) support");
$z=M("geo.zip1")->findOne( array("_id" => (int) $zip) );
if (! $z)
return [];
return [$z["region"], $z["city_id"], $z["city"], $z["state"], $z["city_main"],$z['loc']??[]];
}
/**
|
| $r = self::_zip($zip);
| 1 : 89506
| $r=reset($r);
return $r;
}
// location by zip
static function zip_location($zip) { // [lat,long]
$r = self::_zip($zip);
if (empty($r[5]))
return [];
return [$r[5][1],$r[5][0]];
}
// loc: [lon, lat] or ZIP
|
| $geo = Geo::zip_location($t);
| 1 : 89506
| // Modify Loc
static function resolveLoc(&$loc) { # null - already, 0 - not resolved, 1 - resolved (loc modified)
if (isset($loc["geo"]))
return;
if ($t=($loc["zip"]??0)) {
$geo = Geo::zip_location($t);
if($geo){
$loc["geo"] = $geo;
return 1;
}
}
| Geo
|
| 1 : {"street":"9215 Frem***no, NV","city_name":"Reno","state":"NV"}
| $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 : 70267770
| }
} 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 : 70267770
| 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 : 70267770
1 : {"cssTableClass":"ow*** 677-7008","f_phone7e":"(702) 677-7084"}
| 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 : 70267770
1 : {"cssTableClass":"ow*** 677-7008","f_phone7e":"(702) 677-7084"} 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:1754 M_Collection->findOne(Array) #2 lib.framework/Geo/Geo.php:721 Geo::_zip('...') #3 lib.framework/Geo/Geo.php:1793 Geo::zip_location(89506) #4 vhosts/phone/lib/Action/Phone/Root.php:430 Geo::resolveLoc(Array) #5 lib.framework/Action/Action.php:242 Action_Phone_Root->prefix7('...') #6 lib.framework/Action/Action.php:177 Action->_reflection_call('...') #7 lib.framework/Controller/Controller.php:265 Action->_call('...', '...') #8 lib.framework/Controller/Controller.php:169 Controller::action('...', Array) #9 vhosts/phone/phoneowner.us/www/index.php:2 Controller::dispatch('...', Array, '...') #10 {main}