本文整理汇总了PHP中Is_Error函数的典型用法代码示例。如果您正苦于以下问题:PHP Is_Error函数的具体用法?PHP Is_Error怎么用?PHP Is_Error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Is_Error函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ValueOf
function ValueOf($Value)
{
#-------------------------------------------------------------------------------
$Type = GetType($Value);
#-------------------------------------------------------------------------------
switch ($Type) {
case 'integer':
#-------------------------------------------------------------------------------
if (Is_Error($Value)) {
$Type = 'error';
}
#-------------------------------------------------------------------------------
break;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
case 'boolean':
#-------------------------------------------------------------------------------
$Type = $Value ? 'true' : 'false';
#-------------------------------------------------------------------------------
break;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
case 'object':
#-------------------------------------------------------------------------------
if (Get_Class($Value) == 'gException' || Get_Class($Value) == 'jException') {
return 'exception';
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
return $Type;
#-------------------------------------------------------------------------------
}
示例2: getParams
public function getParams()
{
#$Message = Preg_Replace("#\[hidden\](.+)\[/hidden\]#sU", ' ', $this->params['Message'], -1);
$Message = Comp_Load('Edesks/Text', array('String' => $this->params['Message'], 'IsEmail' => TRUE));
if (Is_Error($Message)) {
return ERROR | @Trigger_Error(500);
}
$this->params['Message'] = $Message;
return $this->params;
}
示例3: Comp_Load
function Comp_Load($Element)
{
/****************************************************************************/
$__args_types = array('string', '*');
#-----------------------------------------------------------------------------
$__args__ = Func_Get_Args();
eval(FUNCTION_INIT);
/****************************************************************************/
$HostsIDs = System_HostsIDs(SPrintF('comp/%s.comp.php', $Element));
if (Is_Error($HostsIDs)) {
return ERROR | @Trigger_Error('[Comp_Load]: не возможно найти компонент');
}
#-----------------------------------------------------------------------------
$IsCascade = In_Array(COMP_ALL_HOSTS, $__args__, TRUE);
#-----------------------------------------------------------------------------
if ($IsCascade) {
$HostsIDs = Array_Reverse($HostsIDs);
}
#-----------------------------------------------------------------------------
$Result = array();
#-----------------------------------------------------------------------------
foreach ($HostsIDs as $HostID) {
#---------------------------------------------------------------------------
$Path = SPrintF('%s/hosts/%s/comp/%s.comp.php', SYSTEM_PATH, $HostID, $Element);
#---------------------------------------------------------------------------
if (Is_Dir($Path)) {
return ERROR | @Trigger_Error('[Comp_Load]: объект не является компонентом');
}
#---------------------------------------------------------------------------
$Args = $__args__;
#---------------------------------------------------------------------------
Array_UnShift($Args, $Path);
#---------------------------------------------------------------------------
$Comp = Call_User_Func_Array('LoadComp', $Args);
if (Is_Error($Comp)) {
return ERROR | @Trigger_Error('[Comp_Load]: не возможно загрузить компонент');
}
#---------------------------------------------------------------------------
if ($IsCascade) {
$Result[] = $Comp;
} else {
#-------------------------------------------------------------------------
$Result = $Comp;
#-------------------------------------------------------------------------
break;
}
}
#-----------------------------------------------------------------------------
$Loaded =& Link_Get('Comp/Loaded', 'array');
#-----------------------------------------------------------------------------
$Loaded[] = $Element;
#-----------------------------------------------------------------------------
return $Result;
}
示例4: Md5
function &Messages()
{
#-----------------------------------------------------------------------------
$Name = Md5('Messages');
#-----------------------------------------------------------------------------
if (!isset($GLOBALS[$Name])) {
#---------------------------------------------------------------------------
$GLOBALS[$Name] = System_XML('config/Messages.xml');
if (Is_Error($GLOBALS[$Name])) {
return ERROR | Trigger_Error('[Messages]: не удалось загрузить файл сообщений');
}
}
#-----------------------------------------------------------------------------
return $GLOBALS[$Name];
}
示例5: Md5
function &Regulars()
{
#-----------------------------------------------------------------------------
$Name = Md5('Regulars');
#-----------------------------------------------------------------------------
if (!isset($GLOBALS[$Name])) {
#---------------------------------------------------------------------------
$GLOBALS[$Name] = System_XML('config/Regulars.xml');
if (Is_Error($GLOBALS[$Name])) {
return ERROR | Trigger_Error('[Regulars]: не удалось загрузить файл регулярных выражений');
}
}
#-----------------------------------------------------------------------------
return $GLOBALS[$Name];
}
示例6: smarty_function_menu_left
function smarty_function_menu_left($params, $smarty)
{
$MenuPath = $params['MenuPath'];
if (!$MenuPath) {
return FALSE;
}
$XML = Styles_Menu($MenuPath);
if (Is_Error($XML)) {
return ERROR | @Trigger_Error(500);
}
$items = $XML['Items'];
if (!Count($items)) {
return FALSE;
}
//echo print_r($items);
$smarty->assign('items', array_values($items));
$smarty->display('Menus/Left.tpl');
}
示例7: Md5
function &Config()
{
#-------------------------------------------------------------------------------
$Name = Md5('Config');
#-------------------------------------------------------------------------------
if (!isset($GLOBALS[$Name])) {
#-------------------------------------------------------------------------------
$GLOBALS[$Name] = System_XML('config/Config.xml');
if (Is_Error($GLOBALS[$Name])) {
return ERROR | Trigger_Error('[Config]: не удалось загрузить основную конфигурацию');
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return $GLOBALS[$Name];
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
}
示例8: smarty_function_table
function smarty_function_table($params, $smarty)
{
$tableName = $params['name'];
if (!$tableName) {
return "";
}
$DOM = new DOM();
$Links =& Links();
# Коллекция ссылок
$Links['DOM'] =& $DOM;
$comp = Comp_Load('Tables/Super', $tableName);
if (Is_Error($comp)) {
return ERROR | @Trigger_Error(500);
}
$DOM->Object = $comp;
$Out = $DOM->Build();
if (Is_Error($Out)) {
return ERROR | @Trigger_Error(500);
}
return $Out;
}
示例9: TemplateReplace
function TemplateReplace($Text, $Params = array(), $NoBody = TRUE)
{
#-------------------------------------------------------------------------------
$Text = Trim($Text);
#-------------------------------------------------------------------------------
# проверяем что нам сунули - текст или файл
if (!Preg_Match('/\\s/', $Text)) {
#-------------------------------------------------------------------------------
# достаём текст из файла
$Path = System_Element(SPrintF('templates/modules/%s.html', $Text));
#-------------------------------------------------------------------------------
if (Is_Error($Path)) {
#-------------------------------------------------------------------------------
$Text = SprintF('Отсутствует шаблон сообщения (templates/modules/%s.html)', $Text);
#-------------------------------------------------------------------------------
} else {
#-------------------------------------------------------------------------------
$Text = Trim(IO_Read($Path));
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if ($NoBody) {
$Text = SPrintF('<NOBODY><SPAN>%s</SPAN></NOBODY>', $Text);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Replace = Array_ToLine($Params, '%');
#-------------------------------------------------------------------------------
foreach (Array_Keys($Replace) as $Key) {
$Text = Str_Replace($Key, $Replace[$Key], $Text);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return $Text;
#-------------------------------------------------------------------------------
}
示例10: smarty_function_top_panel
function smarty_function_top_panel($params, $smarty)
{
if (isset($GLOBALS['__USER'])) {
$__USER = $GLOBALS['__USER'];
if (Is_Null($__USER)) {
return ERROR | @Trigger_Error(400);
}
$menuPath = SPrintF('%s/TopPanel', $__USER['InterfaceID']);
$items = Styles_Menu($menuPath);
if (Is_Error($items)) {
return ERROR | @Trigger_Error(500);
}
$items =& $items['Items'];
//return print_r(array_values($items));
$smarty->assign('items', array_values($items));
$__USER = $GLOBALS['__USER'];
$smarty->assign('userName', $__USER['Name']);
$smarty->display('TopPanel/User.tpl');
} else {
$smarty->display('TopPanel/Logon.tpl');
}
}
示例11: Styles_Element
<?php
#-------------------------------------------------------------------------------
/** @author Великодный В.В. (Joonte Ltd.) */
#-------------------------------------------------------------------------------
$Path = Styles_Element('Images/Icon.png');
if (Is_Error($Path)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Icon = IO_Read($Path);
if (Is_Error($Icon)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
Header('Content-Type: image/png');
#-------------------------------------------------------------------------------
return $Icon;
#-------------------------------------------------------------------------------
示例12: Array_ToLine
#-------------------------------------------------------------------------------
$Params = Array_ToLine($Config);
#-------------------------------------------------------------------------------
foreach (Array_Keys($Params) as $Key) {
if (!In_Array($Key, $ShareConfigsParams)) {
$ShareConfigsParams[] = $Key;
}
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Config = System_XML('config/Config.xml', array(HOST_ID));
if (Is_Error($Config)) {
return new gException('ERROR_TEMPLATE_LOAD', 'Ошибка загрузки шаблона');
}
#-------------------------------------------------------------------------------
$Params = Array_ToLine($Config);
#-------------------------------------------------------------------------------
foreach (Array_Keys($Params) as $Key) {
#-------------------------------------------------------------------------------
if (!In_Array($Key, $ShareConfigsParams)) {
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Tasks/GC/CheckConfigParams]: в конфигурационном файле обнаружен не используемый параметр: %s', $Key));
#-------------------------------------------------------------------------------
if ($Settings['IsEvent']) {
#-------------------------------------------------------------------------------
$Event = array('IsReaded' => FALSE, 'PriorityID' => 'System', 'Text' => SPrintF('Обнаружен неиспользуемый параметр конфигурационного файла: %s, со значением (%s). Удалите его, или отключите задачу поиска неиспользуемых параметров. При удалении, будте аккуратны и внимательны, сохраняйте бэкап конфигурационного файла.', $Key, $Params[$Key]));
$Event = Comp_Load('Events/EventInsert', $Event);
示例13: eval
/******************************************************************************/
/******************************************************************************/
eval(COMP_INIT);
/******************************************************************************/
/******************************************************************************/
$Tmp = System_Element('tmp');
if (Is_Error($Tmp)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Folder = SPrintF('%s/files', $Tmp);
#-------------------------------------------------------------------------------
if (File_Exists($Folder)) {
#-----------------------------------------------------------------------------
$Files = IO_Scan($Folder);
if (Is_Error($Files)) {
return ERROR | @Trigger_Error(500);
}
#-----------------------------------------------------------------------------
foreach ($Files as $File) {
#---------------------------------------------------------------------------
$Path = SPrintF('%s/%s', $Folder, $File);
#---------------------------------------------------------------------------
if (Time() - FileMTime($Path) > 86400) {
#-------------------------------------------------------------------------
if (!@UnLink($Path)) {
return ERROR | @Trigger_Error(SPrintF('[comp/Tasks/Temp]: не удалось удалить файл (%s)', $Path));
}
}
}
}
示例14: Comp_Load
if (Is_Error(DB_Transaction($TransactionID = UniqID('comp/Tasks/GC/SetDeletedWaitingInvoice')))) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------
$Comp = Comp_Load('www/API/StatusSet', array('ModeID' => 'Invoices', 'StatusID' => 'Rejected', 'RowsIDs' => $Invoice['ID'], 'Comment' => SPrintF('Автоматическая отмена счёта, неоплачен более %d дней', $Params['Invoices']['DaysBeforeDeleted'])));
#-------------------------------------------------------------------------
switch (ValueOf($Comp)) {
case 'array':
$Event = array('UserID' => $Invoice['UserID'], 'PriorityID' => 'Billing', 'Text' => SPrintF('Автоматическая отмена счёта #%d, неоплачен более %d дней', $Invoice['ID'], $Params['Invoices']['DaysBeforeDeleted']));
$Event = Comp_Load('Events/EventInsert', $Event);
if (!$Event) {
return ERROR | @Trigger_Error(500);
}
break;
default:
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------
if (Is_Error(DB_Commit($TransactionID))) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------
}
$Count = DB_Count('Invoices', array('Where' => $Where));
if (Is_Error($Count)) {
return ERROR | @Trigger_Error(500);
}
return $Count ? $Count : TRUE;
default:
return ERROR | @Trigger_Error(101);
}
示例15: Debug
Debug(SPrintF('[comp/Invoices/PaymentSystems/Uniteller]: статус "%s", счёт #%u проигнорирован', $Args['Status'], $Args['Order_ID']));
return "OK\n";
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Comp = Comp_Load('www/API/StatusSet', array('ModeID' => 'Invoices', 'StatusID' => $StatusID, 'RowsIDs' => $InvoiceID, 'Comment' => $Comment));
#-------------------------------------------------------------------------------
switch (ValueOf($Comp)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return ERROR | @Trigger_Error(400);
case 'array':
break;
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# если была транзакция - коммитим
if (isset($TransactionID)) {
if (Is_Error(DB_Commit($TransactionID))) {
return ERROR | @Trigger_Error(500);
}
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return "OK\n";
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------