本文整理匯總了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);
}