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


PHP CacheManager::add方法代码示例

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


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

示例1: registerCacheManager

 public function registerCacheManager()
 {
     $this->app->bind(CacheManager::class, function ($app) {
         $manager = new CacheManager($app['config']['doctrine::doctrine.cache']);
         $manager->add(new ApcProvider());
         $manager->add(new MemcacheProvider());
         $manager->add(new RedisProvider());
         $manager->add(new XcacheProvider());
         $manager->add(new ArrayProvider());
         return $manager;
     });
 }
开发者ID:uedehua,项目名称:laravel5-doctrine,代码行数:12,代码来源:DoctrineOrmProvider.php

示例2: Styles_XML

function Styles_XML($Element)
{
    /****************************************************************************/
    $__args_types = array('string');
    #-----------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /****************************************************************************/
    $CacheID = SPrintF('Styles_XML[%s]', Md5($Element));
    #-----------------------------------------------------------------------------
    $Result = CacheManager::get($CacheID);
    if ($Result) {
        return $Result;
    }
    #-----------------------------------------------------------------------------
    $HostsIDs = Styles_HostsIDs($Element);
    if (Is_Error($HostsIDs)) {
        return ERROR | @Trigger_Error('[Styles_XML]: список хостов содержащих элемент не найдены');
    }
    #-----------------------------------------------------------------------------
    $Result = array();
    #-----------------------------------------------------------------------------
    foreach (Array_Reverse($HostsIDs) as $HostID) {
        #---------------------------------------------------------------------------
        $Path = SPrintF('%s/styles/%s/%s', SYSTEM_PATH, $HostID, $Element);
        #---------------------------------------------------------------------------
        $File = IO_Read($Path);
        if (Is_Error($File)) {
            return ERROR | @Trigger_Error('[Styles_XML]: не удалось прочитать XML-файл');
        }
        #---------------------------------------------------------------------------
        $XML = String_XML_Parse($File);
        if (Is_Exception($XML)) {
            return ERROR | @Trigger_Error('[Styles_XML]: не удалось разобрать XML-строку');
        }
        #---------------------------------------------------------------------------
        $Child = Current($XML->Childs);
        #---------------------------------------------------------------------------
        if (isset($Child->Attribs['recursive'])) {
            $Result = array();
        }
        #---------------------------------------------------------------------------
        $Adding = $XML->ToArray();
        #---------------------------------------------------------------------------
        $Adding = $Adding['XML'];
        #---------------------------------------------------------------------------
        Array_Union($Result, $Adding);
    }
    #-----------------------------------------------------------------------------
    CacheManager::add($CacheID, $Result);
    #-----------------------------------------------------------------------------
    return $Result;
}
开发者ID:carriercomm,项目名称:jbs,代码行数:53,代码来源:Styles.php

示例3: unset

    if (Is_Error($IsUpdate)) {
        return ERROR | @Trigger_Error(500);
    }
    #-------------------------------------------------------------------------------
    unset($IsOK);
    #-------------------------------------------------------------------------------
    #-------------------------------------------------------------------------------
    # добавляем в кэш обработанный сервер
    if (!isset($Cache[$Group])) {
        $Cache[$Group] = array();
    }
    #-------------------------------------------------------------------------------
    $Cache[$Group][] = $Server['Address'];
    #-------------------------------------------------------------------------------
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# помечаем группу как обработанную
if (isset($Group)) {
    $Cache[$Group]['IsComplete'] = TRUE;
}
#-------------------------------------------------------------------------------
# Сохраняем кэшированные данные
CacheManager::add($CacheID, $Cache, 300);
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# если в процессе работы была задана группа - то возможно она не последняя, короткий цикл, если не задана - то все сервера обработаны - длинный
return isset($Group) ? Time() + 10 : $ExecuteTime;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:ServersUpTime.comp.php

示例4: DB_Select

    }
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Order = DB_Select(SPrintF('%sOrdersOwners', $ServiceCode), 'OrderID', array('UNIQ', 'ID' => $ServiceOrderID));
#-------------------------------------------------------------------------------
switch (ValueOf($Order)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        #-------------------------------------------------------------------------------
        if ($IsNotFound) {
            return "00000";
        }
        #-------------------------------------------------------------------------------
        return ERROR | @Trigger_Error(400);
        #-------------------------------------------------------------------------------
    #-------------------------------------------------------------------------------
    case 'array':
        #-------------------------------------------------------------------------------
        CacheManager::add($CacheID, $Order['OrderID'], 24 * 3600);
        #-------------------------------------------------------------------------------
        return $Order['OrderID'];
        #-------------------------------------------------------------------------------
    #-------------------------------------------------------------------------------
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:SearchOrderID.comp.php

示例5: Styles_Element

            $Emblem = Styles_Element(SPrintF('Images/Icons/%s.png', $Service['Code']));
            if (Is_Error($Emblem)) {
                return ERROR | @Trigger_Error(500);
            }
            #-------------------------------------------------------------------------------
            $Emblem = IO_Read($Emblem);
            if (Is_Error($Emblem)) {
                return ERROR | @Trigger_Error(500);
            }
            #-------------------------------------------------------------------------------
            break;
        default:
            return ERROR | @Trigger_Error(101);
    }
    #-------------------------------------------------------------------------------
} else {
    #-------------------------------------------------------------------------------
    $File = GetUploadedFile('Services', $ServiceID);
    #-------------------------------------------------------------------------------
    $Emblem = $File['Data'];
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
CacheManager::add($CacheID, $Emblem, 24 * 3600);
#-------------------------------------------------------------------------------
Header('Content-Type: image');
Header('Cache-Control: private, max-age=86400');
#-------------------------------------------------------------------------------
return $Emblem;
#-------------------------------------------------------------------------------
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:ServiceEmblem.comp.php

示例6: DB_Update

         #-------------------------------------------------------------------------------
         $IsUpdate = DB_Update('DomainOrders', array('UpdateDate' => Time()), array('ID' => $DomainOrder['ID']));
         if (Is_Error($IsUpdate)) {
             return ERROR | @Trigger_Error(500);
         }
         #-------------------------------------------------------------------------------
         $Event = array('UserID' => $DomainOrder['UserID'], 'PriorityID' => 'Warning', 'Text' => SPrintF('Повторная ошибка получения данных WhoIs для домена %s.%s, проверка пропущена', $DomainOrder['DomainName'], $DomainOrder['SchemeName']));
         #-------------------------------------------------------------------------------
         $Event = Comp_Load('Events/EventInsert', $Event);
         if (!$Event) {
             return ERROR | @Trigger_Error(500);
         }
         #-------------------------------------------------------------------------------
     } else {
         #-------------------------------------------------------------------------------
         CacheManager::add($CacheID, 1, 3600);
         #-------------------------------------------------------------------------------
     }
     #-------------------------------------------------------------------------------
     return new gException('WHOIS_SERVER_ERROR', 'Ошибка сервера WhoIs');
     #-------------------------------------------------------------------------------
 #-------------------------------------------------------------------------------
 case 'exception':
     return new gException('CAN_NOT_GET_WHOIS_DATA', 'Не удалось получить данные WhoIs', $WhoIs);
 case 'false':
     return new gException('DOMAIN_ZONE_NOT_SUPPORTED', 'Доменная зона не поддерживается');
 case 'array':
     #-------------------------------------------------------------------------------
     $UDomainOrder = array('UpdateDate' => Time(), 'WhoIs' => $WhoIs['Info']);
     #-------------------------------------------------------------------------------
     $ExpirationDate = $WhoIs['ExpirationDate'];
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:DomainOrderWhoIsUpdate.comp.php

示例7: String_Xml_Parse


//.........这里部分代码省略.........
    #-------------------------------------------------------------------------------
    $XmlParser = Xml_Parser_Create('UTF-8');
    #-------------------------------------------------------------------------------
    if (!Xml_Parser_Set_Option($XmlParser, XML_OPTION_CASE_FOLDING, FALSE)) {
        return ERROR | Trigger_Error('[String_Xml_Parse]: не удалось установить опцию парсирования (XML_OPTION_CASE_FOLDING)');
    }
    #-------------------------------------------------------------------------------
    if (!Xml_Parser_Set_Option($XmlParser, XML_OPTION_SKIP_WHITE, FALSE)) {
        return ERROR | Trigger_Error('[String_Xml_Parse]: не удалось установить опцию парсирования (XML_OPTION_SKIP_WHITE)');
    }
    #-------------------------------------------------------------------------------
    if (!Xml_Parse_Into_Struct($XmlParser, $String, $Nodes)) {
        #-------------------------------------------------------------------------------
        $ByteIndex = Xml_Get_Current_Byte_Index($XmlParser);
        #-------------------------------------------------------------------------------
        Debug(SPrintF('[system/libs/auto/String.php]: xml_error_string = %s', Xml_Error_String(Xml_Get_Error_Code($XmlParser))));
        #-------------------------------------------------------------------------------
        Debug(SPrintF('[system/libs/auto/String.php]: %s', Mb_SubStr($String, $ByteIndex - 100, $ByteIndex + 100)));
        #-------------------------------------------------------------------------------
        $Buffer = Mb_SubStr($String, 0, $ByteIndex);
        #-------------------------------------------------------------------------------
        $Line = Preg_Match_All("/(\r\n|\n)/sU", $Buffer, $Matches) + 1;
        #-------------------------------------------------------------------------------
        return new gException('XML_PARSE_ERROR', SPrintF('%s в линии %u', Xml_Error_String($XmlParser), $Line));
        #-------------------------------------------------------------------------------
    }
    #-------------------------------------------------------------------------------
    #-------------------------------------------------------------------------------
    #-----------------------------------------------------------------------------
    Xml_Parser_Free($XmlParser);
    #-----------------------------------------------------------------------------
    $Root = new Tag('__ROOT__');
    #-----------------------------------------------------------------------------
    $Links = array(&$Root);
    #-----------------------------------------------------------------------------
    foreach ($Nodes as $Node) {
        #---------------------------------------------------------------------------
        $Current = $Links[Count($Links) - 1];
        #---------------------------------------------------------------------------
        switch ($Node['type']) {
            case 'open':
                #-----------------------------------------------------------------------
                $Tag = new Tag($Node['tag']);
                #-----------------------------------------------------------------------
                if (isset($Node['attributes'])) {
                    $Tag->AddAttribs($Node['attributes']);
                }
                #-----------------------------------------------------------------------
                if (isset($Node['value'])) {
                    #---------------------------------------------------------------------
                    $Value = $Node['value'];
                    #---------------------------------------------------------------------
                    if (Trim($Value)) {
                        $Tag->AddChild(new Tag('CDATA', $Value));
                    }
                }
                #-----------------------------------------------------------------------
                $Current->Childs[] = $Tag;
                #-----------------------------------------------------------------------
                $Links[] =& $Current->Childs[Count($Current->Childs) - 1];
                break;
            case 'cdata':
                #-----------------------------------------------------------------------
                $Value = $Node['value'];
                #-----------------------------------------------------------------------
                if (Trim($Value)) {
                    #---------------------------------------------------------------------
                    $Tag = new Tag('CDATA', $Value);
                    #---------------------------------------------------------------------
                    $Current->Childs[] = $Tag;
                }
                break;
            case 'complete':
                #-----------------------------------------------------------------------
                $Tag = new Tag($Node['tag']);
                #-----------------------------------------------------------------------
                if (isset($Node['attributes'])) {
                    $Tag->AddAttribs($Node['attributes']);
                }
                #-----------------------------------------------------------------------
                if (isset($Node['value'])) {
                    $Tag->AddText($Node['value']);
                }
                #-----------------------------------------------------------------------
                $Current->Childs[] = $Tag;
                break;
            case 'close':
                Array_Pop($Links);
                break;
            default:
                # No more...
        }
    }
    #-----------------------------------------------------------------------------
    if ($IsUseCache) {
        CacheManager::add($CacheID, $Root);
    }
    #-----------------------------------------------------------------------------
    return $Root;
}
开发者ID:carriercomm,项目名称:jbs,代码行数:101,代码来源:String.php

示例8: Tag

}
#-------------------------------------------------------------------------------
$NoBody = new Tag('NOBODY');
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Where = array("`StatusID` = 'Working' OR `StatusID` = 'Newest'", "`Flags` != 'CloseOnSee'", "(SELECT `IsDepartment` FROM `Groups` WHERE `Groups`.`ID` = `Edesks`.`TargetGroupID`) = 'yes'", "(SELECT `IsDepartment` FROM `Groups` WHERE `Groups`.`ID` = (SELECT `GroupID` FROM `Users` WHERE `Users`.`ID` = `Edesks`.`UserID`)) = 'no'");
#-------------------------------------------------------------------------------
$Count = DB_Count('Edesks', array('Where' => $Where));
if (Is_Error($Count)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
if ($Count) {
    $NoBody->AddChild(new Tag('A', array('href' => '/Administrator/Tickets', 'class' => 'Image'), new Tag('IMG', array('alt' => 'Новые сообщения', 'border' => 0, 'width' => 13, 'height' => 9, 'src' => 'SRC:{Images/Icons/Message1.gif}'))));
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (Count($NoBody->Childs)) {
    #-------------------------------------------------------------------------------
    $NoBody->AddChild(new Tag('SPAN', $Adding));
    #-------------------------------------------------------------------------------
    $Adding = $NoBody;
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
CacheManager::add($CacheID, $Adding, 60);
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return $Adding;
#-------------------------------------------------------------------------------
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:Administrator.comp.php

示例9: IntVal

#-------------------------------------------------------------------------------
if (!isset($_SERVER["HTTP_REFERER"])) {
    #-------------------------------------------------------------------------------
    $Count = IntVal(CacheManager::get($CacheID));
    #-------------------------------------------------------------------------------
    if ($Count > 2) {
        #-------------------------------------------------------------------------------
        $NoBody = new Tag('NOBODY');
        #-------------------------------------------------------------------------------
        $NoBody->AddHTML(TemplateReplace('Notes.User.CheckReferer'));
        #-------------------------------------------------------------------------------
        $Result[] = $NoBody;
        #-------------------------------------------------------------------------------
    }
    #-------------------------------------------------------------------------------
    $Count++;
    #-------------------------------------------------------------------------------
    CacheManager::add($CacheID, $Count, 600);
    #-------------------------------------------------------------------------------
    Debug(SPrintF('[comp/Notes/User/CheckReferer]: HTTP_REFERER is not set for IP = %s, Count = %u', $_SERVER['REMOTE_ADDR'], $Count));
    #-------------------------------------------------------------------------------
} else {
    #-------------------------------------------------------------------------------
    CacheManager::add($CacheID, 0, 600);
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return $Result;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:CheckReferer.comp.php

示例10: DB_Query

            break;
        default:
            return ERROR | @Trigger_Error(101);
    }
    #-----------------------------------------------------------------------------
    for ($i = 0; $i < Count($Services); $i++) {
        $Query = DB_Query(SPrintF("SHOW TABLES LIKE '%s%%OrdersOwners'", $Services[$i]['Code']));
        $Row = MySQL::Result($Query);
        foreach (Array_Keys($Row[0]) as $Key) {
            $Services[$i]['View'] = $Row[0][$Key];
        }
        $View = Preg_Split('/Owner/', $Services[$i]['View']);
        $Services[$i]['Table'] = Current($View);
    }
    #-----------------------------------------------------------------------------
    CacheManager::add($CacheID, $Services, 600);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
#Debug("[Tasks/GC/EraseDeletedOrders]: " . print_r($Services,true));
#-------------------------------------------------------------------------------
for ($i = 0; $i < Count($Services); $i++) {
    Debug(SPrintF("[Tasks/GC/EraseDeletedOrders]: Код текущей услуги - %s", $Services[$i]['Code']));
    #-----------------------------------------------------------------------------
    $Where = SPrintF("`StatusID` = 'Deleted' AND `StatusDate` < UNIX_TIMESTAMP( ) - %d *86400", $Params['Invoices']['DaysBeforeErase']);
    #-----------------------------------------------------------------------------
    $Orders = DB_Select($Services[$i]['View'], array('ID', 'OrderID', 'UserID'), array('Where' => $Where));
    #-----------------------------------------------------------------------------
    switch (ValueOf($Orders)) {
        case 'error':
            return ERROR | @Trigger_Error(500);
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:EraseDeletedOrders.comp.php

示例11: WhoIs_Check


//.........这里部分代码省略.........
                case 'array':
                    break;
                default:
                    return ERROR | @Trigger_Error(101);
            }
            #-------------------------------------------------------------------------------
            # перебираем регистраторов
            $UseServer = FALSE;
            #-------------------------------------------------------------------------------
            foreach ($Servers as $iServer) {
                #-------------------------------------------------------------------------------
                # если это не проверка доступности и в настройках сервера не стоит галка про получение WhoIs - пропускаем
                if (!$IsAvalible) {
                    if (!$iServer['Params']['IsFetchWhoIs']) {
                        continue;
                    }
                }
                #-------------------------------------------------------------------------------
                # достаём использованные запросы к регистратору, на данную минуту
                $RatelimitID = SPrintF('ratelimit-%s-%s-00', $iServer['Address'], Date('H-i'));
                #-------------------------------------------------------------------------------
                $Ratelimit = CacheManager::get($RatelimitID);
                #-------------------------------------------------------------------------------
                # если из кэша что-то досталось и оно больше разрешённой частоты запросов - пропускаем цикл
                if ($Ratelimit && $Ratelimit >= $iServer['Params']['RatelimitAPI']) {
                    #-------------------------------------------------------------------------------
                    Debug(SPrintF('[comp/www/API/WhoIs]: превышена частота запросов к серверу %s (разрешено %u, использовано %u)', $iServer['Address'], $iServer['Params']['RatelimitAPI'], $Ratelimit));
                    #-------------------------------------------------------------------------------
                    continue;
                    #-------------------------------------------------------------------------------
                }
                #-------------------------------------------------------------------------------
                # сохраняем, на пару минут, в кэш новое число запросов к регистратору
                CacheManager::add($RatelimitID, IntVal($Ratelimit) + 1, 120);
                #-------------------------------------------------------------------------------
                $UseServer = $iServer;
                #-------------------------------------------------------------------------------
                break;
                #-------------------------------------------------------------------------------
            }
            #-------------------------------------------------------------------------------
            # если не задан сервер - частота превышена для всех серверов
            if (!$UseServer) {
                return new gException('REGISTRATOR_SERVER_RATELIMIT', 'Превышена максимальная частота запросов к интерфейсу регистратора');
            }
            #-------------------------------------------------------------------------------
            #-------------------------------------------------------------------------------
            # выбираем сервер регистратора
            if (Is_Error(System_Load('classes/DomainServer.class.php'))) {
                return ERROR | @Trigger_Error(500);
            }
            #-------------------------------------------------------------------------------
            $Server = new DomainServer();
            #-------------------------------------------------------------------------------
            $IsSelected = $Server->Select((int) $UseServer['ID']);
            #-------------------------------------------------------------------------------
            switch (ValueOf($IsSelected)) {
                case 'error':
                    return ERROR | @Trigger_Error(500);
                case 'exception':
                    return new gException('CANNOT_SELECT_REGISTRATOR', 'Не удалось выбрать регистратора');
                case 'true':
                    break;
                default:
                    return ERROR | @Trigger_Error(101);
            }
开发者ID:carriercomm,项目名称:jbs,代码行数:67,代码来源:WhoIs.php

示例12: DB_Update

    #-------------------------------------------------------------------------------
    $Params = $__USER['Params'];
    #-------------------------------------------------------------------------------
    $Params['NotificationMethods'][$Method]['Confirmed'] = 0;
    #-------------------------------------------------------------------------------
    $IsUpdate = DB_Update('Users', array('Params' => $Params), array('ID' => $__USER['ID']));
    if (Is_Error($IsUpdate)) {
        return ERROR | @Trigger_Error(500);
    }
    #-------------------------------------------------------------------------------
    #-------------------------------------------------------------------------------
    CacheManager::add($Cache['Confirm1'], $Confirm1, 10 * 24 * 3600);
    #-------------------------------------------------------------------------------
    CacheManager::add($Cache['Confirm2'], $Confirm2, 10 * 24 * 3600);
    #-------------------------------------------------------------------------------
    CacheManager::add($Cache['Limit'], Time(), IntVal($Settings['ConfirmInterval']));
    #-------------------------------------------------------------------------------
    #-------------------------------------------------------------------------------
    return array('Status' => 'Ok');
    #-------------------------------------------------------------------------------
    #-------------------------------------------------------------------------------
} else {
    #-------------------------------------------------------------------------------
    if (empty($Confirm) && empty($Code)) {
        return new gException('ERROR_CODE_EMPTY', 'Введите полученный код подтверждения, или пройдите по ссылке из сообщения');
    }
    #-------------------------------------------------------------------------------
    $Confirm1 = CacheManager::get($Cache['Confirm1']);
    #-------------------------------------------------------------------------------
    $Confirm2 = CacheManager::get($Cache['Confirm2']);
    #-------------------------------------------------------------------------------
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:Confirm.comp.php

示例13: foreach

#-------------------------------------------------------------------------------
foreach (Array_Keys($ContactDetail['FullInfo']) as $Key) {
    #-------------------------------------------------------------------------------
    $Comp = Comp_Load('Form/Input', array('name' => $Key, 'type' => 'hidden', 'value' => $ContactDetail['FullInfo'][$Key]));
    if (Is_Error($Comp)) {
        return ERROR | @Trigger_Error(500);
    }
    #-------------------------------------------------------------------------------
    $Form->AddChild($Comp);
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$DOM->AddChild('Head', new Tag('SCRIPT', array('type' => 'text/javascript'), SPrintF("var \$Domain = '%s';", $Domain)));
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$DOM->AddChild('Into', $Form);
#-------------------------------------------------------------------------------
if (Is_Error($DOM->Build(FALSE))) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (isset($CacheID)) {
    CacheManager::add($CacheID, Time(), 60);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return array('Status' => 'Ok', 'DOM' => $DOM->Object);
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:DomainOrderChangeContactData.comp.php

示例14: Comp_Load

#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Tables/Standard', $Table);
if (Is_Error($Comp)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$DOM->AddChild('Into', $Comp);
#-------------------------------------------------------------------------------
if (Is_Error($DOM->Build(FALSE))) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (isset($CacheID)) {
    #-------------------------------------------------------------------------------
    $Result = CacheManager::get($CacheID);
    #-------------------------------------------------------------------------------
    $Count = $Result ? $Result + 1 : 1;
    #-------------------------------------------------------------------------------
    Debug(SPrintF('[comp/www/DomainOrderRegistratorInfo]: Count = %s', $Count));
    #-------------------------------------------------------------------------------
    CacheManager::add($CacheID, $Count, 300);
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return array('Status' => 'Ok', 'DOM' => $DOM->Object);
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:DomainOrderRegistratorInfo.comp.php

示例15: Tree_Entrance

function Tree_Entrance($TableID, $RowID)
{
    /****************************************************************************/
    $__args_types = array('string', 'integer');
    #-----------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /****************************************************************************/
    $Regulars = Regulars();
    #-----------------------------------------------------------------------------
    if (!Preg_Match($Regulars['ID'], $TableID)) {
        return new gException('WRONG_TABLE_ID', 'Неверный идентификатор таблицы');
    }
    #-----------------------------------------------------------------------------
    $CacheID = SPrintF('Tree_Entrance[%s]', Md5(SPrintF('%s:%u', $TableID, $RowID)));
    #-----------------------------------------------------------------------------
    $Result = CacheManager::get($CacheID);
    if (!$Result) {
        #---------------------------------------------------------------------------
        $Row = DB_Select($TableID, '*', array('UNIQ', 'ID' => $RowID));
        #---------------------------------------------------------------------------
        switch (ValueOf($Row)) {
            case 'error':
                return ERROR | @Trigger_Error('[Tree_Entrance]: не возможно найти запись');
            case 'exception':
                return new gException('ROW_NOT_FOUND', 'Запись не найдена');
            case 'array':
                #-----------------------------------------------------------------------
                $Result = array($Row['ID']);
                #-----------------------------------------------------------------------
                $Where = SPrintF('`ParentID` = %u AND `ID` != `ParentID`', $Row['ID']);
                #-----------------------------------------------------------------------
                $Childs = DB_Select($TableID, '*', array('Where' => $Where));
                #-----------------------------------------------------------------------
                switch (ValueOf($Childs)) {
                    case 'error':
                        return ERROR | @Trigger_Error('[Tree_Entrance]: не возможно найти дочерние записи');
                    case 'exception':
                        #----->
                        break;
                    case 'array':
                        #-------------------------------------------------------------------
                        foreach ($Childs as $Child) {
                            #-----------------------------------------------------------------
                            $Entrance = Tree_Entrance($TableID, (int) $Child['ID']);
                            #-----------------------------------------------------------------
                            switch (ValueOf($Entrance)) {
                                case 'error':
                                    return ERROR | @Trigger_Error('[Tree_Entrance]: не возможно определить дочерние вхождения записей');
                                case 'exception':
                                    return ERROR | @Trigger_Error('[Tree_Entrance]: запись оказавшаяся дочерней не найдена');
                                case 'array':
                                    $Result = Array_Merge($Result, $Entrance);
                                    break;
                                default:
                                    return ERROR | @Trigger_Error(101);
                            }
                        }
                        break;
                    default:
                        return ERROR | @Trigger_Error(101);
                }
                #-----------------------------------------------------------------------
                CacheManager::add($CacheID, $Result);
                break;
            default:
                return ERROR | @Trigger_Error(101);
        }
    }
    #-----------------------------------------------------------------------------
    return $Result;
}
开发者ID:carriercomm,项目名称:jbs,代码行数:72,代码来源:Tree.php


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