PHP 8.6.0 Beta 3 is available for testing

Yac::flush

(PECL yac >= 1.0.0)

Yac::flushFlush the cache

Опис

public function Yac::flush(): bool

Removes all cached values. Because the cache is shared by every process of the same machine, this empties the cache globally; the key prefix given to Yac::__construct() does not limit what gets flushed.

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

Returns true.

Приклади

Приклад #1 Yac::flush() example

<?php
$yac = new Yac();
$yac->set("foo", "bar");

$other = new Yac("app2_");
$other->set("baz", "qux");

// flush empties the whole cache: entries of every instance,
// regardless of the prefix used when they were stored
$yac->flush();

var_dump($yac->get("foo"));   // bool(false)
var_dump($other->get("baz")); // bool(false)
?>

Прогляньте також

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top