当前位置: 首页>>代码示例>>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;未经允许,请勿转载。