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


PHP manifest函数代码示例

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


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

示例1: manifest

/**
 * Retrieves data for a service from the SDK's service manifest file.
 *
 * Manifest data is stored statically, so it does not need to be loaded more
 * than once per process. The JSON data is also cached in opcache.
 *
 * @param string $service Case-insensitive namespace or endpoint prefix of the
 *                        service for which you are retrieving manifest data.
 *
 * @return array
 * @throws \InvalidArgumentException if the service is not supported.
 */
function manifest($service = null)
{
    // Load the manifest and create aliases for lowercased namespaces
    static $manifest = [];
    static $aliases = [];
    if (empty($manifest)) {
        $manifest = load_compiled_json(__DIR__ . '/ressources/manifest.json');
        foreach ($manifest as $endpoint => $info) {
            $alias = strtolower($info['namespace']);
            if ($alias !== $endpoint) {
                $aliases[$alias] = $endpoint;
            }
        }
    }
    // If no service specified, then return the whole manifest.
    if ($service === null) {
        return $manifest;
    }
    // Look up the service's info in the manifest data.
    $service = strtolower($service);
    if (isset($manifest[$service])) {
        return $manifest[$service] + ['endpoint' => $service];
    } elseif (isset($aliases[$service])) {
        return manifest($aliases[$service]);
    } else {
        throw new \InvalidArgumentException("The service \"{$service}\" is not provided by the VWS SDK for PHP.");
    }
}
开发者ID:ossistyle,项目名称:http-client-description,代码行数:40,代码来源:functions.php

示例2: gBossSkulls

 protected function gBossSkulls()
 {
     $skulls = [];
     foreach ($this->properties['bossSkulls'] as $skull) {
         $skulls[] = manifest()->scriptedSkull($skull);
     }
     return $skulls;
 }
开发者ID:TrackerNetwork,项目名称:DestinyStatus,代码行数:8,代码来源:Arena.php

示例3: gSkulls

 protected function gSkulls(array $skulls)
 {
     $array = [];
     foreach ($skulls as $skullHash) {
         $array[] = manifest()->scriptedSkull($skullHash);
     }
     return $array;
 }
开发者ID:TrackerNetwork,项目名称:DestinyStatus,代码行数:8,代码来源:ArenaRound.php

示例4: __construct

 public function __construct(array $properties)
 {
     $properties['definition'] = manifest()->activity($properties['activityHash']);
     $properties['activityData'] = new ActivityData($properties['activityData']);
     if (isset($properties['extended']['rounds'])) {
         $rounds = [];
         foreach ($properties['extended']['rounds'] as $k => $round) {
             $round = new ArenaRound($this, $round);
             $round->roundNumber = $k + 1;
             $rounds[$round->roundNumber] = $round;
         }
         $properties['rounds'] = $rounds;
     }
     if (isset($properties['rewards'])) {
         $rewards = [];
         foreach ($properties['rewards'] as $rewardGroup) {
             foreach ($rewardGroup['rewardItems'] as $item) {
                 if (!in_array($item['itemHash'], $this->skippedRewards)) {
                     $rewards[] = new Reward($properties['activityData']->displayLevel, $item);
                 }
             }
         }
         $properties['rewards'] = $rewards;
     }
     if (isset($properties['extended']['skullCategories'])) {
         $skulls = [];
         foreach ($properties['extended']['skullCategories'] as $skullCategory) {
             foreach ($skullCategory['skulls'] as $skull) {
                 $skull = new SkullModifier($skull);
                 $skull->isModifier = $skullCategory['title'] === "Modifiers";
                 $skulls[] = $skull;
             }
         }
         $properties['skulls'] = $skulls;
     }
     if (isset($properties['skullCategories'])) {
         $skulls = [];
         foreach ($properties['skullCategories'] as $skullCategory) {
             foreach ($skullCategory['skulls'] as $skull) {
                 $skull = new SkullModifier($skull);
                 $skull->isModifier = $skullCategory['title'] === "Modifiers";
                 $skulls[] = $skull;
             }
         }
         // Add heroic skull if HM
         if ($properties['tierDisplayName'] === "Hard") {
             $skulls[] = $properties['definition']->skulls->first();
         }
         $properties['skulls'] = $skulls;
         $this->raid = true;
     }
     if (isset($properties['completion'])) {
         $properties['completion'] = new Completion($properties['completion']);
     }
     parent::__construct($properties);
 }
开发者ID:TrackerNetwork,项目名称:DestinyStatus,代码行数:56,代码来源:ActivityTier.php

示例5: __construct

 public function __construct(array $properties)
 {
     if (isset($properties['saleItems']) && is_array($properties['saleItems'])) {
         $items = [];
         foreach ($properties['saleItems'] as $saleItem) {
             $items[] = manifest()->inventoryItem($saleItem['item']['itemHash']);
         }
         $properties['items'] = $items;
     }
     parent::__construct($properties);
 }
开发者ID:TrackerNetwork,项目名称:DestinyStatus,代码行数:11,代码来源:XurCategory.php

示例6: __construct

 public function __construct(Advisors $advisors, array $properties)
 {
     if (isset($properties['extended']['orders'])) {
         $items = [];
         foreach ($properties['extended']['orders'] as $order) {
             $items[] = manifest()->inventoryItem($order['item']['itemHash']);
         }
         $properties['weapons'] = $items;
     }
     parent::__construct($properties);
 }
开发者ID:TrackerNetwork,项目名称:DestinyStatus,代码行数:11,代码来源:ArmsDay.php

示例7: gDaily

 protected function gDaily()
 {
     if (empty($this->dailyChapterHashes)) {
         return null;
     }
     $activity = new Advisors\Activity($this, manifest()->activity($this->dailyChapterHashes[0]), $this->dailyChapterResetDate);
     foreach ($this->dailyChapterHashes as $activityHash) {
         $activity->addLevelRewards(manifest()->activity($activityHash));
     }
     return $activity;
 }
开发者ID:exodus2287,项目名称:DestinyStatus,代码行数:11,代码来源:Advisors.php

示例8: __construct

 public function __construct(Character $character, array $properties)
 {
     $items = [];
     foreach (array_get($properties, 'items', null) as $property) {
         $hash = (string) $property['itemHash'];
         $definition = manifest()->inventoryItem($hash);
         $property = array_merge($property, $definition->getProperties());
         $items['buckets'][$property['bucketHash']] = new InventoryItem(new InventoryBucket($this, $properties), $property);
     }
     parent::__construct($items);
     $this->character = $character;
 }
开发者ID:TrackerNetwork,项目名称:DestinyStatus,代码行数:12,代码来源:Inventory.php

示例9: getArguments

 public static function getArguments()
 {
     $args = array_intersect_key(ClientResolver::getDefaultArguments(), ['service' => true, 'region' => true]);
     $args['region']['required'] = false;
     return $args + ['client_factory' => ['type' => 'config', 'valid' => ['callable'], 'doc' => 'A callable that takes an array of client' . ' configuration arguments and returns a regionalized' . ' client.', 'required' => true, 'internal' => true, 'default' => function (array $args) {
         $namespace = manifest($args['service'])['namespace'];
         $klass = "Aws\\{$namespace}\\{$namespace}Client";
         $region = isset($args['region']) ? $args['region'] : null;
         return function (array $args) use($klass, $region) {
             if ($region && empty($args['region'])) {
                 $args['region'] = $region;
             }
             return new $klass($args);
         };
     }]];
 }
开发者ID:iamlos,项目名称:S3-Uploads,代码行数:16,代码来源:MultiRegionClient.php

示例10: __construct

 public function __construct(Advisors $advisors, array $properties)
 {
     $bounties = [];
     foreach ($properties['bountyHashes'] as $bountyHash) {
         $bounties[] = manifest()->inventoryItem($bountyHash);
     }
     $properties['bounties'] = $bounties;
     $winDetails = [];
     if (isset($properties['extended']['winRewardDetails'])) {
         foreach ($properties['extended']['winRewardDetails'] as $winRewardDetail) {
             foreach ($winRewardDetail['rewardItemHashes'] as $itemHash) {
                 $winDetails[$winRewardDetail['winCount']][] = manifest()->inventoryItem($itemHash);
             }
         }
     }
     $properties['winRewards'] = $winDetails;
     parent::__construct($properties);
 }
开发者ID:TrackerNetwork,项目名称:DestinyStatus,代码行数:18,代码来源:Trials.php

示例11: __construct

 public function __construct(Character $character, array $properties)
 {
     $definition = manifest()->progression($properties['progressionHash']);
     $properties = array_merge($properties, $definition->getProperties());
     parent::__construct($properties);
     $this->character = $character;
     if ($this->name == self::WEEKLY_PVE || $this->name == self::WEEKLY_PVP) {
         if (!$character->playedAfterWeeklyReset) {
             $this->level = 0;
         }
         $this->nextLevelAt = count($this->steps);
         $this->progressToNextLevel = $this->level;
     }
     $this->percentToNextLevel = $this->nextLevelAt ? $this->progressToNextLevel / $this->nextLevelAt * 100 : 100;
     $this->percentLabel = sprintf("%d / %d", $this->progressToNextLevel, $this->nextLevelAt);
     if ($this->isMaxed()) {
         $this->percentToNextLevel = 100;
         $this->percentLabel = 'MAX';
     }
 }
开发者ID:exodus2287,项目名称:DestinyStatus,代码行数:20,代码来源:Progression.php

示例12: gPlace

 protected function gPlace()
 {
     return manifest()->place($this->placeHash);
 }
开发者ID:TrackerNetwork,项目名称:DestinyStatus,代码行数:4,代码来源:ActivityBundle.php

示例13: gDestination

 protected function gDestination()
 {
     return manifest()->destination($this->display->destinationHash);
 }
开发者ID:TrackerNetwork,项目名称:DestinyStatus,代码行数:4,代码来源:DailyCrucible.php

示例14: __construct

 public function __construct(ActivityLevel $level, array $properties)
 {
     parent::__construct($properties);
     $this->extend(manifest()->inventoryItem($this->itemHash));
     $this->activityLevel = $level;
 }
开发者ID:TrackerNetwork,项目名称:DestinyStatus,代码行数:6,代码来源:Reward.php

示例15: gDamage

 protected function gDamage()
 {
     if (empty($this->primaryStat)) {
         return 0;
     }
     $stat = manifest()->stat($this->primaryStat['statHash']);
     if ($stat->statIdentifier == 'STAT_DAMAGE') {
         return $this->primaryStat['value'];
     }
     return 0;
 }
开发者ID:TrackerNetwork,项目名称:DestinyStatus,代码行数:11,代码来源:InventoryItem.php


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