本文整理汇总了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 -');
}
示例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);
}
示例3: forget
/**
* Remove item form Collection.
*
* @param string $key
*/
public function forget($key)
{
Arr::forget($this->items, $key);
}
示例4: forget
public static function forget($key)
{
return Arr::forget($_SESSION, $key);
}
示例5: forget
/**
* Remove item form Bag
*
* @param string $key
*/
public function forget($key)
{
Arr::forget($this->data, $key);
}