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


PHP Arr::forget方法代码示例

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


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

示例1: handleMessage

 /**
  * Handles the message.
  *
  * @param Message $message 
  * @param array $params
  * @param Discord $discord 
  * @param Config $config 
  * @return void 
  */
 public static function handleMessage($message, $params, $discord, $config)
 {
     $loadedComms = count($discord->websocket->listeners(Event::MESSAGE_CREATE));
     $message->channel->sendMessage('-' . count($loadedComms) . ' COMMANDS BEFORE RELOAD -');
     $message->channel->sendMessage('Reloading all commands from disk...');
     $discord->websocket->removeAllListeners(Event::MESSAGE_CREATE);
     $commandResearch = glob('./src/Commands/*.php');
     $commandLoad = true;
     foreach ($commandResearch as $file) {
         include $file;
     }
     $currCommands = getCommands();
     foreach ($currCommands as $command => $data) {
         $discord->websocket->on(Event::MESSAGE_CREATE, function ($message, $discord, $new) use($command, $data) {
             $content = explode(' ', $message->content);
             $config = Config::getConfig($discord->configfile);
             if ($content[0] == $config['prefix'] . $command) {
                 Arr::forget($content, 0);
                 $user_perms = @$config['perms']['perms'][$message->author->id];
                 if (empty($user_perms)) {
                     $user_perms = $config['perms']['default'];
                 }
                 if ($user_perms >= $data['perms']) {
                     try {
                         $data['class']::handleMessage($message, $content, $discord, $config, $this);
                     } catch (\Exception $e) {
                         $message->reply("There was an error running the command. `{$e->getMessage()}`");
                     }
                 } else {
                     $message->reply('You do not have permission to do this!');
                     echo "[Auth] User {$message->author->username} blocked from running {$config['prefix']}{$command}, <@{$message->author->id}>\r\n";
                 }
             }
         });
     }
     $loadedComms = count($discord->websocket->listeners(Event::MESSAGE_CREATE));
     $message->channel->sendMessage('-' . count($loadedComms) . ' COMMANDS AFTER RELOAD -');
 }
开发者ID:comentarinformal,项目名称:DiscordPHPBot,代码行数:47,代码来源:ReloadCommands.php

示例2: array_forget

 /**
  * Remove one or many array items from a given array using "dot" notation.
  *
  * @param  array  $array
  * @param  array|string  $keys
  * @return void
  */
 function array_forget(&$array, $keys)
 {
     return Arr::forget($array, $keys);
 }
开发者ID:runningjack,项目名称:busticketAPI1,代码行数:11,代码来源:helpers.php

示例3: forget

 /**
  * Remove item form Collection.
  *
  * @param string $key
  */
 public function forget($key)
 {
     Arr::forget($this->items, $key);
 }
开发者ID:chchmlml,项目名称:ceshi,代码行数:9,代码来源:Collection.php

示例4: forget

 public static function forget($key)
 {
     return Arr::forget($_SESSION, $key);
 }
开发者ID:ncaneldiee,项目名称:sampadeh,代码行数:4,代码来源:Session.php

示例5: forget

 /**
  * Remove item form Bag
  *
  * @param string $key
  */
 public function forget($key)
 {
     Arr::forget($this->data, $key);
 }
开发者ID:c78702505,项目名称:phalcon-phputils,代码行数:9,代码来源:ObjectArray.php


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