本文整理汇总了PHP中manifest函数的典型用法代码示例。如果您正苦于以下问题:PHP manifest函数的具体用法?PHP manifest怎么用?PHP manifest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了manifest函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: __construct
public function __construct(Character $character, array $activities, array $pves, array $stats)
{
$this->character = $character;
$this->dateActivityStarted = carbon($activities['dateActivityStarted']);
$lastReset = last_weekly();
$nextReset = next_weekly();
// raid, arena and nightfall completion status
$raidsCompleted = [];
$arenasCompleted = [];
$activitiesCompleted = [];
// need advisors to identify daily
$this->dailyChapter = destiny()->advisors()->daily;
foreach ($pves as $pve) {
$activityHash = (string) $pve['activityDetails']['referenceId'];
$activity = manifest()->activity($activityHash);
$activityId = sha1($activity->activityName);
$activityType = $activity->activityType;
$completed = (bool) array_get($pve, 'values.completed.basic.value', false);
$date = carbon($pve['period']);
if ($activityType->isRaid()) {
$activityLevel = $activity->activityLevel;
if (!isset($raidsCompleted[$activityId])) {
$raidsCompleted[$activityId] = null;
}
if ($completed && $date > $lastReset && $date < $nextReset) {
if ($activityLevel > $raidsCompleted[$activityId]) {
$raidsCompleted[$activityId] = $activityLevel;
}
}
}
if ($activityType->isArena()) {
if (!array_key_exists($activityHash, $arenasCompleted)) {
$arenasCompleted[$activityHash] = false;
}
if ($completed && $date > $lastReset && $date < $nextReset) {
$arenasCompleted[$activityHash] = $completed;
}
}
if ($activityType->isNightfall()) {
$nightfallHash = $activity->activityType->activityTypeHash;
if (!array_key_exists($nightfallHash, $activitiesCompleted)) {
$activitiesCompleted[$nightfallHash] = false;
}
if ($completed && $date > $lastReset && $date < $nextReset) {
$activitiesCompleted[$nightfallHash] = $completed;
}
}
if ($activityHash == $this->dailyChapter->activityHash) {
if (!array_key_exists($activityHash, $activitiesCompleted)) {
$activitiesCompleted[$activityHash] = false;
}
if ($completed && $date > last_daily() && $date < next_daily()) {
$activitiesCompleted[$activityHash] = $completed;
}
}
}
// stats grouped by activity hash
$statsArray = [];
foreach ($stats as $k => $stat) {
$activityHash = (string) $stat['activityHash'];
$statsArray[$activityHash] = new StatisticsCollection($stat['values']);
}
// build ActivityCollection
foreach ($activities['available'] as $activity) {
$activityHash = (string) $activity['activityHash'];
$activityStats = array_get($statsArray, $activityHash);
$activity = new Activity($character, $activity, $activityStats);
$activityId = sha1($activity->activityName);
if ($activity->isCompleted && $activity->isWeekly()) {
$activity->isCompleted = $character->dateLastPlayed > last_weekly();
}
$this->put($activityHash, $activity);
if ($activity->isRaid()) {
$activity->isCompleted = false;
$activityLevelCompleted = array_get($raidsCompleted, $activityId);
if (!$activityLevelCompleted) {
continue;
}
if ($activity->activityLevel <= $activityLevelCompleted) {
$activity->isCompleted = true;
}
}
if ($activity->isArena()) {
$activity->isCompleted = array_get($arenasCompleted, $activityHash, false);
}
if ($activity->isNightfall()) {
$activity->isCompleted = array_get($activitiesCompleted, $activity->activityType->activityTypeHash, false);
}
if ($activityHash == $this->dailyChapter->activityHash) {
$activity->isCompleted = array_get($activitiesCompleted, $activityHash, false);
}
}
}
开发者ID:baherramzy,项目名称:DestinyStatus,代码行数:93,代码来源:ActivityCollection.php
示例17: __construct
public function __construct(array $properties)
{
$definition = manifest()->specialEvent($properties['eventHash']);
$properties = array_merge($properties, $definition->getProperties());
parent::__construct($properties);
}
开发者ID:exodus2287,项目名称:DestinyStatus,代码行数:6,代码来源:Event.php
示例18: gFaction
public function gFaction()
{
return manifest()->faction($this->factionHash);
}
开发者ID:TrackerNetwork,项目名称:DestinyStatus,代码行数:4,代码来源:Display.php
示例19: __construct
public function __construct(array $properties)
{
parent::__construct($properties);
$this->definition = manifest()->sandboxPerk($this->perkHash);
}
开发者ID:TrackerNetwork,项目名称:DestinyStatus,代码行数:5,代码来源:Perk.php
示例20: foreach
foreach ($_GPC['settings']['variables'] as $key => $value) {
$temp = array();
if (!empty($_GPC['settings']['variables'][$key]) && preg_match('/^[a-z\\d]+$/i', $_GPC['settings']['variables'][$key])) {
if (!empty($_GPC['settings']['description'][$key])) {
$temp['variable'] = $_GPC['settings']['variables'][$key];
$temp['value'] = $_GPC['settings']['values'][$key];
$temp['desc'] = $_GPC['settings']['description'][$key];
$t['settings'][] = $temp;
}
}
}
}
if ($_FILES['preview'] && $_FILES['preview']['error'] == '0' && !empty($_FILES['preview']['tmp_name'])) {
$t['preview'] = $_FILES['preview']['tmp_name'];
}
$manifest = manifest($t);
load()->func('file');
if ($_GPC['method'] == 'create') {
$tpldir = IA_ROOT . '/app/themes/' . strtolower($t['template']['identifie']);
if (is_dir($tpldir)) {
message('模板目录' . $tpldir . '已存在,请更换模板标识还删除已存在模板');
}
mkdirs($tpldir);
file_put_contents("{$tpldir}/manifest.xml", $manifest);
if (!empty($t['preview'])) {
file_move($t['preview'], "{$tpldir}/preview.jpg");
}
message('模板生成成功,请访问' . $tpldir . '目录进行查看', referer(), 'success');
exit;
}
if ($_GPC['method'] == 'download') {
开发者ID:zhang19960118,项目名称:html11,代码行数:31,代码来源:theme.ctrl.php
注:本文中的manifest函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论