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


PHP debug::exception方法代码示例

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


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

示例1: getEserciziUnita

    public function getEserciziUnita($idUnita) {
        $db = JFactory::getDBO();
        $query = $db->getQuery(true);

        try {
            $query->select('c.esercizi');
            $query->from('#__gg_unit_map AS m');
            $query->join('inner', '#__gg_contenuti AS c ON c.id = m.idcontenuto');
            $query->join('inner', '#__gg_unit AS u1 ON u1.id = m.idunita');
            $query->join('inner', '#__gg_unit AS u2 ON u2.id = u1.categoriapadre');
            $query->where('u2.categoria=' . $idUnita);

            $db->setQuery((string) $query);
            $res = $db->loadColumn();
        } catch (Exception $e) {
            debug::exception($e);
        }

        $res = implode(",",$res);
        return $res;
    }
开发者ID:GGallery,项目名称:MDWEBTV-new,代码行数:21,代码来源:_esercizi.php

示例2: get_congressi

 public function get_congressi($type) {
     try {
         $type = filter_var($type, FILTER_VALIDATE_INT, array('options' => array('min_range' => self::TYPE_VIRTUALFORUM, 'max_range' => self::TYPE_SPECIALECONGRESSI)));
         if (empty($type))
             throw new BadMethodCallException('Virtual Forum o Speciale Congressi?', E_USER_ERROR);
         $query = 'SELECT 
                 id,
             	congresso,
             	alias
             FROM psn_gg_congressi   
             WHERE pubblicato = 1
             AND tipologia=' . $type . '
             ORDER BY ordinamento DESC';
         $this->_db->setQuery($query);
         debug::msg($query);
         return $this->_db->loadAssocList();
     } catch (Exception $e) {
         debug::exception($e);
         return array();
     }
 }
开发者ID:GGallery,项目名称:MDWEBTV-new,代码行数:21,代码来源:_congressi.php

示例3: get_congresso

 public function get_congresso($id) {
     try {
         debug::vardump($id, 'id'); 
         $id = filter_var($id, FILTER_VALIDATE_INT, array('options' => array('min_range' => 1)));
         if (empty($id))
             throw new BadMethodCallException('Identificativo congresso non specificato o non valido', E_USER_ERROR);
         $query = 'SELECT 
                 c.congresso,
                 c.banner,
                 c.abstract AS abstract_congresso,
                 c.alias AS alias_congresso,
                 i.*
             FROM #__gg_congressi AS c
             LEFT JOIN #__gg_contenuti AS i ON i.id_congresso = c.id
             WHERE c.pubblicato = 1 AND c.id = ' . $id;
         $this->_db->setQuery($query);
         debug::msg($query);
         return $this->_db->loadAssocList();            
     } catch (Exception $e) {
         debug::exception($e);
     }
 } 
开发者ID:GGallery,项目名称:MDWEBTV-new,代码行数:22,代码来源:_congresso.php

示例4: decrypt

 /**
  * Ritorna la stringa decodificata.
  * La decodifica consiste nella decifratura della stringa generata da @see crypto::encrypt().
  * In caso di errore ritorna una stringa vuota.
  * 
  * @param string $str Se non viene passata nessuna stringa ritorna una stringa vuota.
  * @return strig
  */
 public function decrypt($str)
 {
     try {
         if (empty($str)) {
             throw new InvalidArgumentException('Empty or not valid string as agrument', E_USER_NOTICE);
         }
         if (!isset($this->_cipher)) {
             throw new UnexpectedValueException('Cypher error', E_USER_WARNING);
         }
         if (false === ($iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($this->_cipher), MCRYPT_RAND))) {
             throw new UnexpectedValueException('Cannot initialize vector IV', E_USER_WARNING);
         }
         $s = mcrypt_generic_init($this->_cipher, $this->_key, $iv);
         if (0 > $s || false === $s) {
             throw new exceptions('Decrypt failure', E_USER_WARNING);
         }
         $dec = rtrim(mdecrypt_generic($this->_cipher, $str), "");
         mcrypt_generic_deinit($this->_cipher);
         return $dec;
     } catch (Exception $e) {
         debug::exception($e);
         return '';
     }
 }
开发者ID:GGallery,项目名称:MDWEBTV-new,代码行数:32,代码来源:crypto.class.php

示例5: checkCoupon

    public function checkCoupon() {



    	$query = $this->_db->getQuery(true);
    	try {
    		$query->select('count(coupon)');
    		$query->from('#__gg_coupon as u');
    		$query->where("u.id_utente = $this->_userid");
    		$query->where("(data_scadenza > current_date() OR data_scadenza IS NULL)");
    		$query->where("if(durata is not null, DATEDIFF(DATE_ADD(data_utilizzo, INTERVAL durata DAY), current_date()) > 0, true)");
    		$this->_db->setQuery((string) $query, 0, 1);
    		$res = $this->_db->loadResult();
    	} catch (Exception $e) {
    		debug::exception($e);
    	}

    	return $res;
    }
开发者ID:GGallery,项目名称:MDWEBTV-new,代码行数:19,代码来源:unita.php

示例6: send

 /**
  * Invia la mail
  * @return bool
  */
 public function send()
 {
     try {
         if (empty($this->_to)) {
             throw new exceptions('No receivers specified', E_USER_ERROR);
         }
         if (empty($this->_body)) {
             throw new exceptions('No body specified', E_USER_ERROR);
         }
         $to = $cc = $bcc = array();
         for ($i = 0, $tot = count($this->_to); $i < $tot; $i++) {
             switch ($this->_to[$i]['mode']) {
                 case RCPT_BCC:
                     $bcc[] = $this->_to[$i]['mail'];
                     break;
                 case RCPT_CC:
                     $cc[] = $this->_to[$i]['mail'];
                     break;
                 case RCPT_TO:
                 default:
                     $to[] = $this->_to[$i]['mail'];
             }
         }
         $header = $this->header($cc, $bcc);
         $body = '';
         if ($this->_mime == MIME_PLAIN) {
             if (empty($this->_attach)) {
                 $body = $this->_body;
             } else {
                 $body = '--==mixed' . $this->_boundary . PHP_EOL . 'Content-Type: text/html; charset="' . $this->_charset . '"' . PHP_EOL . 'Content-Transfer-Encoding: quoted-printable' . PHP_EOL . $this->_body . PHP_EOL . PHP_EOL;
             }
         } else {
             if (!empty($this->_attach)) {
                 $body .= '--==mixed' . $this->_boundary . PHP_EOL . 'Content-Type: multipart/alternative;' . PHP_EOL . "\t" . 'boundary="==alternative' . $this->_boundary . '"' . PHP_EOL . PHP_EOL;
             }
             $body .= '--==alternative' . $this->_boundary . PHP_EOL . 'Content-Type: text/plain; charset="' . $this->_charset . '"' . PHP_EOL . 'Content-Transfer-Encoding: 7bit' . PHP_EOL . PHP_EOL . strip_tags($this->_body) . PHP_EOL . PHP_EOL;
             // inizia la seconda parte del messaggio in formato html
             $body .= '--==alternative' . $this->_boundary . PHP_EOL . 'Content-Type: text/html; charset="' . $this->_charset . '"' . PHP_EOL . 'Content-Transfer-Encoding: 7bit' . PHP_EOL . PHP_EOL;
             if (!empty($this->_attach)) {
                 foreach (array_keys($this->_attach) as $id) {
                     $this->_body = preg_replace('/' . $id . '/ie', "'cid:'.md5('\$0')", $this->_body);
                 }
             }
             $body .= $this->_body . PHP_EOL . '--==alternative' . $this->_boundary . '--' . PHP_EOL;
         }
         // gli allegati
         foreach ($this->_attach as $id => $attach) {
             $body .= '--==mixed' . $this->_boundary . PHP_EOL . $attach['header'] . PHP_EOL . $attach['data'] . PHP_EOL . PHP_EOL;
         }
         if (!empty($this->_attach)) {
             $body .= '--==mixed' . $this->_boundary . '--' . PHP_EOL;
         }
         if (mail(join(',', $to), $this->_subject, $body, $header)) {
             return 1;
         } else {
             $error = error_get_last();
             throw new exceptions($error['message'], $error['type']);
         }
     } catch (Exception $e) {
         debug::exception($e);
     }
     return 0;
 }
开发者ID:GGallery,项目名称:MDWEBTV-new,代码行数:67,代码来源:sendmail.class.php

示例7: attach

	/**
	 * Allega un file alla mail. Il file di default viene aggiunto come attachment e non inline.
	 *
	 * @param string $filepath Percorso al file da includere.
	 * @param bool $inline Se a vero l'oggetto viene inserito nel corpo della mail. Ad esempio un immagine può essere usata nel codice HTML.
	 */
	public function attach($filepath, $inline=false) {
		try {
			$basename = basename($filepath);
			if (!is_readable($filepath)) {
				throw new Exception('Cannot read file '.$basename, E_USER_ERROR);
			}
			$md5_basename = md5($basename);
			$finfo = finfo_open(FILEINFO_MIME_TYPE);
			$mimetype = finfo_file($finfo, realpath($filepath));
			finfo_close($finfo);
			$this->_attach[$basename] = array(
				'header' => 'Content-Type: '.$mimetype.';'. PHP_EOL .
					'Content-Transfer-Encoding: base64'. PHP_EOL .
					'Content-ID: <'.$md5_basename.'>'. PHP_EOL .
					(!$inline ? 'Content-Disposition: attachment; filename="'.$basename.'"' : ''),
				'data' => chunk_split(base64_encode(file_get_contents($filepath)))
			);
		} catch (Exception $e) {
			debug::exception($e);
		}
	}
开发者ID:GGallery,项目名称:MDWEBTV-new,代码行数:27,代码来源:sendmail.class.php

示例8: fetch_template

 /**
  * Come @see easy_smarty::display_template(), ma l'output viene restituito sotto forma di stringa.
  * In caso di errore viene restituita una stringa di errore.
  * @param string $template nome del template da utilizzare.
  * @param string $cache_id identificatore univoco per la copia di cache e di compilazione (default NULL).
  * @param bool $check se TRUE Easy Smarty guarda se il file template &#232; cambiato e lo ricompila (default TRUE). Una volta che l'applicazione viene messa in produzione (quindi i template non cambieranno pi&ugrave;), il passo di check non &#232; pi&ugrave; necessario &#232; consigliabile, per massimizzare  le prestazioni, mettere questo parametro a FALSE.
  * @param bool $cache se TRUE l'output &#232; memorizzato nelle cache (default TRUE).
  * @param int $lifetime tempo di validit&#224; (in secondi) della copia in cache; per default &#232; 120 (2 minuti). $cache deve essere impostato a TRUE perch&#233; $lifetime abbia significato. Un valore di -1 significa cache senza scadenza. Il valore 0 far&#224; s&#236; che la cache venga sempre rigenerata (&#232; utile solo in fase di test, per disabilitare il caching un metodo pi&ugrave; efficiente &#232; impostare $cache a FALSE).
  * @return string
  * @throws Exception
  */
 public function fetch_template($template, $cache_id = null, $check = false, $cache = true, $lifetime = 120) {
     $this->caching = $cache ? 2 : 0;
     $this->compile_check = $check;
     if ($cache) {
         try {
             if (!is_int($lifetime)) {
                 throw new DomainException('Cache lifetime must be a valid int', E_USER_WARNING);
             }
             $this->cache_lifetime = $lifetime;
         } catch (Exception $e) {
             debug::exception($e);
             $this->cache_lifetime = 0;
         }
     }
     if (!$this->templateExists($template)) {
         throw new SmartyException('Template file not found:' . ' ' . $template, E_USER_ERROR);
     }
     return $this->fetch($template, $cache_id, $cache_id);
 }
开发者ID:GGallery,项目名称:MDWEBTV-new,代码行数:30,代码来源:EasySmarty.class.php

示例9: _certificate_user_info

  private function _certificate_user_info() {
     try {
              $query = 'SELECT
              p.profile_key,
              p.profile_value
              FROM
              #__user_profiles AS p
              WHERE p.user_id = '. $this->_user_id;
      
                // FB::log($query, "query user info");
            $this->_db->setQuery($query);


            if (false === ($results = $this->_db->loadRowlist()))
                throw new RuntimeException($this->_db->getErrorMsg(), E_USER_ERROR);


         foreach ($results as $v)
         {
            $k = str_replace('profile.', '', $v[0]);

            $profile[$k] = json_decode($v[1], true);
                if($k=='datadinascita'){$tmp = explode("-", $profile[$k]); $profile[$k] = $tmp[2]."-".$tmp[1]."-".$tmp[0]; }

        }
        FB::log($profile,"profile");
    return $profile;
    
    } catch (Exception $e) {
           debug::exception($e);
         }           
        return array();
    }
开发者ID:GGallery,项目名称:MDWEBTV-new,代码行数:33,代码来源:_attestato.php

示例10: bootstrap

 static function bootstrap($controller, $method)
 {
     try {
         if ($controller && $method) {
             define('CURRENT_ACTION', substr($controller . ':' . $method, 2));
             if (property_exists($controller, 'static_class')) {
                 if (method_exists($controller, '__before')) {
                     call_user_func($controller . '::__before');
                 }
                 call_user_func(array($controller, $method), explode('/', URL_REQUEST));
                 if (method_exists($controller, '__after')) {
                     call_user_func($controller, '::__after');
                 }
             } else {
                 $object = new $controller();
                 if (method_exists($controller, '__before')) {
                     $object->__before();
                 }
                 call_user_func_array(array($object, $method), array(explode('/', URL_REQUEST)));
                 if (method_exists($controller, '__after')) {
                     $object->__after();
                 }
             }
         } else {
             throw new Exception('absent controller or method', 101);
         }
     } catch (Exception $e) {
         logger::exception('exception', $e->getCode() . ' : ' . $e->getMessage());
         if (preg_match('/^(similar|product)$/', ENVIRONMENT)) {
             if (http::is_ajax()) {
                 http::json(array('error' => 4, 'message' => $e->getMessage(), 'data' => null));
             } else {
                 http::abort($e->getMessage(), '', 10);
             }
         }
         debug::exception($e);
     }
 }
开发者ID:mjiong,项目名称:framework,代码行数:38,代码来源:system.php

示例11: PokemonErrorHandler

/**
 * Funzione di default per la gestione degli errori. Gotta Catch 'Em All.
 * @param int $errno
 * @param string $errstr
 * @param string $errfile
 * @param string $errline
 * @param array $errcontext
 */
function PokemonErrorHandler($errno, $errstr, $errfile = null, $errline = null, $errcontext = null)
{
    debug::exception(new exceptions($errstr, $errno, null, $errline, $errfile));
}
开发者ID:GGallery,项目名称:MDWEBTV-new,代码行数:12,代码来源:debug.class.php


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