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

PHP Agent类代码示例

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

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



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

示例1: __construct

 /**
  * Constructor
  * 
  * @param object HierarchicalRadioMatrix $property
  * @param object Agent $agent
  * @return void
  * @access public
  * @since 11/14/07
  */
 public function __construct(HierarchicalRadioMatrix $property, Agent $agent)
 {
     $this->property = $property;
     $this->agent = $agent;
     $this->agentId = $agent->getId();
     $this->siteImplicitRole = new NoAccess_SegueRole();
     $this->siteImplicitRoleMessage = '';
 }
开发者ID:adamfranco,项目名称:segue,代码行数:17,代码来源:PopulateRolesVisitor.class.php


示例2: processEvent

 private function processEvent()
 {
     $dom = $this->dom;
     $headerNode = $dom->getElementsByTagName('SIF_Header')->item(0);
     $originalMsgId = $headerNode->getElementsByTagName('SIF_MsgId')->item(0)->nodeValue;
     $originalSourceId = $headerNode->getElementsByTagName('SIF_SourceId')->item(0)->nodeValue;
     $originalTimestamp = $headerNode->getElementsByTagName('SIF_Timestamp')->item(0)->nodeValue;
     $validSourceId = Agent::checkSourceId($originalSourceId);
     if (!$validSourceId) {
         RegisterError::invalidSourceId($agent->sourceId, $originalMsgId);
     } else {
         $agent = new Agent($originalSourceId);
         if ($agent->isRegistered()) {
             $eventObjectNode = $dom->getElementsByTagName('SIF_EventObject')->item(0);
             $objectName = $eventObjectNode->getAttribute('ObjectName');
             $objectAction = $eventObjectNode->getAttribute('Action');
             $objectAction = strtolower($objectAction);
             if (!DataObject::objectExists($objectName)) {
                 ProvisionError::invalidObject($originalSourceId, $originalMsgId, $objectName);
                 exit;
             } else {
                 $allowed = $this->hasPermission($objectName, $objectAction, $agent->agentId);
                 if ($allowed) {
                     $provider = DataObject::isProvider($objectName, $agent->agentId);
                     if ($provider) {
                         $this->publishEvent($agent->agentId, $objectName, $objectAction, $_SESSION['ZONE_VERSION'], $dom->saveXml($headerNode));
                         $timestamp = Utility::createTimestamp();
                         $msgId = Utility::createMessageId();
                         $sifMessageNode = $dom->getElementsByTagName('SIF_Message')->item(0);
                         XmlHelper::buildSuccessMessage($msgId, $timestamp, $originalSourceId, $originalMsgId, 0, $originalMsg = null, $desc = null);
                     } else {
                         ProvisionError::notProviderError($originalSourceId, $originalMsgId);
                     }
                 } else {
                     switch ($objectAction) {
                         case 'add':
                             ProvisionError::invalidPermissionToPublishAdd($originalSourceId, $originalMsgId, $objectName);
                             break;
                         case 'change':
                             ProvisionError::invalidPermissionToPublishChange($originalSourceId, $originalMsgId, $objectName);
                             break;
                         case 'delete':
                             ProvisionError::invalidPermissionToPublishDelete($originalSourceId, $originalMsgId, $objectName);
                             break;
                     }
                     //switch for error message
                 }
                 //allowed
             }
             //object exist
         } else {
             RegisterError::notRegisteredError($originalSourceId, $originalMsgId);
         }
         //not registered
     }
     //valid sourceId
 }
开发者ID:Koulio,项目名称:OpenZIS,代码行数:57,代码来源:Event2.php


示例3: onlySmithCanReplicate

 /**
  * @dataProvider agents
  * @test
  * @param Agent $agent
  * @param type $name
  * @param type $isNowAgent 
  */
 public function onlySmithCanReplicate(Agent $agent, $name, $shouldReplicate)
 {
     $victim = new Program();
     $replication = new AgentReplication();
     $agent->setName($name);
     $replication->replicate($agent, $victim);
     if ($shouldReplicate) {
         $this->assertEquals('Agent', get_class($victim));
     } else {
         $this->assertEquals('Program', get_class($victim));
     }
 }
开发者ID:nottrobin,项目名称:tdd-training-exercises,代码行数:19,代码来源:AgentReplicationTest.php


示例4: Create

 function Create($email, $firstname, $lastname, $phone, $password, $repassword, $sendButton = null)
 {
     $repassword = $repassword == "null" ? null : $repassword;
     $agent = new Agent();
     $agent->set($firstname, $lastname, $email, $phone, $password);
     $agentModel = new AgentModel($agent);
     $list = $agentModel->GetUsers();
     $this->agentModelView->agent = $agent;
     $this->agentModelView->agentList = $list;
     if ($agent->validated()) {
         if ($password != $repassword) {
             Session::set("warning", " Password mis-matched, re-enter passwords again!");
             return $this->View($this->agentModelView, "Agent", "Create");
         } else {
             $this->agentModelView->agentDbModel = $agentModel;
             if ($agentModel->Exists()) {
                 Session::set("warning", "The user with the given email address [{$email}] already exists!");
             } else {
                 try {
                     //else create the user
                     if ($agentModel->Create()) {
                         $sessionID = Validator::UniqueKey(20);
                         $agentModel->SaveVerificationCode($email, $sessionID);
                         //create a barcode
                         $param = new ArrayIterator();
                         $param->offsetSet("username", $agent->email);
                         $param->offsetSet("verificationCode", $sessionID);
                         $url = ContextManager::CreateURL("Agent", "Login", $param);
                         $imgPath = ContextManager::CreateQRBarcode($url, $agent->agentId);
                         if ($this->_sendVerificationEmail($agent, $sessionID, $imgPath)) {
                             //navigate to comfirmation page
                             return $this->View($agent, "Agent", "Confirmation");
                         } else {
                             Session::set("warning", "could not send mail ");
                             $agentModel->DeleteAgent($email);
                         }
                     }
                 } catch (Exception $err) {
                     Session::set("warning", $err->getMessage());
                 }
             }
         }
         // create a database record here
     } else {
         Session::set("warning", $agent->getError());
     }
     return $this->View($this->agentModelView, "Agent", "Create");
 }
开发者ID:jimobama,项目名称:app,代码行数:48,代码来源:AgentController.php


示例5: detail

 public function detail($idLook, $categoria, $name)
 {
     $producto = DB::table('looks')->where('looks.idlook', $idLook)->where('looks.estado', '>=', 1)->join('lookbook', 'lookbook.idlookbook', '=', 'looks.idlookbook')->select('looks.*', 'lookbook.nombre')->get();
     $subcate = $producto[0]->subcategoria;
     $ordensuperior = $producto[0]->orden2 + 1;
     $ordeninferior = $producto[0]->orden2 - 1;
     $numregistros = DB::table('looks')->where('looks.idlookbook', $categoria)->count();
     if ($ordensuperior > $numregistros) {
         $ordensuperior = 1;
     }
     if ($ordeninferior <= 1) {
         $ordeninferior = $numregistros;
     }
     $prodsiguiente = DB::table('looks')->where('looks.orden2', $ordensuperior)->where('looks.estado', '>=', 1)->where('looks.idlookbook', $categoria)->select('looks.idlook', 'looks.nombrelook', 'looks.idlookbook')->take(1)->get();
     $prodanterior = DB::table('looks')->where('looks.orden2', $ordeninferior)->where('looks.estado', '>=', 1)->where('looks.idlookbook', $categoria)->select('looks.idlook', 'looks.nombrelook', 'looks.idlookbook')->take(1)->get();
     /*$similares = DB::table('looks')
     		->where('looks.idlookbook', '=', $categoria)
     		->where('looks.estado', '=', 1)
     		->where('looks.idlook', '!=', $idLook)
     		->select('looks.*')
     		->orderBy('looks.orden2')
     		->take(4)
     		->get();*/
     $similares = DB::table('looks')->where('looks.idlookbook', '=', $categoria)->where('looks.estado', '>=', 1)->where('looks.idlook', '!=', $idLook)->where('looks.subcategoria', $subcate)->select('looks.*')->orderBy(DB::raw('RAND()'))->get();
     $isMobile = Agent::isMobile();
     if ($isMobile) {
         return View::make('mobile/lookbook-detail')->with('producto', $producto)->with('similares', $similares)->with('sig', $prodsiguiente)->with('ant', $prodanterior);
     } else {
         return View::make('desktop/lookbook-detail')->with('producto', $producto)->with('similares', $similares)->with('sig', $prodsiguiente)->with('ant', $prodanterior);
     }
 }
开发者ID:appsmambo,项目名称:tendencias-2015,代码行数:31,代码来源:LookbookController.php


示例6: store

 public function store()
 {
     $prospect = new Prospect();
     $fullAddress = Input::get('prospect-address');
     $addressPieces = explode(", ", $fullAddress);
     $prospect->prospect_address = $addressPieces[0];
     $prospect->prospect_city = $addressPieces[1];
     $prospect->prospect_state = $addressPieces[2];
     $prospect->prospect_address_lat = Input::get('latitude');
     $prospect->prospect_address_lng = Input::get('longitude');
     $prospect->prospect_zip = Input::get('zipcode');
     if (Input::has('prospect-unit-number')) {
         $prospect->prospect_apt_unit = Input::get('prospect-unit-number');
     }
     $prospect->agent_id = Agent::findOrFail(1)->id;
     //formula to determine agent
     $prospect->broker_id = Broker::findOrFail(1)->id;
     if ($prospect->save()) {
         //true returns true or false
         return Redirect::action('HomeController@edit', array('prospect' => $prospect->id));
     } else {
         Session::flash('errorMessage', 'Unable to locate property!');
         return Redirect::back()->withInput();
     }
 }
开发者ID:lfuentes1,项目名称:Valuations,代码行数:25,代码来源:HomeController.php


示例7: getCreditLimit

 public static function getCreditLimit($agent_id)
 {
     if (Entrust::hasRole('Agent')) {
         return Agent::where('user_id', $agent_id)->first()->credit_limit;
     }
     return false;
 }
开发者ID:tharindarodrigo,项目名称:agent,代码行数:7,代码来源:Agent.php


示例8: getcomboboxesAction

 public function getcomboboxesAction()
 {
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         if (!$this->getRequest()->isXmlHttpRequest()) {
             $this->view->msg = 'Not Ajax Request';
             $this->_forward('error', 'error');
         } else {
             $zones = Zone::getAllZones();
             $contexts = Context::getAllContexts();
             $agents = Agent::getAllAgents();
             $this->view->zones = $zones;
             $this->view->agents = $agents;
             $this->view->contexts = $contexts;
             $this->render('aclcomboboxes');
         }
     } else {
         if (!$this->getRequest()->isXmlHttpRequest()) {
             $this->view->msg = 'Not Ajax Request';
             $this->_forward('error', 'error');
         } else {
             $this->view->msg = 'Invalid User';
             $this->_forward('error', 'error');
         }
     }
 }
开发者ID:Koulio,项目名称:OpenZIS,代码行数:26,代码来源:AgentaccessController.php


示例9: index

 public function index()
 {
     Log::debug(__METHOD__);
     if (Input::has('book_id')) {
         $this->setCurrentBook(Input::get('book_id'));
     }
     if (Input::has('layout')) {
         $this->setLayout(Input::get('layout'));
     }
     if (Agent::isMobile()) {
         $user_name = Auth::user()->username;
         $get_task_counts = $this->getTaskCounts();
         $book_name = $this->getBookName();
         $current_book_id = $this->currentBook() ? $this->currentBook()->id : 0;
         $prefix = $this->getPrefix();
         $recent_done_now = 10;
         $books = $this->getAllBookCounts();
         $tasks = $this->getTasks('', $recent_done_now);
         return View::make('tasks.index', compact('user_name', 'book_name', 'current_book_id', 'prefix', 'recent_done_now', 'tasks', 'books'));
     } else {
         $this->tasks = $this->currentTasks();
         //        respond_to do |format|
         //            format.html
         //            format.csv { send_data(current_tasks.csv) }
         //            format.xls
         //        end
         return View::make('tasks.index');
     }
 }
开发者ID:neilmillard,项目名称:kanbanlist,代码行数:29,代码来源:TasksController.php


示例10: checkForUpdate

 public function checkForUpdate($gamertag = '')
 {
     if ($this->request->ajax() && !\Agent::isRobot()) {
         try {
             $account = Account::with('destiny.characters')->where('seo', Text::seoGamertag($gamertag))->firstOrFail();
             // We don't care about non-panda members
             if (!$account->isPandaLove()) {
                 $this->inactiveCounter = 1;
             }
             // check for 10 inactive checks
             if ($account->destiny->inactiveCounter >= $this->inactiveCounter) {
                 return response()->json(['updated' => false, 'frozen' => true, 'last_update' => 'This account hasn\'t had new data in awhile. - <a href="' . URL::action('Destiny\\ProfileController@manualUpdate', [$account->seo]) . '" class="ui  horizontal green label no_underline">Update Manually</a>']);
             }
             $char = $account->destiny->firstCharacter();
             if ($char->updated_at->diffInMinutes() >= $this->refreshRateInMinutes) {
                 // update this
                 $this->dispatch(new UpdateAccount($account));
                 return response()->json(['updated' => true, 'frozen' => false, 'last_update' => $char->getLastUpdatedRelative()]);
             }
             return response()->json(['updated' => false, 'frozen' => false, 'last_update' => $char->getLastUpdatedRelative()]);
         } catch (ModelNotFoundException $e) {
             return response()->json(['error' => 'Gamertag not found']);
         }
     }
 }
开发者ID:GMSteuart,项目名称:PandaLove,代码行数:25,代码来源:ProfileController.php


示例11: __construct

 public function __construct()
 {
     if (Agent::isMobile()) {
         $this->_vista = 'mobile';
     } else {
         $this->_vista = 'index';
     }
     $this->_imagesInstagram = array();
     $this->_imagesTwitter = array();
     $instagram = new instagram(array('apiKey' => '09fd60952ea742d5abb761b6c6a137aa', 'apiSecret' => 'ee25063e91e74d6c9f257be054a44ec3', 'apiCallback' => 'http://viernesdezapatillas.pe/'));
     $tagInstagram = 'viernesdezapatillas';
     $numphotosInstagram = 15;
     $media = $instagram->getTagMedia($tagInstagram, $auth = false, array('count' => $numphotosInstagram));
     $response = json_decode(json_encode($media));
     foreach ($response->data as $data) {
         $this->_imagesInstagram[] = $data->images->thumbnail->url;
     }
     $max_id = 0;
     $totalTweets = 15;
     $responset = Twitter::getSearch(array('q' => '#viernesdezapatillas since:2015-07-01 filter:images', 'count' => $totalTweets, 'max_id' => $max_id, 'since_id' => 0));
     foreach ($responset->statuses as $tweet) {
         foreach ($tweet->entities->media as $url) {
             $this->_imagesTwitter[] = $url->media_url;
             // . ':thumb';
         }
     }
 }
开发者ID:appsmambo,项目名称:ViernesDeZapatillas,代码行数:27,代码来源:HomeController.php


示例12: processAck

 public function processAck($m)
 {
     $dom = $this->dom;
     $headerNode = $m->headerNode;
     $msgId = $m->msgId;
     $agentSourceId = $m->sourceId;
     #        $msgId           = $headerNode->getElementsByTagName('SIF_MsgId')->item(0)->nodeValue;
     #        $agentSourceId   = $headerNode->getElementsByTagName('SIF_SourceId')->item(0)->nodeValue;
     $originalMsgId = $dom->getElementsByTagName('SIF_OriginalMsgId')->item(0)->nodeValue;
     $timestamp = $headerNode->getElementsByTagName('SIF_Timestamp')->item(0)->nodeValue;
     $status = $dom->getElementsByTagName('SIF_Status');
     $status = $status->item(0)->nodeValue;
     $validSourceId = Agent::checkSourceId($agentSourceId);
     if (!$validSourceId) {
         RegisterError::invalidSourceId($agentSourceId, $msgId);
     } else {
         $agent = new Agent($agentSourceId);
         if ($agent->isRegistered()) {
             if ($status == 1) {
                 $agent->unFreezeAgent();
                 $this->updateMessageQueue($agent, $originalMsgId, $msgId);
             } else {
                 if ($status == 3) {
                     //done processing
                     if ($originalMsgId == $agent->frozenMsgId) {
                         $agent->unFreezeAgent();
                         $this->updateMessageQueue($agent, $originalMsgId, $msgId);
                     } else {
                         GeneralError::EventACKError($this->xml);
                     }
                 } else {
                     if ($status == 2) {
                         //Intermediate wait for final
                         $agent->freezeAgent();
                         $agent->setFrozenMsgId($originalMsgId);
                         $timestamp = Utility::createTimestamp();
                         $msgId_u = Utility::createMessageId();
                         XmlHelper::buildSuccessMessage($msgId_u, $timestamp, $agent->sourceId, $msgId, 0, $originalMsg = null, $desc = null);
                     }
                 }
             }
         } else {
             RegisterError::notRegisteredError($agentSourceId, $msgId);
         }
     }
 }
开发者ID:Koulio,项目名称:OpenZIS,代码行数:46,代码来源:Ack.php


示例13: removeIdentity

 public function removeIdentity()
 {
     if (!empty($this->getPrivateKeyFile()) && Agent::identityLoaded($this->getPrivateKeyFile())) {
         // echo "Removing identity {$this->unlockedPrivateKeyFile}\n";
         Agent::deleteIdentity($this->getPrivateKeyFile());
     }
     return $this;
 }
开发者ID:AOEpeople,项目名称:AwsInspector,代码行数:8,代码来源:Identity.php


示例14: index

 public function index()
 {
     if (!Owner::isAuthenticated() && !Agent::isAuthenticated()) {
         $this->redirect('/');
     } else {
         $this->view('dashboard/index');
     }
 }
开发者ID:superflyz,项目名称:wallfly-mvc,代码行数:8,代码来源:Dashboard.php


示例15: create_object

 public function create_object($data)
 {
     $data = \Core\Dict::create($data);
     $assassin = Agent::mapper()->create_object(array('id' => $data->assassin, 'alias' => $data->assassin_agent_alias));
     $target = Agent::mapper()->create_object(array('id' => $data->target, 'alias' => $data->target_agent_alias));
     $weapon = Weapon::mapper()->create_object(array('id' => $data->weapon_id, 'name' => $data->weapon_name));
     return Kill::create(array('id' => $data->id, 'description' => $data->description, 'assassin' => $assassin, 'target' => $target, 'weapon' => $weapon, 'game' => $game, 'when_happened' => new \DateTime($data->when_happened)), True);
 }
开发者ID:radiosilence,项目名称:trouble,代码行数:8,代码来源:kill.php


示例16: main

 public function main($id)
 {
     if (is_null(Agent::find($id))) {
         return Redirect::to('admin');
     }
     $commissions = Commission::where('agent_id', $id)->orderBy('created_at', 'desc')->get();
     $agent = Agent::find($id);
     View::make('admin.commission.list', compact('commissions', 'agent'));
 }
开发者ID:jacobDaeHyung,项目名称:Laravel-Real-Estate-Manager,代码行数:9,代码来源:CommissionsController.php


示例17: destroy

 public function destroy(Request $request, $id)
 {
     empty($id) && !empty($request->input('id')) && ($id = $request->input('id'));
     $id = (array) $id;
     foreach ($id as $v) {
         $agent = Agent::destroy($v);
     }
     return $this->success('', count($id) > 5, compact('id'));
 }
开发者ID:unionbt,项目名称:hanpaimall,代码行数:9,代码来源:AgentAuditController.php


示例18: userHasAgent

 public static function userHasAgent()
 {
     if (Entrust::hasRole('Agent')) {
         if ($x = User::getAgentOfUser(Auth::user())) {
             return Agent::with('market')->find($x->agent_id);
         }
     }
     return false;
 }
开发者ID:tharindarodrigo,项目名称:agent,代码行数:9,代码来源:User.php


示例19: dropdown

 public static function dropdown()
 {
     $locations = Agent::orderBy('last_name')->get();
     $array = array();
     foreach ($locations as $l) {
         $key = $l->id;
         $array[$key] = ucwords($l->last_name . ', ' . $l->first_name);
     }
     return $array;
 }
开发者ID:jacobDaeHyung,项目名称:Laravel-Real-Estate-Manager,代码行数:10,代码来源:Agent.php


示例20: filter_by_request

 public static function filter_by_request()
 {
     $routes = Main::get_instance()->routes;
     if (!$routes) {
         return;
     }
     return \_u::find($routes, function ($route) {
         return $route->method->equalsCurrent() && ($route->path->equalsCurrent() || $route->path->matchParams()) && Agent::matchesCurrent($route->agent);
     });
 }
开发者ID:markzero,项目名称:wp-on-routes,代码行数:10,代码来源:route.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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