• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP error类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中error的典型用法代码示例。如果您正苦于以下问题:PHP error类的具体用法?PHP error怎么用?PHP error使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了error类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($infos = false)
 {
     $displayErrors = false;
     if (!self::$pdoS) {
         if (empty($infos)) {
             require ROOT . 'config/bdd.php';
             $infos = $BDD['mysql'];
         }
         $displayErrors = @$infos['displayErrors'];
         try {
             self::$pdoS = new PDO('mysql:host=' . $infos['host'] . ';dbname=' . $infos['database'] . '', $infos['login'], $infos['password'], array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''));
             self::$pdoS->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
             $this->wake_up();
             return true;
         } catch (PDOException $erreur) {
             $error = new error();
             if ($displayErrors) {
                 $error->addError('Error : ' . $erreur->getMessage(), ERROR_PAGE);
             } else {
                 $error->addError('We can\'t display the page you asked for.', ERROR_PAGE);
             }
             return false;
         }
     }
     $this->wake_up();
 }
开发者ID:xtrem-creative,项目名称:legacy_php-framework,代码行数:26,代码来源:mysql.class.php


示例2: load

 /**
  * Loads the data for this ViewNode record from the database
  * @return ViewNode object (this)
  */
 function load($style = 'long')
 {
     global $DB, $CFG, $USER, $ERROR, $HUB_FLM, $HUB_SQL;
     try {
         $this->canview();
     } catch (Exception $e) {
         return access_denied_error();
     }
     $params = array();
     $params[0] = $this->viewid;
     $params[1] = $this->nodeid;
     $params[2] = $this->userid;
     $resArray = $DB->select($HUB_SQL->DATAMODEL_VIEWNODE_SELECT, $params);
     if ($resArray !== false) {
         $count = count($resArray);
         if ($count == 0) {
             $ERROR = new error();
             $ERROR->createNodeNotFoundError($this->nodeid);
             return $ERROR;
         } else {
             for ($i = 0; $i < $count; $i++) {
                 $array = $resArray[$i];
                 $this->xpos = stripslashes(trim($array['XPos']));
                 $this->ypos = $array['YPos'];
                 $this->creationdate = $array['CreationDate'];
                 $this->modificationdate = $array['ModificationDate'];
                 $this->node = new CNode($this->nodeid);
                 $this->node = $this->node->load($style);
             }
         }
     } else {
         return database_error();
     }
     return $this;
 }
开发者ID:uniteddiversity,项目名称:LiteMap,代码行数:39,代码来源:viewnode.class.php


示例3: error

 function error()
 {
     require 'Controllers/error.php';
     $controller = new error();
     $controller->index();
     return false;
 }
开发者ID:trongloikt192,项目名称:Project_Wahanda_Alternative,代码行数:7,代码来源:Bootstrap.php


示例4: captcha

 function captcha($sourceFolder, $moduleFolder, $uploadFolder, $urlRequestRoot, $cmsFolder, $length = 5)
 {
     $this->sourceFolder = $sourceFolder;
     $this->moduleFolder = $moduleFolder;
     $this->uploadFolder = $uploadFolder;
     $this->urlRequestRoot = $urlRequestRoot;
     $this->cmsFolder = $cmsFolder;
     // header('Content-type: image/png');
     $this->Length = $length;
     //$this->fontpath = dirname($_SERVER['SCRIPT_FILENAME']) . '/fonts/';
     global $sourceFolder, $moduleFolder;
     $this->fontpath = "{$sourceFolder}/{$moduleFolder}/form/captcha/fonts/";
     $this->fonts = $this->getFonts();
     $errormgr = new error();
     if ($this->fonts == FALSE) {
         //$errormgr = new error;
         $errormgr->addError('No fonts available!');
         $errormgr->displayError();
         //      	die();
     }
     if (function_exists('imagettftext') == FALSE) {
         $errormgr->addError('');
         $errormgr->displayError();
         //       die();
     }
     $this->stringGen();
     $this->makeCaptcha();
 }
开发者ID:ksb1712,项目名称:pragyan,代码行数:28,代码来源:captcha.class.php


示例5: Error

 public static function Error()
 {
     Session::flush('sure', Messages::_404());
     require_once SITE_PATH . '/app/controllers/error_controller.php';
     $control = new error();
     $control->index();
     return FALSE;
 }
开发者ID:ahmed-dinar,项目名称:JUSTAS,代码行数:8,代码来源:miscellaneous.php


示例6: Error

 public static function Error()
 {
     Session::flush('sure', '404: Page does not exists!<br/>Are you sure what you are looking for?');
     require_once SITE_PATH . '/app/controllers/error_controller.php';
     $control = new error();
     $control->index();
     return FALSE;
 }
开发者ID:WWAHIDAADNAN,项目名称:JUSTAS,代码行数:8,代码来源:miscellaneous.php


示例7: Not_have_Perm

 /**
  * Not have permition to view this page
  */
 public function Not_have_Perm()
 {
     /** @noinspection PhpIncludeInspection */
     require_once controllers_dir() . default_error();
     $err = new error();
     $err->error403();
     exit;
 }
开发者ID:shalvasoft,项目名称:MVC,代码行数:11,代码来源:controller.php


示例8: view

 public function view()
 {
     // Get URI vars
     $newsID = (int) uri::segment(3);
     // Get news entry
     if (!$newsID || !($news = $this->news_model->getEntry($newsID, 'in_view')) || !$news['active']) {
         error::show404();
     }
     // Do we have views enabled?
     if (config::item('news_views', 'news')) {
         // Update views counter
         $this->news_model->updateViews($newsID);
     }
     // Load ratings
     if (config::item('news_rating', 'news') == 'stars') {
         // Load votes model
         loader::model('comments/votes');
         // Get votes
         $news['user_vote'] = $this->votes_model->getVote('news', $newsID);
     } elseif (config::item('news_rating', 'news') == 'likes') {
         // Load likes model
         loader::model('comments/likes');
         // Get likes
         $news['user_vote'] = $this->likes_model->getLike('news', $newsID);
     }
     // Assign vars
     view::assign(array('newsID' => $newsID, 'news' => $news));
     // Set title
     view::setTitle($news['data_title']);
     // Set meta tags
     view::setMetaDescription($news['data_meta_description']);
     view::setMetaKeywords($news['data_meta_keywords']);
     // Load view
     view::load('news/view');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:35,代码来源:news.php


示例9: template

function template($file)
{
    global $template_loaded;
    $template_loaded = false;
    HOOK::run(str_replace('/', '_', "template_load_{$file}"));
    $template_name = defined('IN_ADMINCP') ? 'default' : getSetting('template');
    if (IN_MOBILE) {
        $mobilefile = ROOT . "./template/{$template_name}/mobile/{$file}.php";
        if (file_exists($mobilefile)) {
            return $mobilefile;
        }
        $mobilefile_default = ROOT . "./template/default/mobile/{$file}.php";
        if (file_exists($mobilefile_default)) {
            return $mobilefile_default;
        }
    }
    $path = ROOT . "./template/{$template_name}/{$file}.php";
    if (file_exists($path)) {
        return $path;
    }
    $path = ROOT . "./template/default/{$file}.php";
    if (file_exists($path)) {
        return $path;
    }
    error::system_error("Missing template '{$file}'.");
}
开发者ID:istobran,项目名称:Tieba_Sign,代码行数:26,代码来源:core.php


示例10: Forum_Controller

 /**
  * Forum_Controller constructor
  * @param string template	The base template to use for
  *							the specific page.
  */
 function Forum_Controller($template)
 {
     /* Globalize the settings and config arrays */
     global $_SETTINGS, $_USERGROUPS, $_ALLFORUMS;
     /* Make sure the default event class exists */
     if (!class_exists('DefaultEvent')) {
         exit('Yahtzee!');
     }
     /* Call the Controller Constructor */
     parent::Controller(new DefaultEvent());
     /* Create a new instance of Template */
     error::reset();
     $this->template =& new Template($template);
     if (error::grab()) {
         critical_error();
     }
     /* Set all of the setting values to the template */
     $this->template->setVarArray($_SETTINGS);
     /* Set the Jump To Box */
     $jump_to =& new AllForumsIterator($_ALLFORUMS);
     $this->template->setList('all_forums', $jump_to);
     /* Add the usergroups to the template */
     $usergroups =& new FAArrayIterator($_USERGROUPS);
     $this->template->setList('usergroups', $usergroups);
 }
开发者ID:BackupTheBerlios,项目名称:k4bb,代码行数:30,代码来源:forum.inc.php


示例11: bulk_verify

 /**
  * Provides the services/data_utils/bulk_verify service. This takes a report plus params (json object) in the $_POST
  * data and verifies all the records returned by the report according to the filter. Pass ignore=true to allow this to 
  * ignore any verification check rule failures (use with care!).
  */
 public function bulk_verify()
 {
     $db = new Database();
     $this->authenticate('write');
     $report = $_POST['report'];
     $params = json_decode($_POST['params'], true);
     $params['sharing'] = 'verification';
     $websites = $this->website_id ? array($this->website_id) : null;
     $this->reportEngine = new ReportEngine($websites, $this->user_id);
     try {
         // Load the report used for the verification grid with the same params
         $data = $this->reportEngine->requestReport("{$report}.xml", 'local', 'xml', $params);
         // now get a list of all the occurrence ids
         $ids = array();
         foreach ($data['content']['records'] as $record) {
             if ($record['record_status'] !== 'V' && (!empty($record['pass']) || $_POST['ignore'] === 'true')) {
                 $ids[$record['occurrence_id']] = $record['occurrence_id'];
                 $db->insert('occurrence_comments', array('occurrence_id' => $record['occurrence_id'], 'comment' => 'This record is assumed to be correct', 'created_by_id' => $this->user_id, 'created_on' => date('Y-m-d H:i:s'), 'updated_by_id' => $this->user_id, 'updated_on' => date('Y-m-d H:i:s')));
             }
         }
         $db->from('occurrences')->set(array('record_status' => 'V', 'verified_by_id' => $this->user_id, 'verified_on' => date('Y-m-d H:i:s'), 'updated_by_id' => $this->user_id, 'updated_on' => date('Y-m-d H:i:s')))->in('id', array_keys($ids))->update();
         echo count($ids);
         $db->from('cache_occurrences')->set(array('record_status' => 'V', 'cache_updated_on' => date('Y-m-d H:i:s')))->in('id', array_keys($ids))->update();
     } catch (Exception $e) {
         echo $e->getMessage();
         error::log_error('Exception during bulk verify', $e);
     }
 }
开发者ID:BirenRathod,项目名称:indicia-code,代码行数:33,代码来源:data_utils.php


示例12: verify

 /**
  * Function to support the services/data_cleaner/verify web-service. 
  * Receives a list of proposed records and applies verification rules to them, then
  * returns a list of verification notices.
  * Input is provided in the $_GET or $_POST data sent to the method as follows:
  * auth_token - read authorisation token
  * nonce - read nonce
  * sample - Provides details of the sample being verified. If verifying a list
  * of records from different places or dates then the sample entry can be ommitted or only partially
  * filled-in with the missing information provided on a record by record bases. A JSON formatted
  * object with entries for sample:survey_id, sample:date, sample:entered_sref and sample:entered_sref_system, plus 
  * optional sample:geom (WKT format).
  * occurrences - JSON format, provide an array of the occurrence record to verify. Each record is an object
  * with occurrence:taxa_taxon_list_id, an optional stage plus any of the values for the sample which need to be 
  * specified on a record by record bases. I.e. provide sample:date if the sample information sent
  * does not include a date, or a date is included but this record is for a different date.
  * rule_types - JSON formatted array of the rule types to run. If not provided, then all rule types are run.
  * E.g. ["WithoutPolygon","PeriodWithinYear"] to run just without polygon and period within year checks.
  * @return JSON A JSON array containing a list of notifications. Each notification is a JSON
  * object, with taxa_taxon_list_id and message properties.
  */
 public function verify()
 {
     // authenticate requesting website for this service
     $this->authenticate('read');
     if (isset($_REQUEST['sample'])) {
         $sample = json_decode($_REQUEST['sample'], true);
     }
     if (isset($_REQUEST['occurrences'])) {
         $occurrences = json_decode($_REQUEST['occurrences'], true);
     }
     if (empty($sample) || empty($occurrences)) {
         $this->response = 'Invalid parameters';
     } else {
         $db = new Database();
         // Create an empty template table
         $db->query("select * into temporary occdelta from cache_occurrences limit 0;");
         try {
             $this->prepareOccdelta($db, $sample, $occurrences);
             $r = $this->runRules($db);
             $db->query('drop table occdelta');
             $this->content_type = 'Content-Type: application/json';
             $this->response = json_encode($r);
         } catch (Exception $e) {
             $db->query('drop table occdelta');
             $this->response = "Query failed";
             error::log_error('Error occurred calling verification rule service', $e);
         }
     }
     $this->send_response();
 }
开发者ID:BirenRathod,项目名称:indicia-code,代码行数:51,代码来源:data_cleaner.php


示例13: delete

 public function delete()
 {
     // Get URI vars
     $slugID = urldecode(utf8::trim(uri::segment(4)));
     // Do we have a slug ID?
     if ($slugID == '') {
         error::show404();
     }
     // Get user
     if (!($user = $this->users_model->getUser($slugID)) || !$user['active'] || !$user['verified']) {
         error::show404();
     } elseif ($user['user_id'] == session::item('user_id')) {
         router::redirect($user['slug']);
     }
     // Does user exist?
     if (!($blocked = $this->users_blocked_model->getUser($user['user_id'], true))) {
         view::setError(__('no_blocked_user', 'users_blocked'));
         router::redirect('users/blocked');
     }
     // Delete blocked user
     $this->users_blocked_model->deleteBlockedUser(session::item('user_id'), $user['user_id']);
     // Success
     view::setInfo(__('user_unblocked', 'users_blocked'));
     router::redirect(input::get('page') ? 'users/blocked' : $user['slug']);
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:25,代码来源:blocked.php


示例14: run_controller

 public function run_controller($in_action = false)
 {
     // Инициализируем класс контроллера
     $class = 'controller_' . $this->request->controller;
     if (!class_exists($class) && $this->config->fallback_controller) {
         $class = 'controller_' . $this->config->fallback_controller;
     }
     if (!class_exists($class)) {
         if ($in_action) {
             $class = 'controller_error';
         } else {
             error::call('Not Found', 404);
         }
     }
     $this->controller = new $class($this->request, $this->response);
     ob_start();
     $this->plugin_action('controller_before');
     // Хук, до выполнения экшена контроллера
     $this->controller->before();
     // Запускаем основной экшн
     $action = $this->request->action . '_action';
     $this->controller->{$action}($this->request->param);
     $this->plugin_action('controller_after');
     // Хук, после выполнения экшена контроллера
     $this->controller->after();
     // Запускаем ренедер контента
     $this->controller->render();
     $this->plugin_action('controller_render');
 }
开发者ID:s-kalaus,项目名称:ekernel,代码行数:29,代码来源:application.php


示例15: nxd_check_config

function nxd_check_config($item)
{
    if (!isset($GLOBALS['nxd_config'][$item])) {
        return error::instance()->fatal('Missing configuration item requested', $item);
    }
    return $GLOBALS['nxd_config'][$item];
}
开发者ID:nextdo,项目名称:Next-Do,代码行数:7,代码来源:nxd_config.php


示例16: sendTemplate

 public function sendTemplate($keyword, $email, $tags = array(), $language = '')
 {
     loader::model('system/emailtemplates');
     if (!$language) {
         $language = config::item('language_id', 'system');
     }
     if (is_numeric($language)) {
         $language = config::item('languages', 'core', 'keywords', $language);
     } elseif (!in_array($language, config::item('languages', 'core', 'keywords'))) {
         return false;
     }
     if (!($template = config::item($keyword . '_' . $language, '_system_emails_cache'))) {
         if (!($template = $this->cache->item('core_email_template_' . $keyword . '_' . $language))) {
             $template = $this->emailtemplates_model->prepareTemplate($keyword, $language);
             if (count($template) == 3) {
                 if ($template[$keyword]['active']) {
                     $template = array('subject' => $template[$keyword]['subject'], 'message_html' => utf8::trim($template['header']['message_html'] . $template[$keyword]['message_html'] . $template['footer']['message_html']), 'message_text' => utf8::trim($template['header']['message_text'] . "\n\n" . $template[$keyword]['message_text'] . "\n\n" . $template['footer']['message_text']));
                 } else {
                     $template = 'none';
                 }
             } else {
                 error::show('Could not fetch email template from the database: ' . $keyword);
             }
             $this->cache->set('core_email_template_' . $keyword . '_' . $language, $template, 60 * 60 * 24 * 30);
         }
         config::set(array($keyword . '_' . $language => $template), '', '_system_emails_cache');
     }
     $retval = true;
     if (is_array($template) && $template) {
         $retval = $this->sendEmail($email, $template['subject'], $template['message_text'], $template['message_html'], $tags);
     }
     return $retval;
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:33,代码来源:email.php


示例17: ObjectToArray

 public static function ObjectToArray($object)
 {
     if (is_object($object)) {
         return (array) $object;
     } else {
         error::newError("HATA : {$object} bir obje değil");
     }
 }
开发者ID:vahitserifsaglam1,项目名称:ozsa-src,代码行数:8,代码来源:set.php


示例18: __construct

 public function __construct()
 {
     parent::__construct();
     if (!config::item('timeline_active', 'timeline') || !users_helper::isLoggedin()) {
         error::show404();
     }
     loader::model('timeline/notices', array(), 'timeline_notices_model');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:8,代码来源:notices.php


示例19: setDatas

 /**
  * @fn function setDatas($data)
  * @brief set all datas (array) in the class pager
  * @file pager.php
  * 
  * @param data                
  * @return		
  */
 public function setDatas($data)
 {
     if (!is_array($data)) {
         error::errorPager();
         return;
     }
     $this->result = $data;
 }
开发者ID:snickers54,项目名称:dblink,代码行数:16,代码来源:pager.php


示例20: makro

 public static function makro($name, $return)
 {
     if (is_callable($return)) {
         self::$functions[$name] = Closure::bind($return, null, get_class());
     } else {
         error::newError("{$name} e atadığınız fonksiyon çağrılabilir bir fonksiyon değildir");
     }
 }
开发者ID:vahitserifsaglam1,项目名称:ozsa-src,代码行数:8,代码来源:Form.php



注:本文中的error类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP es_cls_common类代码示例发布时间:2022-05-23
下一篇:
PHP erTranslationClassLhTranslation类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap