本文整理汇总了PHP中Error::showError方法的典型用法代码示例。如果您正苦于以下问题:PHP Error::showError方法的具体用法?PHP Error::showError怎么用?PHP Error::showError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Error
的用法示例。
在下文中一共展示了Error::showError方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: query
public function query($keyword, $index)
{
if ($error = $this->error()) {
Error::showError($error, 3003);
}
$index = empty($index) ? '*' : $index;
return self::$sphinx->query($keyword, $index);
}
示例2: filterParam
public function filterParam()
{
$data = isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : '';
unset($_GET, $_POST, $_SESSION, $_SERVER, $_COOKIE, $_FILES);
$json = json_decode($data, true);
if ($json) {
return $json;
} else {
Error::showError("POST DATA EMPTY", 1001);
}
}
示例3: execute
public function execute($sql)
{
$this->connect();
$result = mysql_query($sql, $this->dblink);
if ($result == false) {
Error::showError("Mysql Execute Error:" . mysql_error($this->dblink), 2004);
} else {
$numrows = mysql_affected_rows($this->dblink);
$last_insid = mysql_insert_id($this->dblink);
return $last_insid ? $last_insid : $numrows;
}
}
示例4: renderTemplate
/**
* return absolute path to selected template directory
* @param string $path path to file from views folder
* @param array $data array of data
* @param string $custom path to template folder
*/
public static function renderTemplate($path, $data = false, $custom = false)
{
self::init();
if (!headers_sent()) {
foreach (self::$headers as $header) {
header($header, true);
}
}
$file = "app/Templates/" . \HMC\Config::SITE_TEMPLATE() . "/{$path}.php";
if ($custom == false) {
if (file_exists($file)) {
require $file;
} else {
Logger::error('File (' . $file . ') was not found.');
Error::showError(500);
die;
}
} else {
require "app/Templates/{$custom}/{$path}.php";
}
}
示例5: die
<?php
if (@$magic != "0xDEADBEEF") {
die("This file cannot be executed directly");
}
if (@is_dir("setup")) {
$error = new Error("Setup directory exists. You either haven't installed your guestbook, or forgot to delete the setup folder.");
die($error->showError());
}
if (!file_exists("data.php")) {
$error = new Error("Data file doesn't exist. Have you installed your guestbook yet?");
die($error->showError());
}
require_once 'configuration.php';
if ($config['offline']) {
$error = new Error($config['offlineMessage']);
die($error->showError());
}
include_once 'classes/mobile/mobile.class.php';
if (Mobile::isMobile($_SERVER['HTTP_USER_AGENT'])) {
$config['guestbookTheme'] = $config['mobileTheme'];
}
示例6: _getSegmentParamFile
function _getSegmentParamFile($segment)
{
$filePath = $this->_getCustomSegmentParamFile($segment);
if (!is_file($filePath)) {
Error::showError("切片数据文件 " . $segment . " 不存在");
}
return $filePath;
}
示例7: _check
/**
* 检查初始化配置是否定义
*/
function _check()
{
if (!defined('APP_VIEWER') || !defined('APP_CONTROLLER')) {
Error::showError("you shoule config APP_VIEWER|APP_CONTROLLER");
}
}
示例8: field
public function field($table)
{
if (empty($this->field)) {
Error::showError('Field Empty', 1005);
}
$newField = array();
$index = Config::$index;
$cfield = $index[$table];
foreach ($this->field as $k => $v) {
if (isset($cfield[$k])) {
$newField[$k] = $v;
}
}
return $newField;
}