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


PHP Implode函数代码示例

本文整理汇总了PHP中Implode函数的典型用法代码示例。如果您正苦于以下问题:PHP Implode函数的具体用法?PHP Implode怎么用?PHP Implode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: getParameterAnnotations

 public function getParameterAnnotations(\ReflectionParameter $parameter)
 {
     $class = $parameter->getDeclaringClass() ?: 'Closure';
     $method = $parameter->getDeclaringFunction();
     if (!$method->isUserDefined()) {
         return array();
     }
     $context = 'parameter ' . ($class === 'Closure' ? $class : $class->getName()) . '::' . $method->getName() . '($' . $parameter->getName() . ')';
     if ($class === 'Closure') {
         $this->parser->setImports($this->getClosureImports($method));
     } else {
         $this->parser->setImports($this->getImports($class));
         $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class));
     }
     $lines = file($method->getFileName());
     $lines = array_slice($lines, $start = $method->getStartLine() - 1, $method->getEndLine() - $start);
     $methodBody = Implode($lines);
     $methodBody = str_replace("\n", null, $methodBody);
     $signature = preg_split('/\\)\\s*\\{/', $methodBody);
     $signature = $signature[0];
     $signature = substr($signature, strpos($signature, "function"));
     if (preg_match_all('/\\/\\*\\*(.*?)\\*\\/' . '.*?\\$(\\w+)/', $signature, $matches)) {
         $docComments = $matches[1];
         $names = $matches[2];
         for ($i = 0, $len = count($names); $i < $len; ++$i) {
             if ($names[$i] === $parameter->name) {
                 return $this->parser->parse($docComments[$i], $context);
             }
         }
     }
     return array();
 }
开发者ID:spotframework,项目名称:spot,代码行数:32,代码来源:ReaderImpl.php

示例2: _CacheBadges

 protected function _CacheBadges(&$Sender)
 {
     $Discussion = $Sender->Data('Discussion');
     $Comments = $Sender->Data('CommentData');
     $TopPostersModule = new TopPostersModule();
     $UserIDList = array();
     if ($Discussion) {
         $UserIDList[$Discussion->InsertUserID] = 1;
     }
     if ($Comments && $Comments->NumRows()) {
         $Comments->DataSeek(-1);
         while ($Comment = $Comments->NextRow()) {
             $UserIDList[$Comment->InsertUserID] = 1;
         }
     }
     $UserBadges = array();
     if (sizeof($UserIDList)) {
         $Limit = Gdn::Config('TopPosters.Limit');
         $Limit = !$Limit || $Limit == 0 ? 10 : $Limit;
         $arrExcludedUsers = Gdn::Config('TopPosters.Excluded');
         $usersExcluded = is_array($arrExcludedUsers) ? ' AND UserID not in (' . Implode(',', $arrExcludedUsers) . ')' : "";
         $TopPostersModule->GetData();
         $Badges = $TopPostersModule->getTopPosters();
         $Badges->DataSeek(-1);
         $i = 1;
         while ($UserBadge = $Badges->NextRow()) {
             $UserBadges[$UserBadge->UserID] = $i++;
         }
     }
     $Sender->SetData('Plugin-Badge-Counts', $UserBadges);
 }
开发者ID:ru4,项目名称:arabbnota,代码行数:31,代码来源:default.php

示例3: ReadInternal

 protected function ReadInternal($Buffer, $Length, $SherlockFunction)
 {
     if ($Buffer->Remaining() === 0) {
         throw new InvalidPacketException('Failed to read any data from socket', InvalidPacketException::BUFFER_EMPTY);
     }
     $Header = $Buffer->GetLong();
     if ($Header === -1) {
         // We don't have to do anything
     } else {
         if ($Header === -2) {
             $Packets = [];
             $IsCompressed = false;
             $ReadMore = false;
             do {
                 $RequestID = $Buffer->GetLong();
                 switch ($this->Engine) {
                     case SourceQuery::GOLDSOURCE:
                         $PacketCountAndNumber = $Buffer->GetByte();
                         $PacketCount = $PacketCountAndNumber & 0xf;
                         $PacketNumber = $PacketCountAndNumber >> 4;
                         break;
                     case SourceQuery::SOURCE:
                         $IsCompressed = ($RequestID & 0x80000000) !== 0;
                         $PacketCount = $Buffer->GetByte();
                         $PacketNumber = $Buffer->GetByte() + 1;
                         if ($IsCompressed) {
                             $Buffer->GetLong();
                             // Split size
                             $PacketChecksum = $Buffer->GetUnsignedLong();
                         } else {
                             $Buffer->GetShort();
                             // Split size
                         }
                         break;
                 }
                 $Packets[$PacketNumber] = $Buffer->Get();
                 $ReadMore = $PacketCount > sizeof($Packets);
             } while ($ReadMore && $SherlockFunction($Buffer, $Length));
             $Data = Implode($Packets);
             // TODO: Test this
             if ($IsCompressed) {
                 // Let's make sure this function exists, it's not included in PHP by default
                 if (!Function_Exists('bzdecompress')) {
                     throw new \RuntimeException('Received compressed packet, PHP doesn\'t have Bzip2 library installed, can\'t decompress.');
                 }
                 $Data = bzdecompress($Data);
                 if (CRC32($Data) !== $PacketChecksum) {
                     throw new InvalidPacketException('CRC32 checksum mismatch of uncompressed packet data.', InvalidPacketException::CHECKSUM_MISMATCH);
                 }
             }
             $Buffer->Set(SubStr($Data, 4));
         } else {
             throw new InvalidPacketException('Socket read: Raw packet header mismatch. (0x' . DecHex($Header) . ')', InvalidPacketException::PACKET_HEADER_MISMATCH);
         }
     }
     return $Buffer;
 }
开发者ID:jelakesh,项目名称:PHP-Source-Query,代码行数:57,代码来源:BaseSocket.php

示例4: Read

 public function Read($Length = 1400)
 {
     $this->Buffer->Set(FRead($this->Socket, $Length));
     if ($this->Buffer->Remaining() > 0 && $this->Buffer->GetLong() == -2) {
         $Packets = array();
         $IsCompressed = false;
         $ReadMore = false;
         do {
             $RequestID = $this->Buffer->GetLong();
             switch ($this->Engine) {
                 case CI_SourceQuery::GOLDSOURCE:
                     $PacketCountAndNumber = $this->Buffer->GetByte();
                     $PacketCount = $PacketCountAndNumber & 0xf;
                     $PacketNumber = $PacketCountAndNumber >> 4;
                     break;
                 case CI_SourceQuery::SOURCE:
                     $IsCompressed = ($RequestID & 0x80000000) != 0;
                     $PacketCount = $this->Buffer->GetByte();
                     $PacketNumber = $this->Buffer->GetByte() + 1;
                     if ($IsCompressed) {
                         $this->Buffer->GetLong();
                         // Split size
                         $PacketChecksum = $this->Buffer->GetUnsignedLong();
                     } else {
                         $this->Buffer->GetShort();
                         // Split size
                     }
                     break;
             }
             $Packets[$PacketNumber] = $this->Buffer->Get();
             $ReadMore = $PacketCount > sizeof($Packets);
         } while ($ReadMore && $this->Sherlock($Length));
         $Buffer = Implode($Packets);
         // TODO: Test this
         if ($IsCompressed) {
             // Let's make sure this function exists, it's not included in PHP by default
             if (!Function_Exists('bzdecompress')) {
                 throw new RuntimeException('Received compressed packet, PHP doesn\'t have Bzip2 library installed, can\'t decompress.');
             }
             $Data = bzdecompress($Data);
             if (CRC32($Data) != $PacketChecksum) {
                 throw new SourceQueryException('CRC32 checksum mismatch of uncompressed packet data.');
             }
         }
         $this->Buffer->Set(SubStr($Buffer, 4));
     }
 }
开发者ID:mefisto2009,项目名称:GameAP,代码行数:47,代码来源:Socket.class.php

示例5: GetData

 public function GetData()
 {
     $SQL = Gdn::SQL();
     $Limit = Gdn::Config('TopPosters.Limit');
     $Limit = !$Limit || $Limit == 0 ? 10 : $Limit;
     $Session = Gdn::Session();
     /*
     		$SQL
     			->Select('u.Name, u.CountComments, u.CountDiscussions')
     			->From('User u')			
     			->Where('u.CountComments >','0')
     			->Where('u.CountComments is not null') 
     			->OrderBy('u.CountComments','desc')
     			->Limit($Limit);		
     */
     $arrExcludedUsers = Gdn::Config('TopPosters.Excluded');
     $usersExcluded = is_array($arrExcludedUsers) ? ' AND UserID not in (' . Implode(',', $arrExcludedUsers) . ')' : "";
     $this->_TopPosters = $SQL->Query('SELECT UserID, Name, if(CountDiscussions is NULL,0,CountDiscussions) + if(CountComments is NULL,0,CountComments) as AllPosted FROM ' . $SQL->Database->DatabasePrefix . 'User WHERE 1 ' . $usersExcluded . ' HAVING AllPosted > 0  order by AllPosted desc, Name asc LIMIT ' . $Limit);
 }
开发者ID:ru4,项目名称:arabbnota,代码行数:19,代码来源:class.toppostersmodule.php

示例6: generate

 static function generate($depth = False)
 {
     # Get current Filter string
     $filter = RawUrlDecode(Get_Query_Var('filter'));
     if (!empty($filter)) {
         $str_filter = $filter;
     } elseif (Is_Singular()) {
         $str_filter = StrToLower(Get_The_Title());
     } else {
         $str_filter = '';
     }
     # Explode Filter string
     $arr_current_filter = empty($str_filter) ? array() : PReg_Split('/(?<!^)(?!$)/u', $str_filter);
     Array_UnShift($arr_current_filter, '');
     $arr_filter = array();
     # This will be the function result
     $filter_part = '';
     # Check if we are inside a taxonomy archive
     $taxonomy_term = Is_Tax() ? Get_Queried_Object() : Null;
     foreach ($arr_current_filter as $filter_letter) {
         $filter_part .= $filter_letter;
         $arr_available_filters = self::getFilters($filter_part, $taxonomy_term);
         if (Count($arr_available_filters) <= 1) {
             break;
         }
         $active_filter_part = MB_SubStr(Implode($arr_current_filter), 0, MB_StrLen($filter_part) + 1);
         $arr_filter_line = array();
         foreach ($arr_available_filters as $available_filter) {
             $arr_filter_line[$available_filter] = (object) array('filter' => MB_StrToUpper(MB_SubStr($available_filter, 0, 1)) . MB_SubStr($available_filter, 1), 'link' => Post_Type::getArchiveLink($available_filter, $taxonomy_term), 'active' => $active_filter_part == $available_filter, 'disabled' => False);
         }
         $arr_filter[] = $arr_filter_line;
         # Check filter depth limit
         if ($depth && Count($arr_filter) >= $depth) {
             break;
         }
     }
     # Run a filter
     $arr_filter = Apply_Filters('glossary_prefix_filter_links', $arr_filter, $depth);
     return $arr_filter;
 }
开发者ID:andyUA,项目名称:kabmin-new,代码行数:40,代码来源:class.prefix-filter.php

示例7: Tree_Path

}
#-------------------------------------------------------------------------------
$__USER = $GLOBALS['__USER'];
#-------------------------------------------------------------------------------
$Path = Tree_Path('Groups', (int) $__USER['GroupID'], 'ID');
#-------------------------------------------------------------------------------
switch (ValueOf($Path)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'array':
        #---------------------------------------------------------------------------
        $Result = array();
        #---------------------------------------------------------------------------
        $Where = array(SPrintF("((`GroupID` IN (%s) OR `UserID` = %u) AND `IsActive` = 'yes') OR ((SELECT COUNT(*) FROM `OrdersOwners` WHERE `OrdersOwners`.`ServiceID` = `Services`.`ID` AND `UserID` = %u) > 0)", Implode(',', $Path), $__USER['ID'], $__USER['ID']), "`IsHidden` != 'yes'");
        #---------------------------------------------------------------------------
        $Services = DB_Select('Services', array('ID', 'Code', 'Item', 'ServicesGroupID', 'IsActive', '(SELECT `Name` FROM `ServicesGroups` WHERE `ServicesGroups`.`ID` = `Services`.`ServicesGroupID`) as `ServicesGroupName`', '(SELECT `SortID` FROM `ServicesGroups` WHERE `ServicesGroups`.`ID` = `Services`.`ServicesGroupID`) as `ServicesSortID`'), array('SortOn' => array('ServicesSortID', 'SortID'), 'Where' => $Where));
        #---------------------------------------------------------------------------
        switch (ValueOf($Services)) {
            case 'error':
                return ERROR | @Trigger_Error(500);
            case 'exception':
                return FALSE;
            case 'array':
                #-----------------------------------------------------------------------
                $ServicesGroupID = UniqID();
                #-----------------------------------------------------------------------
                foreach ($Services as $Service) {
                    #---------------------------------------------------------------------
                    if ($Service['ServicesGroupID'] != $ServicesGroupID) {
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:Services.comp.php

示例8: array

 $Where = array('`Cost` > 0', '`Discont` < 1', '`DaysRemainded` > 0', SPrintF('`OrderID` IN (%s)', Implode(',', $Array)));
 #-------------------------------------------------------------------------------
 $Count = DB_Count('OrdersConsider', array('Where' => $Where));
 if (Is_Error($Count)) {
     return ERROR | @Trigger_Error(500);
 }
 #-------------------------------------------------------------------------------
 if ($Count) {
     continue;
 }
 #-------------------------------------------------------------------------------
 #-------------------------------------------------------------------------------
 #Debug(SPrintF('[comp/Tasks/GC/ResetOrdersDays]: UserID = %s; OrderIDs = %s',$UserID,Implode(',',$Array)));
 #-------------------------------------------------------------------------------
 # а ещё у него могут быть домены... которые учитываются иначе ... а ещё могут быть услуги настраиваемые вручную...
 $Where = array('`StatusID` = "Suspended" OR `StatusID` = "Active"', SPrintF('`UserID` = %u', $UserID), SPrintF('`ID` NOT IN (%s)', Implode(',', $Array)));
 #-------------------------------------------------------------------------------
 $Count = DB_Count('OrdersOwners', array('Where' => $Where));
 if (Is_Error($Count)) {
     return ERROR | @Trigger_Error(500);
 }
 #-------------------------------------------------------------------------------
 #Debug(SPrintF('[comp/Tasks/GC/ResetOrdersDays]: OrdersOwners Count = %s',$Count));
 #-------------------------------------------------------------------------------
 if ($Count) {
     continue;
 }
 #-------------------------------------------------------------------------------
 Debug(SPrintF('[comp/Tasks/GC/ResetOrdersDays]: Изменено число оставшихся дней (%u->%u) для заказa OrderID = %s; юзер = %s', $OrderConsider['SumDaysRemainded'], $Settings['ResetDaysTo'], $OrderID, $UserID));
 #-------------------------------------------------------------------------------
 #----------------------------------TRANSACTION----------------------------------
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:ResetOrdersDays.comp.php

示例9: array

/** @author Великодный В.В. (Joonte Ltd.) */
/******************************************************************************/
/******************************************************************************/
$__args_list = array('PaymentSystemID', 'InvoiceID', 'Summ');
/******************************************************************************/
eval(COMP_INIT);
/******************************************************************************/
/******************************************************************************/
$Config = Config();
#-------------------------------------------------------------------------------
$Settings = $Config['Invoices']['PaymentSystems']['Yandex'];
#-------------------------------------------------------------------------------
$Send = $Settings['Send'];
#-------------------------------------------------------------------------------
$Send['Sum'] = Round($Summ / $Settings['Course'], 2);
#-------------------------------------------------------------------------------
$Send['customerNumber'] = $GLOBALS['__USER']['ID'];
#-------------------------------------------------------------------------------
$Send['orderNumber'] = $InvoiceID;
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Formats/Invoice/Number', $InvoiceID);
if (Is_Error($Comp)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Md5 = array($Send['Sum'], $Send['CurrencyID'], $Send['BankID'], $Send['ShopID'], $Send['orderNumber'], $Send['customerNumber'], $Settings['Hash']);
#-------------------------------------------------------------------------------
$Send['md5'] = Md5(Implode(';', $Md5));
#-------------------------------------------------------------------------------
return $Send;
#-------------------------------------------------------------------------------
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:Yandex.comp.php

示例10: JSON_Encode

     return ERROR | @Trigger_Error(500);
 case 'exception':
     #-------------------------------------------------------------------------------
     $Window = JSON_Encode(array('Url' => '/InvoiceMake', 'Args' => array('PaymentSystemID' => $PaymentSystemID, 'StepID' => 2)));
     #-------------------------------------------------------------------------------
     $ContractsTypesIDs = array();
     #-------------------------------------------------------------------------------
     foreach ($ContractsTypes as $ContractTypeID => $IsActive) {
         #-------------------------------------------------------------------------------
         if ($IsActive) {
             $ContractsTypesIDs[] = $ContractTypeID;
         }
         #-------------------------------------------------------------------------------
     }
     #-------------------------------------------------------------------------------
     $Comp = Comp_Load('www/ContractMake', array('TypesIDs' => Implode(',', $ContractsTypesIDs), 'IsSimple' => TRUE, 'Window' => Base64_Encode($Window)));
     if (Is_Error($Comp)) {
         return ERROR | @Trigger_Error(500);
     }
     #-------------------------------------------------------------------------------
     return $Comp;
     #-------------------------------------------------------------------------------
 #-------------------------------------------------------------------------------
 case 'array':
     #-------------------------------------------------------------------------------
     $Table[] = array('Платежная система', $PaymentSystem['Name']);
     #-------------------------------------------------------------------------------
     $Options = array();
     #-------------------------------------------------------------------------------
     foreach ($Contracts as $Contract) {
         #-------------------------------------------------------------------------------
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:InvoiceMake.comp.php

示例11: array

    return 'No args...';
}
#-------------------------------------------------------------------------------
$ArgsIDs = array('PAYMENT_ID', 'PAYEE_ACCOUNT', 'PAYMENT_AMOUNT', 'PAYMENT_UNITS', 'PAYMENT_METAL_ID', 'PAYMENT_BATCH_NUM', 'PAYER_ACCOUNT', 'ACTUAL_PAYMENT_OUNCES', 'USD_PER_OUNCE', 'FEEWEIGHT', 'TIMESTAMPGMT', 'V2_HASH');
#-------------------------------------------------------------------------------
foreach ($ArgsIDs as $ArgID) {
    $Args[$ArgID] = @$Args[$ArgID];
}
#-------------------------------------------------------------------------------
$Config = Config();
#-------------------------------------------------------------------------------
$Settings = $Config['Invoices']['PaymentSystems']['Egold'];
#-------------------------------------------------------------------------------
$Hash = array($Args['PAYMENT_ID'], $Args['PAYEE_ACCOUNT'], $Args['PAYMENT_AMOUNT'], $Args['PAYMENT_UNITS'], $Args['PAYMENT_METAL_ID'], $Args['PAYMENT_BATCH_NUM'], $Args['PAYER_ACCOUNT'], StrToUpper(Md5($Settings['Hash'])), $Args['ACTUAL_PAYMENT_OUNCES'], $Args['USD_PER_OUNCE'], $Args['FEEWEIGHT'], $Args['TIMESTAMPGMT']);
#-------------------------------------------------------------------------------
$Hash = StrToUpper(Md5(Implode(':', $Hash)));
#-------------------------------------------------------------------------------
if ($Hash != $Args['V2_HASH']) {
    return ERROR | @Trigger_Error('[comp/www/Merchant/Egold]: проверка подлинности завершилась не удачей');
}
#-------------------------------------------------------------------------------
$Invoice = DB_Select('Invoices', array('ID', 'Summ'), array('UNIQ', 'ID' => $Args['PAYMENT_ID']));
#-------------------------------------------------------------------------------
switch (ValueOf($Invoice)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'array':
        #---------------------------------------------------------------------------
        if (Round($Invoice['Summ'] / $Settings['Course'], 2) != $Args['PAYEE_ACCOUNT']) {
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:Egold.comp.php

示例12: Extended_Implode

 function Extended_Implode($array, $separator = ', ', $last_separator = ' and ')
 {
     $array = (array) $array;
     if (Count($array) == 0) {
         return '';
     }
     if (Count($array) == 1) {
         return $array[0];
     }
     $last_item = Array_pop($array);
     $result = Implode($array, $separator) . $last_separator . $last_item;
     return $result;
 }
开发者ID:rtgibbons,项目名称:bya.org,代码行数:13,代码来源:contribution.php

示例13: SPrintF

                 } else {
                     #-------------------------------------------------------------------------------
                     $Array[] = $GLOBALS['TaskReturnInfo'][$Key];
                     #-------------------------------------------------------------------------------
                 }
                 #-------------------------------------------------------------------------------
             }
             #-------------------------------------------------------------------------------
         } else {
             #-------------------------------------------------------------------------------
             $Array[] = $GLOBALS['TaskReturnInfo'];
             #-------------------------------------------------------------------------------
         }
         #-------------------------------------------------------------------------------
         if (SizeOf($Array) > 0) {
             $AddPrameter = SPrintF('[%s]', Implode('; ', $Array));
         }
         #-------------------------------------------------------------------------------
     }
     #-------------------------------------------------------------------------------
     echo SPrintF("%s in %s: Task #%s have executed [%s] %s\n", Date('Y-m-d', Time()), Date('H:i:s', Time()), $Number, $Task['TypeID'], $AddPrameter);
     #-------------------------------------------------------------------------------
     if (isset($GLOBALS['TaskReturnInfo'])) {
         unset($GLOBALS['TaskReturnInfo']);
     }
     #-------------------------------------------------------------------------------
     break;
     #-------------------------------------------------------------------------------
 #-------------------------------------------------------------------------------
 default:
     return ERROR | @Trigger_Error(101);
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:Demon.comp.php

示例14: send

 public function send(Msg $msg)
 {
     // Get template file path.
     $templatePath = SPrintF('Notifies/Email/%s.tpl', $msg->getTemplate());
     $smarty = JSmarty::get();
     $smarty->clearAllAssign();
     if (!$smarty->templateExists($templatePath)) {
         throw new jException('Template file not found: ' . $templatePath);
     }
     $smarty->assign('Config', Config());
     foreach (array_keys($msg->getParams()) as $paramName) {
         $smarty->assign($paramName, $msg->getParam($paramName));
     }
     $message = $smarty->fetch($templatePath);
     try {
         // Debug("msg->getParam('Theme'): "+ $msg->getParam('Theme'));
         if ($msg->getParam('Theme')) {
             // Debug("SET THEME FROM PARAMS");
             $theme = $msg->getParam('Theme');
         } else {
             // Debug("SET THEME FROM TEMPLATE");
             $theme = $smarty->getTemplateVars('Theme');
         }
         // Debug("THEME: "+$theme);
         if (!$theme) {
             $theme = '$Theme';
         }
     } catch (Exception $e) {
         throw new jException(SPrintF("Can't fetch template: %s", $templatePath), $e->getCode(), $e);
     }
     $recipient = $msg->getParam('User');
     if (!$recipient['Email']) {
         throw new jException('E-mail address not found for user: ' . $recipient['ID']);
     }
     $sender = $msg->getParam('From');
     $emailHeads = array(SPrintF('From: %s', $sender['Email']), 'MIME-Version: 1.0', 'Content-Transfer-Encoding: 8bit', SPrintF('Content-Type: multipart/mixed; boundary="----==--%s"', HOST_ID));
     // added by lissyara 2013-02-13 in 15:45 MSK, for JBS-609
     if ($msg->getParam('Message-ID')) {
         $emailHeads[] = SPrintF('Message-ID: %s', $msg->getParam('Message-ID'));
     }
     $Params = array();
     if ($msg->getParam('Recipient')) {
         $Params[] = $msg->getParam('Recipient');
     } else {
         $Params[] = $recipient['Email'];
     }
     $Params[] = $theme;
     $Params[] = $message;
     $Params[] = Implode("\r\n", $emailHeads);
     $Params[] = $recipient['ID'];
     if ($msg->getParam('EmailAttachments')) {
         $Params[] = $msg->getParam('EmailAttachments');
     } else {
         $Params[] = 'не определено';
     }
     $taskParams = array('UserID' => $recipient['ID'], 'TypeID' => 'Email', 'Params' => $Params);
     $result = Comp_Load('www/Administrator/API/TaskEdit', $taskParams);
     switch (ValueOf($result)) {
         case 'error':
             throw new jException("Couldn't add task to queue: " . $result);
         case 'exception':
             throw new jException("Couldn't add task to queue: " . $result->String);
         case 'array':
             return TRUE;
         default:
             throw new jException("Unexpected error.");
     }
 }
开发者ID:carriercomm,项目名称:jbs,代码行数:68,代码来源:Email.class.php

示例15: Array_Shift

            $Count++;
            $SendedIDs[] = $User;
            Array_Shift($SendToIDs);
            #-------------------------------------------------------------------------
            break;
        default:
            return ERROR | @Trigger_Error(101);
    }
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
#Debug(SPrintF('[comp/Tasks/Dispatch]: SendToIDs = %s; SendedIDs = %s;',Implode(',',$SendToIDs),Implode(',',$SendedIDs)));
#-------------------------------------------------------------------------------
# сохраняем параметры задачи
$Task['Params']['SendToIDs'] = Implode(',', Array_Filter($SendToIDs));
$Task['Params']['SendedIDs'] = Implode(',', Array_Filter($SendedIDs));
$UTasks = array('Params' => $Task['Params']);
$IsUpdate = DB_Update('Tasks', $UTasks, array('ID' => $Task['ID']));
#-------------------------------------------------------------------------------
if (Is_Error($IsUpdate)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$GLOBALS['TaskReturnInfo']['Sended'] = array(SizeOf(Array_Filter($SendedIDs)));
$GLOBALS['TaskReturnInfo']['New'] = array($Count);
$GLOBALS['TaskReturnInfo']['Estimated'] = array(SizeOf(Array_Filter($SendToIDs)));
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (SizeOf($SendToIDs) > 0) {
    return $ExecuteTime;
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:Dispatch.comp.php


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