function loadfunc($funcname, $group)
{
if(function_exists($funcname))
{
return true;
}
else
{
require LIBDIR.$group.".php";
}
}
/**
*
* @param string $str
* @param array $ar
* @return bool
*/
function strOr($str, $ar)
{
$res = false;
foreach($ar as $a)
{
if($str == $a)$res = true;
}
return $res;
}
define ("stringa_date", "Y-m-d H:i:s");
/*-----------------------------------------------------------------
| Function : is_utf8
----------------------------------------------------------------*/
/**
* Detects if a string is utf8
* @param string $string
* @return bool
*/
function is_utf8($string) {
// From http://w3.org/International/questions/qa-forms-utf-8.html
return preg_match('%^(?:
[\x09\x0A\x0D\x20-\x7E] # ASCII
| [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
| \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs
| [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte
| \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates
| \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3
| [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
| \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
)*$%xs', $string);
}
/*-----------------------------------------------------------------
| Function : doStripSlashes
----------------------------------------------------------------*/
function doStripSlashes(&$item, $key){
if(is_array($item)){
array_walk($item, 'doStripSlashes');
}else{
$item = stripslashes($item);
}
}
/*-----------------------------------------------------------------
| More operation
----------------------------------------------------------------*/
if(defined('keep_magic_quotes') AND keep_magic_quotes == true){
//do nothing
}if(get_magic_quotes_gpc()){
//echo 'magic!';
array_walk($_GET, 'doStripSlashes');
array_walk($_POST, 'doStripSlashes');
array_walk($_COOKIE, 'doStripSlashes');
}
function _e($message){
echo gettext($message);
}
?>
function substr_if_longer($str, $len, $add = ''){
if(strlen($str) > $len+strlen($add)){
return substr($str, 0, $len).$add;
}else{
return $str;
}
}
?>
Fatal error: Uncaught exception 'MongoConnectionException' with message 'Failed to connect to: 127.0.0.1:27017: Connection refused' in /var/www/_ilpodere.it/engine/specific/model/bumip.php:26
Stack trace:
#0 /var/www/_ilpodere.it/engine/specific/model/bumip.php(26): Mongo->__construct('mongodb://127.0...')
#1 /var/www/_ilpodere.it/engine/specific/model/bumip.php(6): bumipModel->connectDb()
#2 /var/www/_ilpodere.it/engine/specific/controller/main.php(41): bumipModel->__construct()
#3 /var/www/_ilpodere.it/engine/specific/controller/recController.php(6): main->main()
#4 /var/www/_ilpodere.it/engine/webdraw/libraries/core/controller.php(126): recController->recController()
#5 /var/www/_ilpodere.it/engine/webdraw/webdraw.php(18): require('/var/www/_ilpod...')
#6 /var/www/_ilpodere.it/index.php(44): include('/var/www/_ilpod...')
#7 {main}
thrown in /var/www/_ilpodere.it/engine/specific/model/bumip.php on line 26