本文整理汇总了PHP中Cache::flush方法的典型用法代码示例。如果您正苦于以下问题:PHP Cache::flush方法的具体用法?PHP Cache::flush怎么用?PHP Cache::flush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cache
的用法示例。
在下文中一共展示了Cache::flush方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLogout
public function getLogout()
{
\Session::flush();
\Cache::flush();
\Auth::logout();
return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
}
示例2: boot
protected static function boot()
{
parent::boot();
static::creating(function ($entity) {
if (!Schema::hasCollection('entities')) {
static::createSchema();
}
if (empty($entity->project)) {
throw new Exception("No project was given");
}
if (!empty($entity->hash) && !empty($entity->project)) {
if (Entity::withTrashed()->where('hash', $entity->hash)->where('project', $entity->project)->first()) {
throw new Exception("Hash already exists for: " . $entity->title . " in project " . $entity->project);
}
}
$entity->_id = static::generateIncrementedBaseURI($entity);
if (Auth::check()) {
$entity->user_id = Auth::user()->_id;
} else {
$entity->user_id = "crowdtruth";
}
});
static::saved(function ($entity) {
Temp::truncate();
Cache::flush();
});
static::deleted(function ($entity) {
Cache::flush();
});
}
示例3: clearcache
public function clearcache()
{
Cache::flush();
var_dump(DB::select(DB::raw('SELECT CURRENT_TIMESTAMP as test from apl_file')));
$this->layout->content = date("Y-m-d H:i:s");
return $this->layout;
}
示例4: team
public function team()
{
\Cache::flush();
$users = User::all();
$bugs = Bug::all();
return view('team')->with('users', $users)->with('bugs', $bugs);
}
示例5: flush
/**
* Flush entire cache.
*/
function flush()
{
parent::flush();
// remove and reconnect to the SHM block
shm_remove($this->shmid);
$this->shmid = shm_attach($this->shmkey, $this->memsize, 0600);
}
示例6: boot
public static function boot()
{
parent::boot();
static::updated(function ($cache) {
Cache::flush();
});
}
示例7: doLogout
public function doLogout()
{
//on se deconnecte, on efface tout
Auth::logout();
Cache::flush();
Session::clear();
return Redirect::to('/');
}
示例8: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
$this->call('RolePermissionsTableSeeder');
$this->call('UserTableSeeder');
\Cache::flush();
$this->command->line("<info>Flushed Application Cache</info>");
}
示例9: flush
function flush($time = NULL)
{
if (empty($time)) {
$time = time();
}
parent::flush($time);
db_query("DELETE FROM {" . $this->name . "} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, $time);
}
示例10: show
/**
* Display the specified person.
*
* @param int $id
* @return Response
*/
public function show($id)
{
/*$person = Person::findOrFail($id);
return View::make('people.show', compact('person'));
*/
Cache::flush();
}
示例11: flush
function flush()
{
if (!$this->active) {
return false;
}
parent::flush();
return $this->memcache->flush();
}
示例12: clearCacheAction
public function clearCacheAction()
{
$compiled_path = rtrim(storage_path('framework/views/'));
array_map('unlink', glob("{$compiled_path}*"));
\Cache::flush();
\KSPM\LCMS\Model\SlugCache::truncate();
return json_encode(array('status' => true));
}
示例13: _destroy
public function _destroy($id)
{
if ($id) {
return Cache::delete($id, $this->savePath);
} else {
return Cache::flush($this->savePath);
}
}
示例14: setUp
public function setUp()
{
parent::setUp();
Cache::flush();
// TODO remove quick fix
Queue::shouldReceive('connection');
$command = new QueueCheckerCommand();
$this->tester = new CommandTester($command);
}
示例15: restore
/**
* Restore an item identified by a given id
*
* @param integer $id
* @throws InvalidArgumentException
* @throws RuntimeException
*/
public function restore($id)
{
if (is_null($id) || empty($id)) {
throw new InvalidArgumentException('Invalid ID');
}
$restore = $this->repository->restore($id);
$this->cache->flush();
return $restore;
}