当前位置: 首页>>代码示例>>PHP>>正文


PHP PEAR::setErrorHandling方法代码示例

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


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

示例1: get

 function get()
 {
     $this->transObj = DB_DataObject::Factory('core_enum');
     $this->transObj->query('BEGIN');
     PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError'));
     $this->modules = $this->modulesList();
     $this->etype();
     $this->defaults();
     foreach ($this->defaults as $k => $v) {
         $enum = DB_DataObject::factory('core_enum');
         $enum->setFrom(array('etype' => $this->etype->name, 'name' => $k, 'active' => 1));
         if ($enum->find(true)) {
             continue;
         }
         $enum->display_name = $v;
         $enum->insert();
     }
     $notify = DB_DataObject::factory('core_notify');
     $notify->selectAdd();
     $notify->selectAdd("\n            DISTINCT(evtype) AS evtype\n        ");
     $types = $notify->fetchAll();
     foreach ($types as $t) {
         $enum = DB_DataObject::factory('core_enum');
         $enum->setFrom(array('etype' => $this->etype->name, 'name' => $t->evtype, 'active' => 1));
         if ($enum->find(true)) {
             continue;
         }
         $enum->display_name = $t->evtype;
         $enum->insert();
     }
     $this->jok('DONE');
 }
开发者ID:roojs,项目名称:Pman.Core,代码行数:32,代码来源:Core_notify.php

示例2: get

 /**
  * Accepts:
  * logout =
  * 
  * 
  */
 function get()
 {
     PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError'));
     //DB_DataObject::DebugLevel(1);
     if (!empty($_REQUEST['logout'])) {
         return $this->logout();
     }
     // general query...
     if (!empty($_REQUEST['getAuthUser'])) {
         //DB_Dataobject::debugLevel(5);
         $this->sendAuthUserDetails();
         exit;
     }
     // might be an idea to disable this?!?
     if (!empty($_REQUEST['username'])) {
         $this->post();
     }
     if (!empty($_REQUEST['switch'])) {
         $this->switchUser($_REQUEST['switch']);
     }
     if (!empty($_REQUEST['loginPublic'])) {
         $this->switchPublicUser($_REQUEST['loginPublic']);
     }
     $this->jerr("INVALID REQUEST");
     exit;
 }
开发者ID:roojs,项目名称:Pman.Base,代码行数:32,代码来源:Login.php

示例3: buildView

 /**
  * This function builds the main structure in HTML.
  *
  * @access public
  * @author kalmer:piiskop <pandeero@gmail.com>
  * @param string $parameters['address']
  *        	the address
  * @param string $parameters['blogDate']
  *        	the date of the blog
  * @param string $parameters['blogEntry']
  *        	the blog entry
  * @param Human $parameters['designer']
  *        	the designer
  * @param string $parameters['menu']
  *        	the body
  * @param string $parameters['phoneNumber']
  *        	the phone number
  * @param string $parameters['title']
  *        	the title
  * @param string $parameters['twitter']
  *        	the Twitter-time
  * @return string the parsed HTML-structure
  * @uses BEGINNING_OF_URL for links
  * @uses \pstk\ErrorView for displaying error messages
  * @uses MENU_COMMON for the common menu
  * @uses MENU_SIDE for the menu in sidebar
  */
 public static function buildView($parameters)
 {
     require_once 'HTML/Template/IT.php';
     require_once dirname(__FILE__) . '/../php/ErrorView.php';
     \PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array(new \pstk\ErrorView(), 'raiseError'));
     $tpl = new \HTML_Template_IT(ROOT_FOLDER . 'html');
     $tpl->loadTemplatefile('particle-template.html');
     if (isset($parameters['menus'])) {
         if (isset($parameters['menus'][MENU_COMMON])) {
             $tpl->setCurrentBlock('common-menu');
             $tpl->setVariable(array('COMMON-MENU' => $parameters['menus'][MENU_COMMON]));
             $tpl->parse('common-menu');
         }
         if (isset($parameters['menus'][MENU_SIDE])) {
             $tpl->setCurrentBlock('menu-in-sidebar');
             $tpl->setVariable(array('MENU-IN-SIDEBAR' => $parameters['menus'][MENU_SIDE]));
             $tpl->parse('menu-in-sidebar');
         }
     }
     if (isset($parameters['posts'])) {
         $tpl->setCurrentBlock('posts');
         $tpl->setVariable(array('POSTS' => $parameters['posts']));
         $tpl->parse('posts');
     }
     require_once dirname(__FILE__) . '/Model.php';
     $model = new Model();
     $model->setComplete();
     require_once dirname(__FILE__) . '/../php/CssView.php';
     $tpl->setCurrentBlock('html');
     $tpl->setVariable(array('ACTION' => '', 'BEGINNING-OF-URL' => BEGINNING_OF_URL, 'FOLLOW-ME' => $model->translate(array('property' => 'followMe')), 'HEADING' => $parameters['title'], 'OLDER-POSTS' => $model->translate(array('property' => 'olderPosts')), 'NEWER-POSTS' => $model->translate(array('property' => 'newerPosts')), 'SEARCH' => \pstk\String::translate('search'), 'SUBSCRIBE' => $model->translate(array('property' => 'subscribe')), 'STYLE' => \pstk\CssView::buildCss(array('fileName' => 'particle-template')), 'TITLE' => mb_strtoupper($parameters['title'], 'UTF-8')));
     $tpl->parse('html');
     return $tpl->get('html');
 }
开发者ID:piiskop,项目名称:pstk,代码行数:60,代码来源:View.php

示例4: R3AppInitDB

function R3AppInitDB()
{
    global $mdb2;
    global $dsn;
    require_once 'MDB2.php';
    if (!isset($dsn) || $dsn == '') {
        throw new Exception('Missing $dsn');
    }
    $txtDsn = $dsn['dbtype'] . '://' . $dsn['dbuser'] . ':' . $dsn['dbpass'] . '@' . $dsn['dbhost'] . '/' . $dsn['dbname'];
    $db = ezcDbFactory::create($txtDsn);
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    PEAR::setErrorHandling(PEAR_ERROR_EXCEPTION);
    $mdb2 = MDB2::singleton($txtDsn);
    // Needed by user manager and import/export
    ezcDbInstance::set($db);
    if (isset($dsn['charset'])) {
        $db->exec("SET client_encoding TO '{$dsn['charset']}'");
        $mdb2->exec("SET client_encoding TO '{$dsn['charset']}'");
    }
    if (isset($dsn['search_path'])) {
        $db->exec("SET search_path TO {$dsn['search_path']}, public");
        $mdb2->exec("SET search_path TO {$dsn['search_path']}, public");
    }
    $db->exec("SET datestyle TO ISO");
    $mdb2->exec("SET datestyle TO ISO");
}
开发者ID:r3-gis,项目名称:EcoGIS,代码行数:26,代码来源:eco_app.php

示例5: get

 function get($args, $opts = array())
 {
     PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError'));
     $this->checkSystem();
     HTML_FlexyFramework::get()->generateDataobjectsCache(true);
     $ff = HTML_FlexyFramework::get();
     if (!empty($ff->Core_Notify)) {
         //            require_once 'Pman/Core/NotifySmtpCheck.php';
         //            $x = new Pman_Core_NotifySmtpCheck();
         //            $x->check();
     }
     $this->disabled = explode(',', $ff->disable);
     //$this->fixSequencesPgsql();exit;
     $this->opts = $opts;
     // ask all the modules to verify the opts
     $this->checkOpts($opts);
     // do this first, so the innodb change + utf8 fixes column max sizes
     // this will trigger errors about freetext indexes - we will have to remove them manually.?
     // otherwise we need to do an sql query to find them, then remove them (not really worth it as it only affects really old code..)
     $this->runExtensions();
     if (empty($opts['data-only'])) {
         $this->importSQL();
     }
     if (!empty($opts['only-module-sql'])) {
         return;
     }
     $this->runUpdateModulesData();
     if (!empty($opts['add-company']) && !in_array('Core', $this->disabled)) {
         // make sure we have a good cache...?
         DB_DataObject::factory('core_company')->initCompanies($this, $opts);
     }
     $this->runExtensions();
 }
开发者ID:roojs,项目名称:Pman.Core,代码行数:33,代码来源:UpdateDatabase.php

示例6: civicrm_init

function civicrm_init()
{
    $config =& CRM_Core_Config::singleton();
    CRM_Core_DAO::init($config->dsn, $config->daoDebug);
    $factoryClass = 'CRM_Contact_DAO_Factory';
    CRM_Core_DAO::setFactory(new $factoryClass());
    // set error handling
    PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array('CRM_Core_Error', 'handle'));
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:9,代码来源:admin.civicrm.php

示例7: __construct

 function __construct($server, $serverenc, $serverport, $user, $pass)
 {
     $error = '';
     $this->_server = $server;
     $this->_serverenc = $serverenc;
     $this->_serverport = $serverport;
     $this->_user = $user;
     $this->_pass = $pass;
     # Set pear error handling to be used by exceptions
     PEAR::setErrorHandling(PEAR_ERROR_EXCEPTION);
     $this->_nntp = new Net_NNTP_Client();
 }
开发者ID:Nerd-alert,项目名称:spotweb,代码行数:12,代码来源:SpotNntp.php

示例8: __construct

 function __construct($server)
 {
     $error = '';
     $this->_connected = false;
     $this->_server = $server['host'];
     $this->_serverenc = $server['enc'];
     $this->_serverport = $server['port'];
     $this->_user = $server['user'];
     $this->_pass = $server['pass'];
     # Set pear error handling to be used by exceptions
     PEAR::setErrorHandling(PEAR_ERROR_EXCEPTION);
     $this->_nntp = new Net_NNTP_Client();
 }
开发者ID:rmeijer,项目名称:spotweb,代码行数:13,代码来源:SpotNntp.php

示例9: post

 function post()
 {
     PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError'));
     $this->sessionState(0);
     // turn off the session..
     $img = DB_DataObject::Factory('images');
     $img->setFrom(array('onid' => 0, 'ontable' => 'ipshead'));
     $img->onUpload(false);
     require_once 'File/Convert.php';
     $fc = new File_Convert($img->getStoreName(), $img->mimetype);
     $csv = $fc->convert('text/csv');
     $this->importCsv($csv);
 }
开发者ID:roojs,项目名称:Pman.Admin,代码行数:13,代码来源:Enum.php

示例10: registerNamespaced

 public static function registerNamespaced()
 {
     try {
         spl_autoload_register(array(self::instance(), 'autoloadNamespaced'));
     } catch (Exception $e) {
         throw new Exception('Error registering autoload<br />' . $e->getMessage(), $e->getCode());
     }
     try {
         PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array(self::instance(), 'error_to_exception'));
     } catch (Exception $e) {
         throw new Exception('Error setting PEAR_ERROR_CALLBACK');
     }
 }
开发者ID:phalasz,项目名称:aStyler,代码行数:13,代码来源:Autoload.php

示例11: buildLogo

 /**
  * This function creates a HTML-block for a logo.
  *
  * @access public
  *@author arnold:tserepov <tserepov@gmail.com>
  * @param Logo $parameters['logo']
  *        	the logo
  * @uses BEGINNING_OF_URL the beginning of the URL
  */
 public static function buildLogo($parameters)
 {
     require_once dirname(__FILE__) . '/ErrorView.php';
     ///////////////////////
     \PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array(new ErrorView(), 'raiseError'));
     require_once 'HTML/Template/IT.php';
     $tpl = new \HTML_Template_IT(ROOT_FOLDER . 'tutshtml');
     $tpl->loadTemplatefile('burnstudio2-template.html');
     $tpl->setCurrentBlock('logo');
     $tpl->setVariable(array('ALT-OF-LOGO' => $parameters['logo']->getAlt(), 'BEGINNING-OF-URL' => BEGINNING_OF_URL, 'SRC-OF-LOGO' => $parameters['logo']->getSrc(), 'SIZES-OF-LOGO' => $parameters['logo']->getSizes()));
     $tpl->parse('logo');
     return $tpl->get('logo');
 }
开发者ID:piiskop,项目名称:pstk,代码行数:22,代码来源:LogoView.php

示例12: setUp

 function setUp()
 {
     PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'catchErrorHandlerPEAR');
     $this->dsn = $GLOBALS['dsn'];
     $this->options = $GLOBALS['options'];
     $this->database = $GLOBALS['database'];
     $this->dsn['database'] = $this->database;
     $this->schema =& MDB2_Schema::factory($this->dsn, $this->options);
     if (PEAR::isError($this->schema)) {
         $this->assertTrue(false, 'Could not connect to manager in setUp');
         exit;
     }
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:13,代码来源:MDB2_Validate_testcase.php

示例13: post

 function post()
 {
     $this->transObj = DB_DataObject::Factory('invhist_transfer');
     $this->transObj->query('BEGIN');
     PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError'));
     $img = DB_DataObject::Factory('images');
     $img->setFrom(array('onid' => 0, 'ontable' => 'ipshead'));
     $img->onUpload(false);
     require_once 'File/Convert.php';
     $fc = new File_Convert($img->getStoreName(), $img->mimetype);
     $csv = $fc->convert('text/csv');
     $ret = $this->importCsv($csv);
     $this->jdata($ret['data'], false, isset($ret['extra']) ? $ret['extra'] : array());
 }
开发者ID:roojs,项目名称:Pman.Core,代码行数:14,代码来源:ExcelToJson.php

示例14: buildView

 /**
  * This function builds the main structure in HTML.
  *
  * @access public
  * @author arnold:tserepov <tserepov@gmail.com>
  * @param string $parameters['body']
  *        	the body
  * @param string $parameters['title']
  *        	the title
  * @return string the parsed HTML-structure
  * @uses BEGINNING_OF_URL for links
  *      
  */
 public static function buildView($parameters)
 {
     require_once 'HTML/Template/IT.php';
     // //////////////////////////////////////////////////////
     \PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array(new CalculatorView(), 'raiseError'));
     $tpl = new \HTML_Template_IT(ROOT_FOLDER . 'htmlcalculator');
     // /////////////////////////////
     echo ' 29: ', ROOT_FOLDER;
     $tpl->loadTemplatefile('calculator.html');
     $tpl->setCurrentBlock('html');
     $tpl->setVariable(array('BEGINNING-OF-URL' => BEGINNING_OF_URL, 'SUMMA1' => $parameters['summa1'], 'SUMMA2' => $parameters['summa2'], 'RESULT' => $parameters['result']));
     $tpl->parse('html');
     echo $tpl->get('html');
 }
开发者ID:piiskop,项目名称:pstk,代码行数:27,代码来源:view.php

示例15: setUp

 function setUp()
 {
     PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'catchErrorHandlerPEAR');
     $this->dsn = $GLOBALS['dsn'];
     $this->options = $GLOBALS['options'];
     $this->database = $GLOBALS['database'];
     $this->dsn['database'] = $this->database;
     $this->schema =& MDB2_Schema::factory($this->dsn, $this->options);
     if (PEAR::isError($this->schema)) {
         $this->assertTrue(false, 'Could not connect to manager in setUp');
         exit;
     }
     $this->aSchemas = array(1 => SCHEMA_PATH . 'schema_1_original.xml', 2 => SCHEMA_PATH . 'schema_2_newfield.xml', 3 => SCHEMA_PATH . 'schema_3_primarykey.xml', 4 => SCHEMA_PATH . 'schema_4_idxfieldorder.xml', 5 => SCHEMA_PATH . 'schema_5_fieldtype.xml', 6 => SCHEMA_PATH . 'schema_6_removefield.xml', 7 => SCHEMA_PATH . 'schema_7_removeindex.xml', 8 => SCHEMA_PATH . 'schema_8_addtable.xml', 9 => SCHEMA_PATH . 'schema_9_removetable.xml', 10 => SCHEMA_PATH . 'schema_10_keyfield.xml');
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:14,代码来源:MDB2_Changes_testcase.php


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