$v){ if(!is_array($v)) $data .= '$_POST['.$k.']=>'.$v." \n"; else{ foreach($v as $k1=>$v1){ $data .= '$_POST['.$k.']['.$k1.']=>'.$v1." \n"; } } } $line = '('.$_SERVER['REMOTE_ADDR'].')'.date('Y-m-d H:i:s - ')."|:"; $line .= '\n'.$_SERVER['REQUEST_URI'].'\n '; $line .= $data; $line = str_replace(chr(13).chr(10), '', $line); fputs($fLog, $line."\n"); fclose($fLog); } /** END POST LOG **/ try { //$parser = new \App\Communicate\Newsletter(); //$parser = new \App\Imports\ClientsImport(); $parser = new \System\Core\UrlParser (); } catch (\System\Core\Sysexception $e) { $error = $m->select("errorlog") ->insert(array('date'=>new \MongoDate(time()), 'request'=>$_SERVER['REQUEST_URI'], 'post'=>$_POST, 'get'=>$_GET, 'type'=>'SysException', 'error'=>array($e->getCode(), $e->getMessage()))) ->last_id(); require_once('app/components/blockaccess1.php'); }catch(\Exception $e){ $error = $m->select("errorlog") ->insert(array('date'=>new \MongoDate(time()), 'request'=>$_SERVER['REQUEST_URI'], 'post'=>$_POST, 'get'=>$_GET, 'type'=>'Exception', 'error'=>array($e->getCode(), $e->getMessage()))) ->last_id(); require_once('app/components/error_page.php'); //echo $e->getMessage(); } catch(\System\Core\CustomException $e){ $error = $m->select("errorlog") ->insert(array('date'=>new \MongoDate(time()), 'request'=>$_SERVER['REQUEST_URI'], 'post'=>$_POST, 'get'=>$_GET, 'type'=>'CustomException', 'error'=>array($e->getCode(), $e->getMessage()))) ->last_id(); require_once('app/components/blockaccess1.php'); //echo $e->getMessage(); } catch(\System\Core\CWarning $e){ $error = $m->select("errorlog") ->insert(array('date'=>new \MongoDate(time()), 'request'=>$_SERVER['REQUEST_URI'], 'post'=>$_POST, 'get'=>$_GET, 'type'=>'CWarning', 'error'=>array($e->getCode(), $e->getMessage()))) ->last_id(); require_once('app/components/blockaccess1.php'); //echo $e->getMessage(); } catch(\System\Core\EmailException $e){ $error = $m->select("errorlog") ->insert(array('date'=>new \MongoDate(time()), 'request'=>$_SERVER['REQUEST_URI'], 'post'=>$_POST, 'get'=>$_GET, 'type'=>'EmailException', 'error'=>array($e->getCode(), $e->getMessage()))) ->last_id(); require_once('app/components/blockaccess.php'); //echo $e->getCode()." :: ". $e->getMessage(); //debug_print_backtrace(); }