当前位置: 首页>>代码示例>>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;未经允许,请勿转载。