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


PHP Config::remove方法代码示例

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


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

示例1: setExempt

 /**
  * @param Player $player
  * @param bool $value
  */
 public function setExempt(Player $player, $value = true)
 {
     if ($value) {
         $this->exempts->set(strtolower($player->getName()));
         $this->exempts->save();
     } else {
         $this->exempts->remove(strtolower($player->getName()));
         $this->exempts->save();
     }
 }
开发者ID:happyexceed,项目名称:PocketMine-Plugins-1,代码行数:14,代码来源:iManager.php

示例2: remove

 public function remove($name)
 {
     $past = $this->config->get($name, null);
     $this->config->remove($name);
     $this->config->save();
     return $past;
 }
开发者ID:TBNRFrags2468,项目名称:Economy,代码行数:7,代码来源:YAMLStore.php

示例3: 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

示例4: removeShop

 public function removeShop($x, $y = 0, $z = 0, $level = null)
 {
     if ($x instanceof Position) {
         $y = $x->getFloorY();
         $z = $x->getFloorZ();
         $level = $x->getLevel();
         $x = $x->getFloorX();
     }
     if ($level instanceof Level) {
         $level = $level->getFolderName();
     }
     if ($this->config->exists($x . ":" . $y . ":" . $z . ":" . $level)) {
         $this->config->remove($x . ":" . $y . ":" . $z . ":" . $level);
         return true;
     }
     return false;
 }
开发者ID:Tolo0,项目名称:EconomyS,代码行数:17,代码来源:YamlDataProvider.php

示例5: removeWhitelist

 /**
  * @param string $name
  */
 public function removeWhitelist($name)
 {
     $this->whitelist->remove(strtolower($name));
     $this->whitelist->save();
 }
开发者ID:ZenaGamingsky,项目名称:PocketBox,代码行数:8,代码来源:Server.php

示例6: onCommand

 public function onCommand(CommandSender $sender, Command $command, $label, array $params)
 {
     switch (array_shift($params)) {
         case "join":
             if (!$sender instanceof Player) {
                 $sender->sendMessage("Please run this command in-game.");
             }
             if ($this->player->exists($sender->getName())) {
                 $sender->sendMessage("You already have joined job.");
             } else {
                 $job = array_shift($params);
                 if (trim($job) === "") {
                     $sender->sendMessage("Usage: /job join <name>");
                     break;
                 }
                 if ($this->jobs->exists($job)) {
                     $this->player->set($sender->getName(), $job);
                     $sender->sendMessage("You have joined to the job \"{$job}\"");
                 } else {
                     $sender->sendMessage("There's no job named \"{$job}\"");
                 }
             }
             break;
         case "retire":
             if (!$sender instanceof Player) {
                 $sender->sendMessage("Please run this command in-game.");
             }
             if ($this->player->exists($sender->getName())) {
                 $job = $this->player->get($sender->getName());
                 $this->player->remove($sender->getName());
                 $sender->sendMessage("You have retired from the job \"{$job}\"");
             } else {
                 $sender->sendMessage("You don't have job that you've joined");
             }
             break;
         case "list":
             $max = 0;
             foreach ($this->jobs->getAll() as $d) {
                 $max += count($d);
             }
             $max = ceil($max / 5);
             $page = array_shift($params);
             $page = max(1, $page);
             $page = min($max, $page);
             $page = (int) $page;
             $current = 1;
             $n = 1;
             $output = "Showing job list page {$page} of {$max} : \n";
             foreach ($this->jobs->getAll() as $name => $job) {
                 $info = "";
                 foreach ($job as $id => $money) {
                     $cur = (int) ceil($n / 5);
                     if ($cur === $page) {
                         $info .= $name . " : " . $id . " | " . EconomyAPI::getInstance()->getMonetaryUnit() . "" . $money . "\n";
                     } elseif ($cur > $page) {
                         break;
                     }
                     ++$n;
                 }
                 $output .= $info;
             }
             $sender->sendMessage($output);
             break;
         case "me":
             if (!$sender instanceof Player) {
                 $sender->sendMessage("Please run this command in-game.");
             }
             if ($this->player->exists($sender->getName())) {
                 $sender->sendMessage("Your job : " . $this->player->get($sender->getName()));
             } else {
                 $sender->sendMessage("You don't have any jobs you've joined.");
             }
             break;
         default:
             $sender->sendMessage($command->getUsage());
     }
     return true;
 }
开发者ID:KarNomz,项目名称:EconomyS,代码行数:78,代码来源:EconomyJob.php

示例7: removeBackup

 /** 
  * @param string $player 
  */
 public function removeBackup($player)
 {
     $this->backups->remove(strtolower($player));
     $this->backups->save();
 }
开发者ID:pomee4,项目名称:PocketMine-Plugins,代码行数:8,代码来源:PlanB.php

示例8: removeDonator

 /**
  * @param string $name
  */
 public function removeDonator($name)
 {
     if ($this->donators->exists($name, true)) {
         $this->donators->remove(strtolower($name));
     }
 }
开发者ID:Glitchmaster-PE,项目名称:KitPro,代码行数:9,代码来源:KitPro.php

示例9: removeSign

 public function removeSign(Position $pos)
 {
     $this->signs->remove($this->posToString($pos));
     $this->signs->save();
 }
开发者ID:EmreTr1,项目名称:TNTRun,代码行数:5,代码来源:SignHandler.php

示例10: removeRocketPad

 /** 
  * @param Block $block 
  */
 public function removeRocketPad(Block $block)
 {
     $this->pads->remove($block->getFloorX() . ":" . $block->getFloorY() . ":" . $block->getFloorZ() . ":" . strtolower($block->getLevel()->getName()));
     $this->pads->save();
 }
开发者ID:Evarettedavis,项目名称:PocketMine-Plugins,代码行数:8,代码来源:RocketPads.php


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