當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Profile::setCollectors方法代碼示例

本文整理匯總了PHP中Symfony\Component\HttpKernel\Profiler\Profile::setCollectors方法的典型用法代碼示例。如果您正苦於以下問題:PHP Profile::setCollectors方法的具體用法?PHP Profile::setCollectors怎麽用?PHP Profile::setCollectors使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Symfony\Component\HttpKernel\Profiler\Profile的用法示例。


在下文中一共展示了Profile::setCollectors方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createProfileFromData

 /**
  * {@inheritdoc}
  */
 protected function createProfileFromData($token, $data, $parent = NULL)
 {
     $profile = new Profile($token);
     $profile->setIp($data['ip']);
     $profile->setMethod($data['method']);
     $profile->setUrl($data['url']);
     $profile->setTime($data['time']);
     $profile->setCollectors($data['data']);
     return $profile;
 }
開發者ID:anthonysimone,項目名稱:d8_twig,代碼行數:13,代碼來源:FileProfilerStorage.php

示例2: testUtf8

 public function testUtf8()
 {
     $profile = new Profile('utf8_test_profile');
     $data = 'HЁʃʃϿ, ϢorЃd!';
     $nonUtf8Data = mb_convert_encoding($data, 'UCS-2');
     $collector = new MongoDbProfilerStorageTestDataCollector();
     $collector->setData($nonUtf8Data);
     $profile->setCollectors(array($collector));
     self::$storage->write($profile);
     $readProfile = self::$storage->read('utf8_test_profile');
     $collectors = $readProfile->getCollectors();
     $this->assertCount(1, $collectors);
     $this->assertArrayHasKey('test_data_collector', $collectors);
     $this->assertEquals($nonUtf8Data, $collectors['test_data_collector']->getData(), 'Non-UTF8 data is properly encoded/decoded');
 }
開發者ID:marchyoung,項目名稱:FrameworkBenchmarks,代碼行數:15,代碼來源:MongoDbProfilerStorageTest.php

示例3: createProfileFromData

 private function createProfileFromData($token, $data, $parent = null)
 {
     $profile = new Profile($token);
     $profile->setIp($data['ip']);
     $profile->setMethod($data['method']);
     $profile->setUrl($data['url']);
     $profile->setTime($data['time']);
     $profile->setCollectors($data['data']);
     if (!$parent && $data['parent']) {
         $parent = $this->read($data['parent']);
     }
     if ($parent) {
         $profile->setParent($parent);
     }
     foreach ($data['children'] as $token) {
         if (!$token) {
             continue;
         }
         if (!($childProfileData = $this->getValue($this->getItemName($token), self::REDIS_SERIALIZER_PHP))) {
             continue;
         }
         $profile->addChild($this->createProfileFromData($token, $childProfileData, $profile));
     }
     return $profile;
 }
開發者ID:rikaix,項目名稱:symfony,代碼行數:25,代碼來源:RedisProfilerStorage.php

示例4: createProfileFromData

 /**
  * @param string $token
  * @param $data
  *
  * @return Profile
  */
 private function createProfileFromData($token, $data)
 {
     $profile = new Profile($token);
     $profile->setIp($data->ip);
     $profile->setMethod($data->method);
     $profile->setUrl($data->url);
     $profile->setTime($data->time);
     $profile->setCollectors(unserialize(base64_decode($data->data)));
     return $profile;
 }
開發者ID:ABaldwinHunter,項目名稱:durhamatletico-cms,代碼行數:16,代碼來源:DatabaseProfilerStorage.php

示例5: createProfileFromData

 protected function createProfileFromData($token, $data, $parent = null)
 {
     $profile = new Profile($token);
     $profile->setIp($data['ip']);
     $profile->setUrl($data['url']);
     $profile->setTime($data['time']);
     $profile->setCollectors(unserialize(base64_decode($data['data'])));
     if (!$parent && isset($data['parent']) && $data['parent']) {
         $parent = $this->read($data['parent']);
     }
     if ($parent) {
         $profile->setParent($parent);
     }
     $profile->setChildren($this->readChildren($token, $profile));
     return $profile;
 }
開發者ID:robertowest,項目名稱:CuteFlow-V4,代碼行數:16,代碼來源:PdoProfilerStorage.php


注:本文中的Symfony\Component\HttpKernel\Profiler\Profile::setCollectors方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。