• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Channel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: addChannel

 /**
  * Add a channel to the bouquet.
  * @param Channel $pChannel
  */
 public function addChannel(Channel $pChannel)
 {
     if ($pChannel->getID() != 'none') {
         $this->lChannels[] = $pChannel;
         $this->lChannelCount++;
     }
 }
开发者ID:theyosh,项目名称:DreamboxReStream,代码行数:11,代码来源:Bouquet.class.php


示例2: send

 /**
  * Send an message on a channel for an event
  *
  * @param $channel
  * @param $event
  * @param $data
  * @throws SockinException
  * @return string
  */
 public function send($channel, $event, $data)
 {
     $this->route = "send";
     $codedChannel = $this->channel->verify($channel, $this->appId);
     $jsonData = $this->getJson($data);
     $hashedData = $this->hashData($jsonData, $codedChannel, $event);
     return $this->dispatchMessage($jsonData, $codedChannel, $event, $hashedData);
 }
开发者ID:divergentsoft,项目名称:sockin-php,代码行数:17,代码来源:Sockin.php


示例3: parseWrite

 private function parseWrite(Channel $channel, $message)
 {
     return [$channel, null, function () use($channel, $message) {
         return $channel->write($message);
     }, function ($current) use($channel) {
         $channel->cancelWrite($current);
     }];
 }
开发者ID:crystalplanet,项目名称:redshift,代码行数:8,代码来源:ChannelSelector.php


示例4: testPubsubhubbub

 public function testPubsubhubbub()
 {
     $channel = new Channel();
     $channel->pubsubhubbub('http://example.com/feed.xml', 'http://pubsubhubbub.appspot.com');
     $xml = $channel->asXML()->asXML();
     $this->assertContains('<atom:link rel="self" href="http://example.com/feed.xml" type="application/rss+xml"/>', $xml);
     $this->assertContains('<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/>', $xml);
 }
开发者ID:suin,项目名称:php-rss-writer,代码行数:8,代码来源:ChannelTest.php


示例5: start

 static function start()
 {
     # CREATE GENOSAGE
     $genosage = new Core();
     # CREATE CHANNEL
     $channel = new Channel();
     $channel->channel();
 }
开发者ID:noevil,项目名称:genosage,代码行数:8,代码来源:Core.core.php


示例6: addChannel

 public function addChannel(Channel $channel)
 {
     if (isset($this->channelNames[$channel->getName()])) {
         return;
     }
     $this->channelNames[$channel->getName()] = true;
     $this->collection->attach($channel);
 }
开发者ID:nesquick,项目名称:trafficcophp,代码行数:8,代码来源:ChannelCollection.php


示例7: add

 /**
  * @param Channel $channel
  */
 public function add(Channel $channel)
 {
     $name = $this->normalizeName($channel->getName());
     // prevent channel overwrites
     if ($this->exists($name)) {
         return;
     }
     $this->channels[$name] = $channel;
 }
开发者ID:helmutschneider,项目名称:websocket-chat,代码行数:12,代码来源:ChannelCollection.php


示例8: findChannelParameter

 private function findChannelParameter(Channel $channel, $key)
 {
     $parameters = $channel->getParameters();
     foreach ($parameters as $parameter) {
         if ($parameter->getKey() == $key) {
             return $parameter;
         }
     }
     return null;
 }
开发者ID:stdtabs,项目名称:phptabs,代码行数:10,代码来源:ChannelRouterConfigurator.php


示例9: getJsonTags

	function getJsonTags(){
		if ( (empty($this->idchannel) || $this->idchannel<=0) ) {
			if (isset($_GET['channel']) && !empty($_GET['channel'])) { 
				require_once("class/Channel.php");
				$tmp = new Channel(); $tmp->setUrlname($_GET['channel']);
				$this->idchannel=$tmp->getId();
				if (empty($this->idchannel)) $this->idchannel=-1;
			}
		}
		if ($this->listType=='cloneUFLast')
			$query = Topic::cloneUFLast($this->qtd, $this->lastorderid, $this->idchannel);
		elseif ($this->listType=='cloneFollowed')
			$query = Topic::cloneFollowed($this->qtd, $this->lastorderid, $this->idchannel);
		elseif ($this->listType=='cloneSearch')
			$query = Topic::cloneSearch($this->search, $this->qtd, $this->orderid);
		elseif ($this->listType=='cloneUpdated')
			$query = Topic::cloneUpdated($this->ids, $this->counters, $this->qtd, $this->orderid, $this->idchannel);
		elseif ($this->listType=='cloneNew')
			$query = Topic::cloneNew($this->lastid, $this->qtd, $this->orderid, $this->idchannel);
		elseif ($this->listType=='cloneByUser')
			$query = Topic::cloneByUser($this->user, $this->qtd, $this->orderid, $this->sorting, $this->idchannel);
		elseif ($this->listType=='cloneByUserPost')
			$query = Topic::cloneByUserPost($this->user, $this->qtd, $this->orderid, $this->sorting, $this->idchannel);
		elseif ($this->listType=='cloneByDate')
			$query = Topic::cloneByDate($this->user, $this->year, $this->month, $this->day);
		elseif ($this->listType=='cloneChannelFollowed')
			$query = Topic::cloneChannelFollowed($this->qtd, $this->orderid, $this->lastorderid, $this->sorting);
		else
			$query = Topic::cloneLast($this->qtd, $this->orderid, $this->sorting, $this->idchannel);

		$result = array();

		if ($query!=null){
			global $CONF;
			if ($this->with_posts){
				require_once('template/TListPost.php');
				foreach ($query as $topic){
					$tlistpost = new TListPost(); $tlistpost->setTopic($topic);
					$ttopic = new TTopic(); $ttopic->setTopic($topic);
					array_push($result, array('topic'=>$ttopic->getJsonTags(), "posts"=>$tlistpost->getJsonTags()) );
				}
			} else {
				foreach ($query as $topic){
					$tmp=$topic->getJsonTags();
					if ($this->onlysubsumed)
						unset($tmp['msg']);
					array_push($result, $tmp);
				}
			}
		}

		return $result;
	}
开发者ID:rczeus,项目名称:Rapid-Coffee,代码行数:53,代码来源:TListTopic.php


示例10: push

 public function push($data)
 {
     require_once DIR_SYSTEM . '/baidu/Channel.class.php';
     // var_dump(BAE_API_KEY);
     $channel = new Channel(BAE_API_KEY, BAE_SECRET_KEY);
     if (array_key_exists('description', $data)) {
         if (mb_strlen($data['description'], 'utf-8') > 39) {
             $data['description'] = mb_substr($data['description'], 0, 37, 'utf-8') . '...';
         }
     }
     //推送类型,1单人(必须指定user_id和channel_id)、2群组(必须指定tag_name)、3所有人
     $push_type = $data['push_type'];
     $message["title"] = array_key_exists('title', $data) ? $data['title'] : '';
     //android必选
     $message["description"] = $data['description'];
     //android必选
     // $message["custom_content"] = array ("jump_id" => array_key_exists('jump_id', $data) ? $data['jump_id'] : '', "url" => array_key_exists('url', $data) ? $data['url'] : '');//android自定义字段
     $message["aps"] = array("alert" => $data['description'], "sound" => "", "badge" => 1);
     //ios特有字段
     if (array_key_exists('custom_content', $data)) {
         if ($data['device_type'] == 3) {
             //android
             $message["custom_content"] = $data['custom_content'];
         } elseif ($data['device_type'] == 4) {
             //ios
             foreach ($data['custom_content'] as $key => $value) {
                 $message[$key] = $value;
             }
         }
     }
     $message_key = "msg_key";
     //不支持ios
     //1:浏览器设备、2:pc设备、3:Android设备、4:ios设备、5:windows phone设备
     $optional[Channel::DEVICE_TYPE] = $data['device_type'];
     //Channel::USER_ID,标识用户的ID,分为百度账号与无账号体系:无账号体系的user_id根据端上属性生成;百度账号体系根据账号生成user_id。
     $optional[Channel::USER_ID] = array_key_exists('user_id', $data) ? $data['user_id'] : '';
     //Channel::MESSAGE_TYPE,消息类型,0:消息(透传),1:通知
     $optional[Channel::MESSAGE_TYPE] = array_key_exists('message_type', $data) ? $data['message_type'] : 1;
     //ios部署状态,1开发状态,默认是2生产状态
     $optional[Channel::DEPLOY_STATUS] = array_key_exists('deploy_status', $data) ? $data['deploy_status'] : '';
     $ret = $channel->pushMessage($push_type, $message, $message_key, $optional);
     if (false === $ret) {
         // $err = 'ERROR NUMBER: ' . $channel->errno() . '; ERROR MESSAGE: ' . $channel->errmsg() . '; REQUEST ID: ' .
         // 	 $channel->getRequestId() . ";";
         // Log::record($err);
         // var_dump( array ("ret" => SYS_RET_ERR, "err" => $err) );
     } else {
         // var_dump( array ("ret" => 0, "err" => "") );
     }
 }
开发者ID:TheTypoMaster,项目名称:ACGStorm,代码行数:50,代码来源:baepush.class.php


示例11: getChannelId

 private function getChannelId($name)
 {
     $name = trim($name);
     static $cache = array();
     if (!isset($cache[$name])) {
         $channel = Channel::model()->findByAttributes(array('name' => $name));
         if ($channel == null) {
             $channel = new Channel();
             $channel->name = $name;
             $channel->save();
         }
         $cache[$name] = $channel->id;
     }
     return $cache[$name];
 }
开发者ID:qyt1988528,项目名称:union,代码行数:15,代码来源:ImportCommand.php


示例12: create_account

function create_account()
{
	global $CONF;
	$user = new RegUser();

	if (!preg_match("/^[".$CONF['nickname_chars']."]+$/i", $_POST['nickname_create_account']))
		return array('ok'=>false, 'error'=>'invalid nickname');

	if (trim($_POST['password_create_account'])=='')
		return array('ok'=>false, 'error'=>'no password');

	$user->setEmail($_POST['email_create_account']);
	$user->setNickname($_POST['nickname_create_account']);
	$user->setPassword($_POST['password_create_account']);
	if (isset($_POST['signature_create_account']))
		$user->setSignature($_POST['signature_create_account']);

	if (isset($_POST['camefrom_create_account']))
		$user->setCameFrom($_POST['camefrom_create_account']);

	$r = $user->save();
	if ($r=='ok')
	{
		$channel=new Channel();
		$channel->setId(1);
		$channel->forceFollow($user);
		$r = $user->sendEmail();
		if (!$r)
			return array('ok'=>false, 'error'=>'we could not send the e-mail.');
		else{
			$GLOBALS['user'] = $user;
			$rc = new RegUser();
			$rc->setNickname("RapidCoffee");
			$rc->load();
			$topic = new Topic();
			$topic->setChannel($channel);
			$topic->setUser($rc);
			$topic->setSubject("Dêem boas vindas ao usuário " . $user->getNickname() . "!");
			$msg = "Seja bem-vindo(a), <b>" . $user->getNickname() . "</b>. Criamos este tópico para que você possa se apresentar e conhecer um pouco dos usuários do site. Boa estadia =)<br /><br />Equipe Rapid Coffee.";
			$msg = str_replace('&nbsp;',' ',$msg);
			$topic->setMsg($msg);
			$topic->save();
			$topic->follow();
			return array('ok'=>true, 'error'=>'');
		}
	}
	return array('ok'=>false, 'error'=>$r);
}
开发者ID:rczeus,项目名称:Rapid-Coffee,代码行数:48,代码来源:create_account.php


示例13: followchannel

function followchannel($channelid){

	if ($_SESSION['user']->isAnon())
		return array("ok"=>false, "error"=>"you have to login");

	global $LANGALL;
	global $CONF;

	$channel = new Channel();
	if (!isset($channelid))
		return array("ok"=>false, "error"=>"no id");
	$channel->setId($channelid);
	if ($channel->getAsktofollow()){
		if ($_SESSION['user']->isAnon())
			return array("ok"=>false, "error"=>"anon cant follow");

		require_once('class/Message.php');
		$message = new Message();
		$message->setUserFrom($_SESSION['user']);
		$message->setUserTo($channel->getUser());

		$__ufid = $channel->unconfirmed_follow();
		$check=hash('sha512',"00`Θ^*' ♣  hk".chr(11)."1".$__ufid);

		if ($channel->getUser()->getLang()=='pt_br'){
			$message->setSubject($LANGALL['pt_br']['channel_asktofollow_subject']);
			eval($LANGALL['pt_br']['channel_asktofollow_msg']);
			$msg = '#'.$channel->getName().'\n<br/>'.'@'.$_SESSION['user']->getNickname().'\n<br/>'.$body;
			if (isset($_GET['msg_followchannel']))
				$msg.=$_GET['msg_followchannel'];
			$message->setMsg($msg);
		} else {
			$message->setSubject($LANGALL['en_us']['channel_asktofollow_subject']);
			eval($LANGALL['pt_br']['channel_asktofollow_msg']);
			$msg = '#'.$channel->getName().'\n<br/>'.'@'.$_SESSION['user']->getNickname().'\n<br/>'.$body;
			if (isset($_GET['msg_followchannel']))
				$msg.=$_GET['msg_followchannel'];
			$message->setMsg($msg);
		}
		$result=$message->save();
		if ($result=='ok')
			return array("ok"=>false, "error"=>"asked for permission", "msg"=>"asked for permission");
		else
			return array("ok"=>false, "error"=>"error cant send message: ".$result, "msg"=>"");
		
	} else {
		if ($channel->follow())
			return array("ok"=>true, "error"=>"");
		else
			return array("ok"=>false, "error"=>"cant follow");
	}

}
开发者ID:rczeus,项目名称:Rapid-Coffee,代码行数:53,代码来源:followchannel.php


示例14: getWorkingChannelName

 /**
  * @return string
  */
 public function getWorkingChannelName()
 {
     if (!isset($this->workingChannelName)) {
         $this->workingChannelName = $this->channel->getName() . '_' . spl_object_hash($this) . '_' . uniqid();
     }
     return $this->workingChannelName;
 }
开发者ID:max-voloshin,项目名称:php-redis-mq,代码行数:10,代码来源:Consumer.php


示例15: run

 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Channel::create([]);
     }
 }
开发者ID:jonagoldman,项目名称:channelmanager,代码行数:7,代码来源:ChannelsTableSeeder.php


示例16: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     //
     $interactor = new CurlInteractor();
     $interactor->setResponseFactory(new SlackResponseFactory());
     $commander = new Commander($_ENV['SLACK_KEY'], $interactor);
     $channels = Channel::where('is_member', true)->get();
     foreach ($channels as $channel) {
         $latest = $channel->latest ?: 0;
         do {
             $response = $commander->execute('channels.history', ['channel' => $channel->sid, 'oldest' => $latest, 'count' => 1000]);
             $responseBody = $response->getBody();
             foreach ($responseBody['messages'] as $msg) {
                 $latest = $msg['ts'] > $latest ? $msg['ts'] : $latest;
                 $message = new Message();
                 foreach ($msg as $k => $v) {
                     $message->{$k} = is_string($v) ? $v : (object) $v;
                 }
                 $message->channel = $channel->sid;
                 $message->save();
             }
         } while ($responseBody['has_more']);
         $channel->latest = $latest;
         $channel->save();
     }
 }
开发者ID:kenyiu,项目名称:slacklogs,代码行数:31,代码来源:LoadMessagesCommand.php


示例17: actionAjaxGetChannels

 public function actionAjaxGetChannels()
 {
     $pointId = Yii::app()->request->getPost('pointId');
     $pointDateStr = date('Y-m-d');
     $requestTime = date('H:i:s');
     $pointDatetimeStr = $pointDateStr . " 23:59:59";
     $pointDateTimestamp = strtotime($pointDateStr);
     $weekDay = strtolower(date('D', $pointDateTimestamp));
     $Playlist = new Playlists();
     $pointChannels = Channel::model()->findAll('id_point=:id_point AND window_id IS NOT NULL', array(':id_point' => $pointId));
     $resp = array();
     foreach ($pointChannels as $pointChannel) {
         $pointChannelId = $pointChannel->internalId;
         $windowId = $pointChannel->window_id;
         if (!is_null($windowId)) {
             $bg = $Playlist->GetBGContentArr($pointId, $pointChannelId, $pointDatetimeStr, $weekDay);
             $adv = $Playlist->GetAdvContentArr($pointId, $pointChannelId, $pointDatetimeStr, $weekDay);
             $blockStructedContent = $Playlist->BuildBlockStructedContent($bg, $adv);
             $straightTimeContent = $Playlist->ConverBlockStructedToStraightTimeContent($blockStructedContent);
             $straightTimeContentHisToSecs = $this->ConvertHisToSecsInStraightTime($straightTimeContent, $requestTime);
             $url = Yii::app()->request->getBaseUrl(true) . '/spool/points/' . $pointId . '/' . $pointChannelId;
             $straightTimeContentWithURLPath = $this->UpdateContentPathes($straightTimeContentHisToSecs, $url);
             $window = Window::model()->findByPK($windowId);
             $widgetToChannel = WidgetToChannel::model()->find("channel_id = :channel_id", array("channel_id" => $pointChannel->id));
             $widget = '';
             if (count($widgetToChannel) > 0) {
                 $widgetModel = Widget::model()->findByPk($widgetToChannel['widget_id']);
                 $widget = $widgetModel['content'];
             }
             $resp[] = array('width' => $window->width, 'height' => $window->height, 'top' => $window->top, 'left' => $window->left, 'content' => $straightTimeContentWithURLPath, 'widget' => $widget);
         }
     }
     echo json_encode($resp);
     exit;
 }
开发者ID:AlexanderKosianchuk,项目名称:rtvgroup,代码行数:35,代码来源:PreviewController.php


示例18: channelInfo

    public function channelInfo()
    {
        if (isset($_GET['channel_disc'])) {
            try {
                $channel = Channel::get($_GET['channel_disc']);
                $view = <<<EOD
<div class="prg_rec_cfg ui-corner-all">
<div class="prg_title">{$channel->name}</div>

<table>
<tr>
  <td>種別</td><td>{$channel->type}</td>
</tr>
<tr>
  <td>物理チャンネル</td><td>{$channel->channel}</td>
</tr>
<tr>
  <td>サービスID</td>
  <td>
<form method="post" action="channelSetSID.php">
<input type="text" name="n_sid" size="20" id="id_sid" value="{$channel->sid}" />
<input type="hidden" name="n_channel_disc" id="id_disc" value="{$channel->channel_disc}" />
</form>
  </td>
</tr>
</table>
</div>
EOD;
                echo $view;
            } catch (Exception $e) {
                echo 'Error:チャンネル情報の取得に失敗';
            }
        }
    }
开发者ID:ha1t,项目名称:epgrec,代码行数:34,代码来源:api.php


示例19: action

 private function action($form)
 {
     $session = session_currentSession();
     $p = new Channel();
     $p->user = $session->id;
     $p->label = $form->name;
     $p->short_label = $form->shortname;
     $p->key = $this->generateKey();
     $p->secret = $this->generateSecret();
     $p->domain = $form->domain;
     // ISO-8601 2005-08-14T16:13:03+0000;
     $time = time() + $value;
     $p->created = date('c', $time);
     $p->save();
     //header('location:/account/settings');
 }
开发者ID:aventurella,项目名称:Galaxy,代码行数:16,代码来源:ChannelCreate.php


示例20: channel_select

/**
 * Prints a <select> of the available channels
/**/
function channel_select($params = '', $selected = '', $id = 00)
{
    $channels = Channel::getChannelList();
    echo "\n<select name=\"chan_{$id}\" {$params}>";
    foreach ($channels as $chanid) {
        $channel =& Channel::find($chanid);
        // Not visible?
        if (empty($channel->visible) || $channel->chanid == 91010) {
            continue;
        }
        // Print the option
        echo '
                <option value="', $channel->chanid, '"', ' title="', html_entities($channel->name), '"';
        // Selected?
        if ($channel->chanid == $selected || $channel->chanid == $_GET['chanid']) {
            echo ' SELECTED';
        }
        // Print the rest of the content
        echo '>';
        if ($_SESSION["prefer_channum"]) {
            echo $channel->channum . '&nbsp;&nbsp;(' . html_entities($channel->callsign) . ')';
        } else {
            echo html_entities($channel->callsign) . '&nbsp;&nbsp;(' . $channel->channum . ')';
        }
        echo '</option>';
    }
    echo '</select>';
}
开发者ID:AndrewMoore10,项目名称:MythWebKGTV,代码行数:31,代码来源:quad.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Character类代码示例发布时间:2022-05-20
下一篇:
PHP ChangesList类代码示例发布时间:2022-05-20
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap