本文整理汇总了PHP中showError函数的典型用法代码示例。如果您正苦于以下问题:PHP showError函数的具体用法?PHP showError怎么用?PHP showError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了showError函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
/**
* 添加或修改项目类型
*/
function add()
{
$this->load->model('proTypeModel');
if ($_POST) {
$proTypeId = (int) $this->input->get('proTypeId');
$data = array('proTypeName' => $this->input->post('proTypeName'), 'statusIs' => (int) $this->input->post('statusIs'));
if ($proTypeId) {
if ($this->proTypeModel->edit(array('proTypeId' => $proTypeId), $data)) {
$this->proTypeModel->createCache();
showSuccess('修改项目类型成功');
} else {
showError('修改项目类型失败');
}
} else {
$data['createTime'] = time();
if ($this->proTypeModel->add($data)) {
$this->proTypeModel->createCache();
showSuccess('添加项目类型成功');
} else {
showError('添加项目类型失败');
}
}
} else {
$proTypeId = (int) $this->input->get('proTypeId');
if ($proTypeId) {
$proTypeData = $this->proTypeModel->getData(array('proTypeId' => $proTypeId));
$this->viewData['proTypeData'] = $proTypeData;
}
$this->load->view('AdminProType/add', $this->viewData);
}
}
示例2: parse_less
function parse_less($filename, $file)
{
global $less_file, $is_dev;
$options = array();
if ($is_dev) {
$options['sourceMap'] = true;
$options['sourceMapWriteTo'] = '../css/' . $file . '.map';
$options['sourceMapURL'] = '../css/' . $file . '.map';
} else {
$options['compress'] = true;
}
$options['cache_dir'] = '../css_cache';
try {
$parser = new Less_Parser($options);
$parser->parseFile($less_file, '../css/');
ob_start();
echo $parser->getCss();
$css = ob_get_contents();
ob_end_clean();
header("Content-type: text/css");
@file_put_contents('../css/' . $file . '.css', $css);
return $css;
} catch (Exception $e) {
header("Content-type: text/css");
echo '/* LESS ERROR : ' . "\n\n" . $e->getMessage() . "\n\n" . '*/';
showError($file . '.less');
}
}
示例3: exception_handler
function exception_handler($exception)
{
ob_end_clean();
//logError($exception);
showError($exception);
exit;
}
示例4: rebuildHistory
function rebuildHistory()
{
$states = array('open', 'closed');
foreach ($states as $state) {
$page = 1;
$lastPage = $page + 9;
while ($page <= $lastPage) {
$file = getSSLPage("https://api.github.com/repos/highslide-software/highcharts.com/issues" . "?page={$page}&state={$state}");
$issues = json_decode($file);
if (is_array($issues)) {
if (sizeof($issues) === 0) {
echo "--- No more {$state} issues ---";
break;
}
echo "\n<h2>Page: {$state} {$page}</h2>\n";
foreach ($issues as $i => $issue) {
echo '#' . $issue->number . ', ';
}
file_put_contents("pages/{$state}-{$page}.json", $file);
$page++;
} else {
showError($issues);
break;
}
}
}
}
示例5: executeQuery
public static function executeQuery($sql)
{
include 'db.inc';
include_once 'error.inc';
// 1. Tao ket noi CSDL
if (!($connection = mysql_connect($hostName, $username, $password))) {
die("couldn't connect to localhost");
}
if (!mysql_select_db($databaseName, $connection)) {
showError();
}
//2. Thiet lap font Unicode
if (!mysql_query("set names 'utf8'")) {
showError();
}
// Thuc thi cau truy van
if (!($result = mysql_query($sql, $connection))) {
showError();
}
// Dong ket noi CSDL
if (!mysql_close($connection)) {
showError();
}
return $result;
}
示例6: IAUTH_auth
function IAUTH_auth($appid, $uid, $rightStr, $state = '', $faile_t = '2036-12-31 23:59:59')
{
Check($appid, 'appid');
Check($uid, 'uid');
if (intval($uid) <= 0) {
showError('use manage function instead');
}
Check($faile_t, 'faile_t');
$rights = Check($rightStr, 'rights');
$appType = GetAppInfo($appid, 'app_type');
IAUTH_remove_auth($uid, $appid);
if ($appType == 'WSC') {
Check($state, 'state');
$callback = GetAppInfo($appid, 'call_back');
$verifier = newVerifier('auth', $appid, $uid, $rights, $faile_t, '', '', $state);
accessLog('AUTH ' . $appid . ' ' . $uid . ' ' . $rightStr . ' ' . $faile_t . ' ' . $state);
return URL($callback) . 'verifier=' . $verifier . '&state=' . $state;
}
if ($appType == 'UAC') {
$verifier = newVerifier('auth', $appid, $uid, $rights, $faile_t);
accessLog('AUTH ' . $appid . ' ' . $uid . ' ' . $rightStr . ' ' . $faile_t);
return $verifier;
}
throw new IAuthException('db error');
}
示例7: add
/**
* 添加页面
* 重写父类的方法,父类的ADD方法满足不了要求
*/
public function add()
{
if (IS_POST) {
//获取数据
if ($this->model->create() !== false) {
//判断数据是否正确
//插入数据库
$requestData = I('post.');
//通过第三个参数告知不额外处理
$requestData['intro'] = I('post.intro', '', false);
if ($this->model->add($requestData) !== false) {
$this->success('添加成功', cookie('__forward__'));
return;
//防止后面代码执行
}
}
$this->error('操作错误' . showError($this->model));
} else {
//显示视图,调用钩子函数
$this->_before_edit_view();
//给页面分配树的数据
$this->assign('meta_title', '添加' . $this->meta_title);
$this->display('add');
}
}
示例8: logoutUser
function logoutUser()
{
global $cfg, $db;
$sql = "DELETE FROM tf_log WHERE user_id=" . $db->qstr($cfg["user"]) . " and action=" . $db->qstr($cfg["constants"]["hit"]);
// do the SQL
$result = $db->Execute($sql);
showError($db, $sql);
}
示例9: Close
public static function Close($connection)
{
include_once 'error.php';
// Đóng kết lối
if (!@mysql_close($connection)) {
showError();
}
}
示例10: index
/**
*
* @param string $id
* @return void
*/
public function index($id)
{
$item = $this->mItem->getItem($id);
if (!$item) {
showError('The classified of ad does not exist.', 'Not Found', 404);
}
redirect($item->link);
}
示例11: insert_shop_refill
function insert_shop_refill($shop_id, $item_type, $item_value_min, $item_value_growth, $item_value_growth_probability, $item_count_min)
{
$query = "replace into phaos_shop_refill\n ( shop_id, item_type, item_value_min, item_value_growth, item_value_growth_probability, item_count_min)\n values( '{$shop_id}', '{$item_type}', '{$item_value_min}', '{$item_value_growth}', '{$item_value_growth_probability}','{$item_count_min}')";
$req = mysql_query($query);
if (!$req) {
showError(__FILE__, __LINE__, __FUNCTION__, $query);
exit;
}
}
示例12: _getRequest
/**
*
* @access private
* @static
* @return string
*/
private static function _getRequest()
{
if (!Config::get('baseURL')) {
showError('The baseURL is not defined on config file.', 'baseURL Not Defined', 500);
}
$url_path = parse_url(baseURL(), PHP_URL_PATH);
$request = ltrim(rtrim(str_replace($url_path, '', $_SERVER['REQUEST_URI']), '/'), '/');
return $request;
}
示例13: getcontnet
/**
* 获取远程数据
* @access public
* @param $geturl string 远程请求URL
* @return String
*/
public function getcontnet($url = '', $referer = '', $post = '', $cookie = '', $cookiejar = '')
{
if (empty($url)) {
showError('缺少URL信息');
}
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
if (!$this->userAgent) {
$this->userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:8.0) Gecko/20100101 Firefox/8.0';
} else {
$this->userAgent = 'Baiduspider+(+http://www.baidu.com/search/spider.htm)';
}
curl_setopt($curl, CURLOPT_USERAGENT, $this->userAgent);
$post && ($this->post = $post);
if (!$this->post) {
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type:application/x-www-form-urlencoded"));
curl_setopt($curl, CURLOPT_ENCODING, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
}
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
//信息以文件流的形式返回,而不是直接输出。
$referer && ($this->referer = $referer);
if ($this->referer) {
curl_setopt($curl, CURLOPT_REFERER, $this->referer);
} else {
curl_setopt($curl, CURLOPT_AUTOREFERER, 1);
}
if ($this->post) {
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($this->post, '', '&'));
} else {
curl_setopt($curl, CURLOPT_POST, 0);
}
$cookie && ($this->cookie = $cookie);
if ($this->cookie) {
curl_setopt($curl, CURLOPT_COOKIE, $this->cookie);
}
$cookiejar && ($this->cookiejar = $cookiejar);
if ($this->cookiejar) {
$cookiepath = getcwd() . './' . $this->cookiejar;
curl_setopt($curl, CURLOPT_COOKIEJAR, $cookiepath);
curl_setopt($curl, CURLOPT_COOKIEFILE, $cookiepath);
}
curl_setopt($curl, CURLOPT_HEADER, 0);
$content = curl_exec($curl);
if (curl_errno($curl)) {
$content = '';
if (isset($_GET['debug'])) {
echo '<pre><b>错误:</b><br />' . curl_error($curl);
}
}
curl_close($curl);
// }
return $content;
}
示例14: requireMandatoryAttrGeneric
function requireMandatoryAttrGeneric($listsrc, $attr_id, $newval)
{
$object_id = getBypassValue();
$attrs = getAttrValues($object_id);
if (array_key_exists($attr_id, $attrs) && considerGivenConstraint(spotEntity('object', $object_id), $listsrc) && !mb_strlen($newval)) {
showError('Mandatory attribute "' . $attrs[$attr_id]['name'] . '" not set');
stopOpPropagation();
}
return '';
}
示例15: dispatch
public function dispatch()
{
global $debug_mode;
if ($debug_mode) {
printGenericException($this);
return;
}
showError($this->message);
redirectUser(buildRedirectURL('index', 'default'));
}