function user_log($errno, $errmsg, $file, $line) { // время события $timestamp = date('d.m.Y H:i:s'); //формируем новую строку в логе $err_str = $timestamp . ' - '; $err_str .= $file . ' | '; $err_str .= 'Line:' . $line . ' - '; $err_str .= $errmsg; $err_str .= "\n\n" . print_r(debug_backtrace(), true) . '===========================================' . "\n\n"; $file = str_replace(basename($file), '<b>' . basename($file) . '</b>', $file); if ($_SERVER['REMOTE_ADDR'] == '127.0.0.1' || $_SERVER['REMOTE_ADDR'] == '195.68.140.26') { $GLOBALS['warnings'][] = $GLOBALS['ERROR_CODES'][$errno] . ':' . $errmsg . '|' . $file . ' at Line: <b>' . $line . '</b>'; print_rr($err_str); } else { if ($errno != E_NOTICE) { mail('*****@*****.**', 'Error:' . $_SERVER['HTTP_HOST'], $GLOBALS['ERROR_CODES'][$errno] . ':' . $errmsg . '|' . $file . ' at Line: <b>' . $line . '</b>' . $err_str); echo '<table height="100%" width="100%"> <tr> <td align="center"><h2>Sorry, the site is in the maintainance mode.</h2><br>Please visit us later.</td> </tr> </table>'; exit; echo $errmsg; } } }
public function findEa() { $result = self::$pdo->query("select * from socket_roles"); $result->setFetchMode(PDO::FETCH_ASSOC); foreach ($result as $list) { print_rr($list); } }
function defaultDatabaseErrorHandler($message, $info) { if (!error_reporting()) { return; } if (defined('AM_DEBUG')) { print_rr($info, 'MySQL Error Details'); } $GLOBALS['db']->log_error("MYSQL ERROR" . "<br />\n" . nl2br(print_r($info, true))); fatal_error($s = "MYSQL Error happened, script stopped. Website admin\n can find more details about the problem at CP -> Error Log", false); exit; }
public function show() { $sessionInfo = $this->session->all_userdata(); print_rr($sessionInfo); $rememberedUserInfo = get_cookie("timesheets_remembered_user"); print_rr($rememberedUserInfo); }
/*{END_PHP_INI_PATH}*/ // Set include paths. $ini_path = ini_get('include_path') . PATH_SEPARATOR . __PHP_PATH . PATH_SEPARATOR . __PHP_PATH . '/PEAR' . PATH_SEPARATOR . __PHP_PATH . '/Uthando' . PATH_SEPARATOR . __PHP_PATH . '/Uthando/Admin' . PATH_SEPARATOR . __PHP_PATH . '/Uthando/Admin/FileManager' . PATH_SEPARATOR . __PHP_PATH . '/Uthando/functions' . PATH_SEPARATOR . __SITE_PATH . '/modules' . PATH_SEPARATOR . __SITE_PATH . '/components'; set_include_path($ini_path); // Include functions. require_once 'functions.php'; $registry = new Admin_Registry(true); $registry->setSite(realpath(__SITE_PATH . '/../../uthando/ini/uthandoSites.ini.php')); $registry->loadIniFiles(array('admin_config' => 'uthandoAdmin', 'config' => 'uthando')); $registry->setDefaults(); if (isset($_POST['session'])) { $pwd = $_POST['session'][0]; $iv = $_POST['session'][1]; } $registry->sessionId = Utility::decodeString($pwd, $iv); $uthando = new UthandoAdmin($registry); try { $registry->db = new DB_Admin($registry); $registry->session = new Session($registry); UthandoUser::setUserInfo(); if ($uthando->authorize()) { $ushop = new UShop_Manager($registry); $ushop->fireEvent(!empty($_POST['action']) ? $_POST['action'] : null); } } catch (PDOException $e) { $registry->Error($e->getMessage()); print_rr($e->getMessage()); } $registry->db = null; unset($uthando, $registry); ob_end_flush();
function __error($errno, $errstr, $errfile, $errline) { if (!(error_reporting() & $errno)) { return; } $ef = @APPLICATION_ENV != 'debug' ? basename($errfile) : $errfile; switch ($errno) { case E_RECOVERABLE_ERROR: $msg = "<b>RECOVERABLE ERROR:</b> {$errstr}\nin line {$errline} of file {$errfile}"; if (APPLICATION_ENV == 'debug') { echo $msg; } $this->di->errorLogTable->log($msg); return true; case E_ERROR: case E_PARSE: case E_CORE_ERROR: case E_COMPILE_ERROR: case E_USER_ERROR: $this->di->errorLogTable->log("<b>ERROR:</b> {$errstr}\nin line {$errline} of file {$errfile}"); ob_clean(); amDie("ERROR [{$errno}] {$errstr}\nin line {$errline} of file {$ef}"); exit(1); case E_USER_WARNING: case E_WARNING: if (!defined('AM_DEBUG') || !AM_DEBUG) { return; } if (!defined('SILENT_AMEMBER_ERROR_HANDLER') && !(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')) { print "<b>WARNING:</b> {$errstr}\nin line {$errline} of file {$ef}<br />"; } $this->di->errorLogTable->log("<b>WARNING:</b> {$errstr}\nin line {$errline} of file {$errfile}"); break; case E_STRICT: case E_USER_NOTICE: case E_NOTICE: if (!defined('AM_DEBUG') || !AM_DEBUG) { return; } if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { return; } print_rr("<b>NOTICE:</b> {$errstr}\nin line {$errline} of file {$ef}<br />"); break; } }
public function has_valid_license($flush = false) { if (!$flush) { $has_valid_license = get_transient('gwp_has_valid_license'); if ($has_valid_license !== false) { return $has_valid_license == true; } } $license = GWPerks::get_license_key(); // 'check_license' is a standard EDD API action $api_params = self::get_api_args(array('edd_action' => 'check_license', 'license' => $license, 'item_name' => urlencode($this->get_product_name()))); $request_url = esc_url_raw(add_query_arg($api_params, GW_STORE_URL)); $response = wp_remote_get($request_url, self::get_request_args()); if (GravityPerks::is_debug()) { print_rr(array('request_url' => $request_url, 'response' => $response, '_SERVER' => $_SERVER)); } if (is_wp_error($response)) { return false; } $license_data = json_decode(wp_remote_retrieve_body($response)); if (is_object($license_data)) { // at some point EDD added 'site_inactive' status which indicates the license has not been activated for this // site even though it already might have been, go ahead and activate it and see if it is still active if (in_array($license_data->license, array('inactive', 'site_inactive'))) { $has_valid_license = $this->activate_license($license); } else { $has_valid_license = $license_data->license == 'valid'; } } else { $has_valid_license = false; } set_transient('gwp_has_valid_license', $has_valid_license ? 1 : 0, 60 * 60 * 24); // cache license daily return $has_valid_license; }
function sql_query($query) { $result = mysql_query($query) or die(mysql_error() . print_rr(debug_backtrace(), true)); $GLOBALS['queries'][] = $query; return $result; }
<?php $ACCESS_LEVEL = 2; include_once LIB_ROOT . '/users/user.class.php'; include_once DOC_ROOT . '/includes/authorization.php'; if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'find') { $query = "\n\t\tSELECT * FROM translines as t\n\t\tLEFT JOIN users as u ON u.id = t.user_id\n\t\tWHERE t.id='" . intval($_REQUEST['transaction_id']) . "' and t.status in ('1','2') LIMIT 1\n\t"; $transaction = mysql_fetch_assoc($dbh->query($query)); if ($transaction['id']) { $plan = new Plan($transaction['plan_id']); $user = new User($transaction['user_id']); $details = print_rr($transaction, true) . print_rr($plan, true) . print_rr($user, true); } $smarty->assign('transaction_details', $details); } $smarty->display('../default/admin/find_deposit.tpl');
function print_bt($title = "==BACKTRACE==") { /** print backtrace **/ print_rr(debug_backtrace(), $title); }
function _rest_debug($ch) { curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLINFO_HEADER_OUT, true); $response_data = curl_exec($ch); header('Content-Type: text/html'); print_rr('response_data:'); print_rr($response_data); // Request header print_rr('all curl info:'); print_rr(curl_getinfo($ch)); // Response header die(); }
public function dump() { print_rr($this); }
<?php include_once './inc/init.php'; include_once './inc/db.inc.php'; require './inc/order_page.inc.php'; $p = new show_page(); $p->pvar = "p"; $data = new DBSQL(); $sql = "select * from takeorder_s_class"; $list = $data->select($sql); $num = count($list); $p->set(4, $num); $sql .= " limit " . $p->limit(); $list = $data->select($sql); for ($i = 0; $i < count($list); $i++) { $id = $list[$i][k_id]; $subsql = "select * from takeorder_menu_list where class_id='{$id}'"; $sublist = $data->select($subsql); $list[$i][sub] = $sublist; } $pages = $p->output(1); print_rr($list); $smarty->assign("list", $list); $smarty->assign('pages', $pages); $smarty->display("choseitem.htm");
public function getREQUEST() { print_rr($_REQUEST); }