本文整理汇总了PHP中PEAR::staticRaiseError方法的典型用法代码示例。如果您正苦于以下问题:PHP PEAR::staticRaiseError方法的具体用法?PHP PEAR::staticRaiseError怎么用?PHP PEAR::staticRaiseError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PEAR
的用法示例。
在下文中一共展示了PEAR::staticRaiseError方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: autoConv
/**
* Automatically transform output between encodings
*
* This method utilizes ob_iconv_handler(), so you should call it at the
* beginning of your script (prior to output). If any output buffering has
* been started before, the contents will be fetched with ob_get_contents()
* and the buffers will be destroyed by ob_end_clean() if $refetchOB is set
* to true.
*
* <code>
* require_once('I18Nv2.php');
* I18Nv2::autoConv('CP1252');
* print('...'); // some iso-8859-1 stuff gets converted to Windows-1252
* // ...
* </code>
*
* @static
* @access public
* @return mixed Returns &true; on success or
* <classname>PEAR_Error</classname> on failure.
* @param string $oe desired output encoding
* @param string $ie internal encoding
* @param bool $decodeRequest whether to decode request variables
* ($_GET and $_POST) from $oe to $ie
* @param bool $refetchOB whether contents of already active
* output buffers should be fetched, the
* output buffer handlers destroyed and
* the fetched data be passed through
* ob_iconvhandler
*/
function autoConv($oe = 'UTF-8', $ie = 'ISO-8859-1', $decodeRequest = true, $refetchOB = true)
{
if (!strcasecmp($oe, $ie)) {
return true;
}
if (!extension_loaded('iconv')) {
require_once 'PEAR.php';
if (!PEAR::loadExtension('iconv')) {
return PEAR::staticRaiseError('Error: ext/iconv is not available');
}
}
iconv_set_encoding('internal_encoding', $ie);
iconv_set_encoding('output_encoding', $oe);
iconv_set_encoding('input_encoding', $oe);
$buffer = '';
if ($refetchOB && ($level = ob_get_level())) {
while ($level--) {
$buffer .= ob_get_contents();
ob_end_clean();
}
}
if (!ob_start('ob_iconv_handler')) {
require_once 'PEAR.php';
return PEAR::staticRaiseError('Couldn\'t start output buffering');
}
echo $buffer;
if ($decodeRequest) {
I18Nv2::recursiveIconv($_GET, $oe, $ie);
I18Nv2::recursiveIconv($_POST, $oe, $ie);
}
return true;
}
示例2: greyscale
/**
* Converts an image into greyscale colors
*
* @return mixed TRUE or a PEAR error object on error
* @access public
**/
function greyscale()
{
return PEAR::staticRaiseError('greyscale() method not supported by driver', IMAGE_TRANSFORM_ERROR_UNSUPPORTED);
}
示例3: raiseError
/**
* RaiseError Method - shows imagick Raw errors.
*
* @param string $message message = prefixed message..
* @param int $code error code
* @return PEAR error object
* @access protected
*/
function raiseError($message, $code = 0)
{
return PEAR::staticRaiseError($message, $code);
}
示例4: raiseError
/**
* Trigger a PEAR error
*
* @param string $msg error message
* @param int $code error code
* @param int $mode PEAR error mode
* @param int $option error severity
*
* @return void|PEAR_Error
* @access public
*/
function raiseError($msg, $code, $mode = PEAR_ERROR_TRIGGER, $option = E_USER_WARNING)
{
if (isset($GLOBALS['_PEAR_default_error_mode'])) {
$mode = $GLOBALS['_PEAR_default_error_mode'];
}
if (isset($GLOBALS['_PEAR_default_error_options'])) {
$option = $GLOBALS['_PEAR_default_error_options'];
}
if ($mode == PEAR_ERROR_RETURN) {
return PEAR::staticRaiseError($msg, $code, $mode, $option);
} else {
PEAR::staticRaiseError($msg, $code, $mode, $option);
}
}
示例5: parseProps
//.........这里部分代码省略.........
$props = explode('/', $attr[1]);
foreach ($props as $index => $prop) {
$attrArray['width' . $index] = trim($prop);
$attrArray['width' . $index . '_dax'] = $this->converttoDax(trim($prop), null);
}
break;
case 'table-row-heights':
$props = explode('/', $attr[1]);
foreach ($props as $index => $prop) {
$attrArray['height' . $index] = trim($prop);
}
break;
case 'left-attach':
$props = explode('/', $attr[1]);
foreach ($props as $prop) {
$attrArray['columnNum'] = trim($prop);
}
break;
case 'top-attach':
$props = explode('/', $attr[1]);
foreach ($props as $prop) {
$attrArray['rowNum'] = trim($prop);
}
break;
case 'right-attach':
$props = explode('/', $attr[1]);
foreach ($props as $prop) {
$attrArray['mergeto'] = trim($prop);
}
break;
case 'top-color':
$props = explode('/', $attr[1]);
foreach ($props as $prop) {
$attrArray['borderTopColor'] = trim($prop);
}
break;
case 'left-color':
$props = explode('/', $attr[1]);
foreach ($props as $prop) {
$attrArray['borderLeftColor'] = trim($prop);
}
break;
case 'right-color':
$props = explode('/', $attr[1]);
foreach ($props as $prop) {
$attrArray['borderRightColor'] = trim($prop);
}
break;
case 'bot-color':
$props = explode('/', $attr[1]);
foreach ($props as $prop) {
$attrArray['borderBottomColor'] = trim($prop);
}
break;
// background color
// background color
case 'background-color':
$props = explode('/', $attr[1]);
foreach ($props as $prop) {
$attrArray['bgColor'] = trim($prop);
}
break;
case 'font-weight':
$attrArray['bold'] = $attr[1] == 'bold' ? trim($attr[1]) : false;
break;
case 'font-style':
$attrArray['italic'] = $attr[1] == 'italic' ? true : false;
break;
//
// case 'width':
// $props = explode('/', $attr[1]);
// foreach($props as $index => $prop){
// $attrArray['width'.$index] = trim($prop);
// }
// break;
//
//
// case 'width':
// $props = explode('/', $attr[1]);
// foreach($props as $index => $prop){
// $attrArray['width'.$index] = trim($prop);
// }
// break;
//
default:
$key = trim($attr[0]);
if (empty($attr[1]) && $attr[1] != 0) {
// bit annoying.. but we currently only convert from trustes sources, so do not need to handle this.
PEAR::staticRaiseError("value missing in style key={$attr[0]} for prop={$attribute}", 0, PEAR_ERROR_DIE);
}
$value = trim($attr[1]);
if (array_key_exists($key, $this->styleMatch)) {
$attrArray[$this->styleMatch[$key]] = $value;
} else {
$attrArray[$key] = $value;
}
}
}
return $attrArray;
}