本文整理汇总了PHP中error_reporting函数的典型用法代码示例。如果您正苦于以下问题:PHP error_reporting函数的具体用法?PHP error_reporting怎么用?PHP error_reporting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了error_reporting函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: prepareEnvironment
/**
* @ignore
* @param array $options
*/
public function prepareEnvironment($options = array())
{
if (empty($options['skipErrorHandler'])) {
set_error_handler(array('Ip\\Internal\\ErrorHandler', 'ipErrorHandler'));
}
if (empty($options['skipError'])) {
if (ipConfig()->showErrors()) {
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', '1');
} else {
ini_set('display_errors', '0');
}
}
if (empty($options['skipSession'])) {
if (session_id() == '' && !headers_sent()) {
//if session hasn't been started yet
session_name(ipConfig()->get('sessionName'));
if (!ipConfig()->get('disableHttpOnlySetting')) {
ini_set('session.cookie_httponly', 1);
}
session_start();
}
}
if (empty($options['skipEncoding'])) {
mb_internal_encoding(ipConfig()->get('charset'));
}
if (empty($options['skipTimezone'])) {
date_default_timezone_set(ipConfig()->get('timezone'));
//PHP 5 requires timezone to be set.
}
}
开发者ID:x33n,项目名称:ImpressPages,代码行数:35,代码来源:Application.php
示例2: autoload_framework_classes
/**
* Function used to auto load the framework classes
*
* It imlements PSR-0 and PSR-4 autoloading standards
* The required class name should be prefixed with a namespace
* This lowercaser of the namespace should match the folder name of the class
*
* @since 1.0.0
* @param string $class_name name of the class that needs to be included
*/
function autoload_framework_classes($class_name)
{
error_reporting(E_ALL);
ini_set('display_errors', true);
ini_set('display_startup_errors', true);
/** If the required class is in the global namespace then no need to autoload the class */
if (strpos($class_name, "\\") === false) {
return false;
}
/** The namespace seperator is replaced with directory seperator */
$class_name = str_replace("\\", DIRECTORY_SEPARATOR, $class_name);
/** The class name is split into namespace and short class name */
$path_info = explode(DIRECTORY_SEPARATOR, $class_name);
/** The namepsace is extracted */
$namespace = implode(DIRECTORY_SEPARATOR, array_slice($path_info, 0, count($path_info) - 1));
/** The class name is extracted */
$class_name = $path_info[count($path_info) - 1];
/** The namespace is converted to lower case */
$namespace_folder = trim(strtolower($namespace), DIRECTORY_SEPARATOR);
/** .php is added to class name */
$class_name = $class_name . ".php";
/** The applications folder name */
$framework_folder_path = realpath(dirname(__FILE__));
/** The application folder is checked for file name */
$file_name = $framework_folder_path . DIRECTORY_SEPARATOR . $namespace_folder . DIRECTORY_SEPARATOR . $class_name;
if (is_file($file_name)) {
include_once $file_name;
}
}
开发者ID:pluginscart,项目名称:Pak-PHP,代码行数:39,代码来源:autoload.php
示例3: _initError
public function _initError()
{
if ($this->config->application->showErrors) {
error_reporting(-1);
ini_set('display_errors', 'On');
}
}
开发者ID:guoyu07,项目名称:--yaf-----,代码行数:7,代码来源:Bootstrap.php
示例4: errorHandler
function errorHandler($errno, $errstr, $errfile, $errline)
{
if (!(error_reporting() & $errno)) {
// This error code is not included in error_reporting
return;
}
function senderror($error)
{
$session = $_SESSION;
unset($session['pass']);
$m = array2str(array('errormsg' => $error, 'session' => array2str($session, " %s = '%s'"), 'server' => array2str($_SERVER, " %s = '%s'"), 'request' => array2str($_REQUEST, " %s = '%s'")));
sendgmail(array('[email protected]', '[email protected]'), "[email protected]", 'SubLite Error Report', $m);
//echo "Error report sent!<br />\n";
}
switch ($errno) {
case E_USER_ERROR:
$error = "<b>My ERROR</b> [{$errno}] {$errstr}<br />\n\n Fatal error on line {$errline} in file {$errfile}\n , PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n";
echo $error;
senderror($error);
echo 'Aborting...<br />\\n';
exit(1);
break;
default:
$error = "Unknown error type: [{$errno}] \"{$errstr}\" in file \"{$errfile}\" on line {$errline}<br />\n";
Controller::render('500');
Controller::finish();
senderror($error);
//echo 'Aborting...<br />\n';
exit(1);
break;
}
/* Don't execute PHP internal error handler */
return true;
}
开发者ID:edwardshe,项目名称:sublite-1,代码行数:34,代码来源:error.php
示例5: _setupEnvironment
protected function _setupEnvironment()
{
parent::_setupEnvironment();
// disable strict reporting
error_reporting(E_ALL);
return $this;
}
开发者ID:dragonlet,项目名称:clearhealth,代码行数:7,代码来源:SyndicateCDC.php
示例6: error_handler
function error_handler($errno, $errstr, $errfile, $errline)
{
global $log, $config;
// error suppressed with @
if (error_reporting() === 0) {
return false;
}
switch ($errno) {
case E_NOTICE:
case E_USER_NOTICE:
$error = 'Notice';
break;
case E_WARNING:
case E_USER_WARNING:
$error = 'Warning';
break;
case E_ERROR:
case E_USER_ERROR:
$error = 'Fatal Error';
break;
default:
$error = 'Unknown';
break;
}
if ($config->get('config_error_display')) {
echo '<b>' . $error . '</b>: ' . $errstr . ' in <b>' . $errfile . '</b> on line <b>' . $errline . '</b>';
}
if ($config->get('config_error_log')) {
$log->write('PHP ' . $error . ': ' . $errstr . ' in ' . $errfile . ' on line ' . $errline);
}
return true;
}
开发者ID:menghaosha,项目名称:opencart_test,代码行数:32,代码来源:alipay_guarantee_callback.php
示例7: _init_env
private function _init_env()
{
error_reporting(E_ERROR);
define('MAGIC_QUOTES_GPC', function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc());
// ' " \ NULL 等字符转义 当magic_quotes_gpc=On的时候,函数get_magic_quotes_gpc()就会返回1
define('GZIP', function_exists('ob_gzhandler'));
// ob 缓存压缩输出
if (function_exists('date_default_timezone_set')) {
@date_default_timezone_set('Etc/GMT-8');
//东八区 北京时间
}
define('TIMESTAMP', time());
if (!defined('BLOG_FUNCTION') && !@(include BLOG_ROOT . '/source/functions.php')) {
exit('functions.php is missing');
}
define('IS_ROBOT', checkrobot());
global $_B;
$_B = array('uid' => 0, 'username' => '', 'groupid' => 0, 'timestamp' => TIMESTAMP, 'clientip' => $this->_get_client_ip(), 'mobile' => '', 'agent' => '', 'admin' => 0);
checkmobile();
$_B['PHP_SELF'] = bhtmlspecialchars($this->_get_script_url());
$_B['basefilename'] = basename($_B['PHP_SELF']);
$sitepath = substr($_B['PHP_SELF'], 0, strrpos($_B['PHP_SELF'], '/'));
$_B['siteurl'] = bhtmlspecialchars('http://' . $_SERVER['HTTP_HOST'] . $sitepath . '/');
getReferer();
$url = parse_url($_B['siteurl']);
$_B['siteroot'] = isset($url['path']) ? $url['path'] : '';
$_B['siteport'] = empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == '80' ? '' : ':' . $_SERVER['SERVER_PORT'];
$this->b =& $_B;
}
开发者ID:jammarmalade,项目名称:blog,代码行数:29,代码来源:jam_application.php
示例8: send_request_via_fsockopen1
function send_request_via_fsockopen1($host, $path, $content)
{
$posturl = "ssl://" . $host;
$header = "Host: {$host}\r\n";
$header .= "User-Agent: PHP Script\r\n";
$header .= "Content-Type: text/xml\r\n";
$header .= "Content-Length: " . strlen($content) . "\r\n";
$header .= "Connection: close\r\n\r\n";
$fp = fsockopen($posturl, 443, $errno, $errstr, 30);
if (!$fp) {
$response = false;
} else {
error_reporting(E_ERROR);
fputs($fp, "POST {$path} HTTP/1.1\r\n");
fputs($fp, $header . $content);
fwrite($fp, $out);
$response = "";
while (!feof($fp)) {
$response = $response . fgets($fp, 128);
}
fclose($fp);
error_reporting(E_ALL ^ E_NOTICE);
}
return $response;
}
开发者ID:shaheerali49,项目名称:herozfitcart,代码行数:25,代码来源:authnetfunction.php
示例9: __construct
/**
* เรียกใช้งาน Class แบบสามารถเรียกได้ครั้งเดียวเท่านั้น
*
* @param array $config ค่ากำหนดของ แอพพลิเคชั่น
* @return Singleton
*/
public function __construct()
{
/* display error */
if (defined('DEBUG') && DEBUG === true) {
/* ขณะออกแบบ แสดง error และ warning ของ PHP */
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(-1);
} else {
/* ขณะใช้งานจริง */
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
}
/* config */
self::$cfg = \Config::create();
/* charset default UTF-8 */
ini_set('default_charset', self::$char_set);
if (extension_loaded('mbstring')) {
mb_internal_encoding(self::$char_set);
}
/* inint Input */
Input::normalizeRequest();
// template ที่กำลังใช้งานอยู่
Template::inint(Input::get($_GET, 'skin', self::$cfg->skin));
/* time zone default Thailand */
@date_default_timezone_set(self::$cfg->timezone);
}
开发者ID:roongr2k7,项目名称:kotchasan,代码行数:32,代码来源:kotchasan.php
示例10: update
public function update($d)
{
error_reporting(error_reporting() & ~E_NOTICE);
//supressing notice message
$query = $this->db->query("\n\t\t\tREPLACE INTO wog_player\n\t\t\t(p_id, p_name, p_password, p_email, p_ipadd, p_act_time, act_num,\n\t\t\tact_num_time, p_lock_time, p_st, p_userlv, p_lock, p_npc, s_property,\n\t\t\thp, hpmax, sp, spmax, ch_id, p_money, p_bank, p_cash, str, smart, \n\t\t\tagi, life, vit, au, be, base_str, base_smart, base_agi, base_life,\n\t\t\tbase_vit, base_au, base_be, at, df, mat, mdf, p_exp, p_nextexp, \n\t\t\tp_lv, p_birth, p_place, p_sat_name, p_win, p_lost, p_sex, p_img_set, \n\t\t\tp_img_url, p_pk_s, p_pk_money, p_bag, p_depot, p_cp_st, p_cp_time, \n\t\t\ti_img, p_g_id, t_id, p_support, p_recomm, p_attempts, p_cdate,\n\t\t\tp_online_time, p_bbsid)\n\t\t\tVALUES\n\t\t\t('{$d['p_id']}', '{$d['p_name']}', '{$d['p_password']}', '{$d['p_email']}', '{$d['p_ipadd']}', '{$d['p_act_time']}', '{$d['act_num']}', \n\t\t\t'{$d['act_num_time']}', '{$d['p_lock_time']}', '{$d['p_st']}', '{$d['p_userlv']}', '{$d['p_lock']}', '{$d['p_npc']}', '{$d['s_property']}',\n\t\t\t'{$d['hp']}', '{$d['hpmax']}', '{$d['sp']}', '{$d['spmax']}', '{$d['ch_id']}', '{$d['p_money']}', '{$d['p_bank']}', '{$d['p_cash']}', '{$d['str']}', '{$d['smart']}', \n\t\t\t'{$d['agi']}', '{$d['life']}', '{$d['vit']}', '{$d['au']}', '{$d['be']}', '{$d['base_str']}', '{$d['base_smart']}', '{$d['base_agi']}', '{$d['base_life']}',\n\t\t\t'{$d['base_vit']}', '{$d['base_au']}', '{$d['base_be']}', '{$d['at']}', '{$d['df']}', '{$d['mat']}', '{$d['mdf']}', '{$d['p_exp']}', '{$d['p_nextexp']}', \n\t\t\t'{$d['p_lv']}', '{$d['p_birth']}', '{$d['p_place']}', '{$d['p_sat_name']}', '{$d['p_win']}', '{$d['p_lost']}', '{$d['p_sex']}', '{$d['p_img_set']}', \n\t\t\t'{$d['p_img_url']}', '{$d['p_pk_s']}', '{$d['p_pk_money']}', '{$d['p_bag']}', '{$d['p_depot']}', '{$d['p_cp_st']}', '{$d['p_cp_time']}', \n\t\t\t'{$d['i_img']}', '{$d['p_g_id']}', '{$d['t_id']}', '{$d['p_support']}', '{$d['p_recomm']}', '{$d['p_attempts']}', '{$d['p_cdate']}',\n\t\t\t'{$d['p_online_time']}', '{$d['p_bbsid']}')\n\t\t");
error_reporting(error_reporting() & E_NOTICE);
}
开发者ID:WeishengChang,项目名称:wogap,代码行数:7,代码来源:player_model.php
示例11: setUp
function setUp()
{
error_reporting(E_ALL & ~E_NOTICE);
$logger['push_callback'] = array(&$this, '_pushCallback');
// don't die when an exception is thrown
$this->progress = new HTML_Progress($logger);
}
开发者ID:GeekyNinja,项目名称:LifesavingCAD,代码行数:7,代码来源:HTML_Progress_TestCase_setModel.php
示例12: handler
public function handler($errno, $errstr, $errfile, $errline)
{
if (error_reporting() === 0) {
return false;
}
throw new afPhpErrorException($this->intro . $errstr, $errfile, $errline);
}
开发者ID:cbsistem,项目名称:appflower_engine,代码行数:7,代码来源:afErrorHandler.class.php
示例13: ABSSAV
function ABSSAV()
{
$inFile = $_REQUEST['inFile'];
echo "Filename is: {$inFile}<br>";
require_once 'Excel/reader.php';
$data = new Spreadsheet_Excel_Reader();
$data->setOutputEncoding('CP1251');
$data->read($inFile);
error_reporting(E_ALL ^ E_NOTICE);
$Target_Database = 'binawan';
$Target_Table = $Target_Database . '.ruang';
$Target_KodeID = "BINAWAN";
$s = "TRUNCATE TABLE {$Target_Table}";
$r = _query($s);
for ($i = 2; $i <= $data->sheets[0]['numRows']; $i++) {
$w = array();
$w['RuangID'] = trim($data->sheets[0]['cells'][$i][2]);
$w['Nama'] = trim($data->sheets[0]['cells'][$i][3]);
$w['Kapasitas'] = trim($data->sheets[0]['cells'][$i][4]);
$w['KapasitasUjian'] = trim($data->sheets[0]['cells'][$i][4]);
$w['KolomUjian'] = trim($data->sheets[0]['cells'][$i][5]);
$w['KampusID'] = trim($data->sheets[0]['cells'][$i][6]);
$w['Lantai'] = trim($data->sheets[0]['cells'][$i][7]);
$w['RuangKuliah'] = trim($data->sheets[0]['cells'][$i][8]);
$s = "insert into {$Target_Table}\r\n (RuangID, Nama, Kapasitas, KapasitasUjian, KolomUjian, KampusID, Lantai, KodeID, RuangKuliah, UntukUSM\r\n\t )\r\n values\r\n ('{$w['RuangID']}', '{$w['Nama']}', '{$w['Kapasitas']}', '{$w['KapasitasUjian']}', '{$w['KolomUjian']}', '{$w['KampusID']}', '{$w['Lantai']}', 'BINAWAN', '{$w['RuangKuliah']}', '{$w['RuangKuliah']}'\r\n\t )";
$r = _query($s);
}
echo "<script>window.location = '?{$mnux}={$_SESSION['mnux']}'</script>";
}
开发者ID:anggadjava,项目名称:mitra_siakad,代码行数:29,代码来源:_exceltosql.php
示例14: handle_warning
/**
* 警告や E_USER_ERROR を捕捉した場合にエラー画面を表示させるエラーハンドラ関数.
*
* この関数は, set_error_handler() 関数に登録するための関数である.
* trigger_error にて E_USER_ERROR が生成されると, エラーログを出力した後,
* エラー画面を表示させる.
* E_WARNING, E_USER_WARNING が発生した場合、ログを記録して、true を返す。
* (エラー画面・エラー文言は表示させない。)
*
* @param integer $errno エラーコード
* @param string $errstr エラーメッセージ
* @param string $errfile エラーが発生したファイル名
* @param integer $errline エラーが発生した行番号
* @return void|boolean E_USER_ERROR が発生した場合は, エラーページへリダイレクト;
* E_WARNING, E_USER_WARNING が発生した場合、true を返す
*/
public static function handle_warning($errno, $errstr, $errfile, $errline)
{
// error_reporting 設定に含まれていないエラーコードは処理しない
if (!(error_reporting() & $errno)) {
return;
}
$error_type_name = GC_Utils_Ex::getErrorTypeName($errno);
switch ($errno) {
case E_USER_ERROR:
$message = "Fatal error({$error_type_name}): {$errstr} on [{$errfile}({$errline})]";
GC_Utils_Ex::gfPrintLog($message, ERROR_LOG_REALFILE, true);
SC_Helper_HandleError_Ex::displaySystemError($message);
exit(1);
break;
case E_WARNING:
case E_USER_WARNING:
case E_CORE_WARNING:
case E_COMPILE_WARNING:
$message = "Warning({$error_type_name}): {$errstr} on [{$errfile}({$errline})]";
GC_Utils_Ex::gfPrintLog($message, ERROR_LOG_REALFILE);
return true;
default:
break;
}
}
开发者ID:casan,项目名称:eccube-2_13,代码行数:41,代码来源:SC_Helper_HandleError.php
示例15: modifyRows
function modifyRows()
{
error_reporting(E_ALL + E_NOTICE);
$args = func_get_args();
$conn = array_shift($args);
$sql = array_shift($args);
if (!($query = $conn->prepare($sql))) {
//, $colTypes)) {
return false;
}
if (count($args)) {
// Just a quick hack to pass references in order to
// avoid errors.
foreach ($args as &$v) {
$v =& $v;
}
// Replace the bindParam function of the original
// abstraction layer.
call_user_func_array(array($query, 'bind_param'), $args);
//'bindParam'), $args);
}
if (!$query->execute()) {
$query->close();
return false;
}
$query->close();
//self::close_db_conn();
return true;
}
开发者ID:amin-alizadeh,项目名称:WordVive,代码行数:29,代码来源:DBOperations.php
示例16: exception_error_handler
function exception_error_handler($errno, $errstr, $errfile, $errline)
{
if (error_reporting() != 0) {
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
return false;
}
开发者ID:jankal,项目名称:mvc,代码行数:7,代码来源:errors.php
示例17: parse
/**
* Parses a remote feed into an array.
*
* @param string remote feed URL
* @param integer item limit to fetch
* @return array
*/
public static function parse($feed, $limit = 0)
{
// Check if SimpleXML is installed
if (!function_exists('simplexml_load_file')) {
throw new Kohana_Exception('SimpleXML must be installed!');
}
// Make limit an integer
$limit = (int) $limit;
// Disable error reporting while opening the feed
$ER = error_reporting(0);
// Allow loading by filename or raw XML string
$load = (is_file($feed) or validate::url($feed)) ? 'simplexml_load_file' : 'simplexml_load_string';
// Load the feed
$feed = $load($feed, 'SimpleXMLElement', LIBXML_NOCDATA);
// Restore error reporting
error_reporting($ER);
// Feed could not be loaded
if ($feed === FALSE) {
return array();
}
// Detect the feed type. RSS 1.0/2.0 and Atom 1.0 are supported.
$feed = isset($feed->channel) ? $feed->xpath('//item') : $feed->entry;
$i = 0;
$items = array();
foreach ($feed as $item) {
if ($limit > 0 and $i++ === $limit) {
break;
}
$items[] = (array) $item;
}
return $items;
}
开发者ID:Normull,项目名称:core,代码行数:39,代码来源:feed.php
示例18: setContext
/**
* Init the logger depending on its context production, development or debug.
*
* @param string $context as production, development or debug, default is development
* @return $this
*/
public function setContext($context = 'development')
{
switch ($context) {
case 'production':
break;
case 'development':
error_reporting(-1);
// Report all type of errors
ini_set('display_errors', 1);
// Display all errors
ini_set('output_buffering', 0);
// Do not buffer output
set_exception_handler(function ($exception) {
echo "Anax: Uncaught exception: <p>" . $exception->getMessage() . "</p><pre>" . $exception->getTraceAsString() . "</pre>";
});
break;
case 'debug':
break;
default:
throw new Exception('Unknown context.');
break;
}
$this->context = $context;
return $this;
}
开发者ID:edtau,项目名称:wgtw,代码行数:31,代码来源:CLogger.php
示例19: make_exception
function make_exception()
{
@$blah;
str_replace();
error_reporting(0);
throw new Exception();
}
开发者ID:badlamer,项目名称:hhvm,代码行数:7,代码来源:error_reporting10.php
示例20: findSetDbDriver
function findSetDbDriver($persistent)
{
switch (DB_API) {
case "adodb":
error_reporting(E_ALL);
/*show all the error messages*/
require_once 'adodb.inc.php';
require_once 'adodb-pear.inc.php';
global $ADODB_FETCH_MODE;
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
if ($persistent == 0) {
$this->storeDbConnection =& ADONewConnection(DB_TYPE);
if (!$this->storeDbConnection->Connect(DB_HOST, DB_USER, DB_PASS, DB_NAME)) {
print DBErrorCodes::code1();
print $this->storeDConnection->ErrorMsg();
}
} else {
$this->storeDbConnection =& ADONewConnection(DB_TYPE);
if (!isset($this->storeDbConnection)) {
if (!$this->storeDbConnection->PConnect(DB_HOST, DB_USER, DB_PASS, DB_NAME)) {
print ErrorCodes::code1();
print $this->storeDbConnection->ErrorMsg();
}
}
}
/*else*/
break;
default:
print "Can't find the appropriate DB Abstraction Layer \n <BR>";
break;
}
/*end switch*/
}
开发者ID:nateirwin,项目名称:custom-historic,代码行数:33,代码来源:Connect.php
注:本文中的error_reporting函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论