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


PHP Config::setAll方法代码示例

本文整理汇总了PHP中pocketmine\utils\Config::setAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::setAll方法的具体用法?PHP Config::setAll怎么用?PHP Config::setAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pocketmine\utils\Config的用法示例。


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

示例1: saveChests

 public function saveChests()
 {
     $save = [];
     foreach ($this->chests as $chest) {
         /** @var ChestPattern $pattern */
         $pattern = $chest->getPattern();
         $save[] = ["x" => $chest->getPosition()->x, "y" => $chest->getPosition()->y, "z" => $chest->getPosition()->z, "levelName" => $chest->getPosition()->getLevel()->getName(), "patternName" => $pattern::getName(), "patternArgs" => $pattern->getPatternData()];
     }
     $this->config->setAll($save);
     $this->config->save();
 }
开发者ID:KidPlaysMCPE,项目名称:ChestRefill,代码行数:11,代码来源:FlatFileStore.php

示例2: removeZone

 public function removeZone(Zone $zone)
 {
     $this->zonesConfig->remove($zone->getName());
     $permData = $this->permConfig->getAll(false);
     foreach ($permData as $key => $value) {
         if (array_key_exists($zone->getName(), $value)) {
             unset($permData[$key][$zone->getName()]);
             $this->permConfig->setAll($permData);
             return true;
         }
     }
     return false;
 }
开发者ID:Tee7even,项目名称:iZone,代码行数:13,代码来源:YAMLProvider.php

示例3: saveSession

 private function saveSession()
 {
     $values = [];
     foreach (self::$configDefaults as $k => $v) {
         if ($k !== "mutedUntil") {
             $values[$k] = $this->{$k};
         } else {
             // Use '$this->{$k}' so we can later implement more time handlers without problems...
             $values[$k] = $this->{$k} instanceof \DateTime ? $this->{$k}->getTimestamp() : $v;
         }
     }
     $this->config->setAll($values);
     $this->config->save();
 }
开发者ID:ZencraftYouTube,项目名称:EssentialsPE,代码行数:14,代码来源:BaseSession.php

示例4: saveYml

 public function saveYml()
 {
     ksort($this->nn);
     $nn = new Config($this->getServer()->getDataPath() . "/plugins/! MineBlock/" . "NickName.yml", Config::YAML, []);
     $nn->setAll($this->nn);
     $nn->save();
 }
开发者ID:Skull3x,项目名称:MineBlock,代码行数:7,代码来源:NickName.php

示例5: saveYml

 public function saveYml()
 {
     $fly = new Config($this->getServer()->getDataPath() . "/plugins/! DeBePlugins/" . "Fly.yml", Config::YAML);
     $fly->setAll($this->fly);
     $fly->save();
     $this->loadYml();
 }
开发者ID:stoastye85,项目名称:Plugins,代码行数:7,代码来源:Fly.php

示例6: savePlayer

 public function savePlayer(IPlayer $player, array $config)
 {
     $name = trim(strtolower($player->getName()));
     $data = new Config($this->plugin->getDataFolder() . "players/" . $name[0] . "/{$name}.yml", Config::YAML);
     $data->setAll($config);
     $data->save();
 }
开发者ID:JungHyun3459,项目名称:EmailAuth,代码行数:7,代码来源:YAMLDataProvider.php

示例7: saveYml

 public function saveYml()
 {
     asort($this->si);
     $si = new Config($this->getServer()->getDataPath() . "/plugins/! MineBlock/" . "SubInventory.yml", Config::YAML);
     $si->setAll($this->si);
     $si->save();
 }
开发者ID:Skull3x,项目名称:MineBlock,代码行数:7,代码来源:SubInventory.php

示例8: onRun

 public function onRun($currentTick)
 {
     $config = new Config($this->getOwner()->getDataFolder() . "dispensers.yml", Config::YAML);
     $config->setAll($this->getOwner()->getDispenserList());
     $config->save();
     $this->getOwner()->getLogger()->info(TextFormat::AQUA . "Auto-saved!");
 }
开发者ID:sJimin,项目名称:EconomyPotionShop,代码行数:7,代码来源:TaskAutoSave.php

示例9: saveInventory

 public function saveInventory(Player $player, Inventory $inv)
 {
     $n = trim(strtolower($player->getName()));
     if ($n === "") {
         return false;
     }
     $d = substr($n, 0, 1);
     if (!is_dir($this->getDataFolder() . $d)) {
         mkdir($this->getDataFolder() . $d);
     }
     $path = $this->getDataFolder() . $d . "/" . $n . ".yml";
     $cfg = new Config($path, Config::YAML);
     $yaml = $cfg->getAll();
     if ($this->isGlobal) {
         $ln = "*";
     } else {
         $ln = trim(strtolower($player->getLevel()->getName()));
     }
     $yaml[$ln] = [];
     foreach ($inv->getContents() as $slot => &$item) {
         $yaml[$ln][$slot] = implode(":", [$item->getId(), $item->getDamage(), $item->getCount()]);
     }
     $inv->clearAll();
     $cfg->setAll($yaml);
     $cfg->save();
     return true;
 }
开发者ID:DWWf,项目名称:pocketmine-plugins,代码行数:27,代码来源:YamlMgr.php

示例10: saveConfig

 public function saveConfig()
 {
     $this->mineData->setAll([]);
     foreach ($this->mines as $n => $mine) {
         $this->mineData->set($n, [$mine->getA()->getX(), $mine->getB()->getX(), $mine->getA()->getY(), $mine->getB()->getY(), $mine->getA()->getZ(), $mine->getB()->getZ(), count($mine->getData()) > 0 ? $mine->getData() : false, $mine->getLevel()->getName()]);
     }
     $this->mineData->save();
 }
开发者ID:MCPEGamerJPatGitHub,项目名称:MineReset,代码行数:8,代码来源:MineReset.php

示例11: cfgSave

 /**
  * Save a config section to the plugins' config.yml
  *
  * @param str $key - section to save
  * @param mixed $settings - settings to save
  */
 public function cfgSave($key, $settings)
 {
     $cfg = new Config($this->getDataFolder() . "config.yml", Config::YAML);
     $dat = $cfg->getAll();
     $dat[$key] = $settings;
     $cfg->setAll($dat);
     $cfg->save();
 }
开发者ID:Gabriel865,项目名称:pocketmine-plugins,代码行数:14,代码来源:BasicPlugin.php

示例12: onDisable

 public function onDisable()
 {
     $config = new Config($this->getDataFolder() . "donators.yml", Config::YAML, array());
     $config->setAll($this->donators);
     $config->save();
     $kits = new Config($this->getDataFolder() . "kits.yml", Config::YAML, array());
     $kits->setAll($this->kits);
     $kits->save();
 }
开发者ID:RedstoneAlmeida,项目名称:KitSexy,代码行数:9,代码来源:KitSexy.php

示例13: onDisable

 public function onDisable()
 {
     $save = new Config($this->getDataFolder() . "GambleDB.yml", Config::YAML);
     $save->setAll($this->db);
     $save->save();
     $save = new Config($this->getDataFolder() . "lotto.yml", Config::YAML);
     $save->setAll($this->lotto);
     $save->save();
 }
开发者ID:nesgohood,项目名称:PMMP-Plugins,代码行数:9,代码来源:EconomyGamble.php

示例14: save

 public function save()
 {
     $config = new Config($this->path . "protects.yml", Config::YAML);
     $config->setAll($this->yml);
     $config->save();
     $config = new Config($this->path . "options.yml", Config::YAML);
     $config->setAll($this->option);
     $config->save();
 }
开发者ID:nesgohood,项目名称:PMMP-Plugins,代码行数:9,代码来源:SimpleArea_Database.php

示例15: saveClans

 public function saveClans()
 {
     $clansConfig = new Config($this->getDataFolder() . "clans.yml", Config::YAML);
     $clans = [];
     foreach ($this->getClans() as $clan) {
         $clans[$clan->getName()] = $clan->toArray();
     }
     $clansConfig->setAll($clans);
     $clansConfig->save();
 }
开发者ID:nesgohood,项目名称:PMMP-Plugins,代码行数:10,代码来源:Clannish.php


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