當前位置: 首頁>>代碼示例>>PHP>>正文


PHP showError函數代碼示例

本文整理匯總了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);
     }
 }
開發者ID:zhaojianhui129,項目名稱:implement2016,代碼行數:34,代碼來源:AdminProType.php

示例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');
    }
}
開發者ID:CamilleBouliere,項目名稱:LESS-PHP---Out-of-the-box,代碼行數:28,代碼來源:less_compiler.php

示例3: exception_handler

function exception_handler($exception)
{
    ob_end_clean();
    //logError($exception);
    showError($exception);
    exit;
}
開發者ID:agroff,項目名稱:FindPuppies,代碼行數:7,代碼來源:initialize.php

示例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;
            }
        }
    }
}
開發者ID:franksli,項目名稱:highcharts,代碼行數:27,代碼來源:import.php

示例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;
 }
開發者ID:xxhhmxx,項目名稱:Webstory,代碼行數:25,代碼來源:DataProvider.php

示例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');
}
開發者ID:shiyake,項目名稱:php-ihome,代碼行數:25,代碼來源:IAuthManage.php

示例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');
     }
 }
開發者ID:puwei163,項目名稱:puwei,代碼行數:29,代碼來源:GoodsController.class.php

示例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);
}
開發者ID:BackupTheBerlios,項目名稱:tf-b4rt-svn,代碼行數:8,代碼來源:logout.php

示例9: Close

 public static function Close($connection)
 {
     include_once 'error.php';
     // Đóng kết lối
     if (!@mysql_close($connection)) {
         showError();
     }
 }
開發者ID:realolliebee,項目名稱:closes-shop,代碼行數:8,代碼來源:DataProvider.php

示例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);
 }
開發者ID:khalid9th,項目名稱:ocAds,代碼行數:13,代碼來源:cItem.php

示例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;
    }
}
開發者ID:renlok,項目名稱:PhaosRPG,代碼行數:9,代碼來源:shop_functions.php

示例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;
 }
開發者ID:khalid9th,項目名稱:ocAds,代碼行數:15,代碼來源:Route.php

示例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;
 }
開發者ID:sdgdsffdsfff,項目名稱:51jhome_customerservice,代碼行數:62,代碼來源:helper.class.php

示例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 '';
}
開發者ID:dot-Sean,項目名稱:racktables-contribs,代碼行數:10,代碼來源:mandatory_attr.php

示例15: dispatch

 public function dispatch()
 {
     global $debug_mode;
     if ($debug_mode) {
         printGenericException($this);
         return;
     }
     showError($this->message);
     redirectUser(buildRedirectURL('index', 'default'));
 }
開發者ID:ivladdalvi,項目名稱:racktables,代碼行數:10,代碼來源:exceptions.php


注:本文中的showError函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。