public function getLogout() { \Session::flush(); \Cache::flush(); \Auth::logout(); return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/'); }
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(); }); }
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; }
public function team() { \Cache::flush(); $users = User::all(); $bugs = Bug::all(); return view('team')->with('users', $users)->with('bugs', $bugs); }
/** * 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); }
public static function boot() { parent::boot(); static::updated(function ($cache) { Cache::flush(); }); }
public function doLogout() { //on se deconnecte, on efface tout Auth::logout(); Cache::flush(); Session::clear(); return Redirect::to('/'); }
/** * 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>"); }
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); }
/** * 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(); }
function flush() { if (!$this->active) { return false; } parent::flush(); return $this->memcache->flush(); }
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)); }
public function _destroy($id) { if ($id) { return Cache::delete($id, $this->savePath); } else { return Cache::flush($this->savePath); } }
public function setUp() { parent::setUp(); Cache::flush(); // TODO remove quick fix Queue::shouldReceive('connection'); $command = new QueueCheckerCommand(); $this->tester = new CommandTester($command); }
/** * 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; }
public function setUp() { parent::setUp(); Cache::flush(); Cache::put('queue-checker-job-value', 0, 60); Cache::put('queue-checker-command-value', 2, 60); $command = new QueueCheckerResetCommand(); $this->tester = new CommandTester($command); }
/** * Handle the event. * * @param \App\Events\ModelChanged $event */ public function handle(ModelChanged $event) { if (!taggable()) { // Remove all cache store return \Cache::flush(); } // Remove only cache that has the given tag(s) return \Cache::tags($event->cacheTags)->flush(); }
public function do_clear() { if ($this->token->validate("clear_cache")) { if ($this->isPost()) { Cache::flush(); $this->redirect('/dashboard/system/optimization/clear_cache', 'cache_cleared'); } } else { $this->set('error', array($this->token->getErrorMessage())); } }
public function delete_scrapbook() { $db = Loader::db(); $c = $this->getCollectionObject(); $vals = array($_REQUEST['arHandle'], intval($c->getCollectionID())); $db->query('DELETE FROM Areas WHERE arHandle=? AND cID=?', $vals); $db->query('DELETE FROM CollectionVersionBlocks WHERE arHandle=? AND cID=?', $vals); Cache::flush(); $this->redirect('/dashboard/scrapbook/'); }
public function run() { $faker = Faker::create(); $arrImages = Cache::get('arrImages'); foreach (range(1, 300) as $index) { $type = $faker->randomElement(['users', 'admins', 'products', 'product_categories', 'banners']); Imageable::create(['image_id' => $faker->randomElement($arrImages[$type]), 'imageable_id' => $type == 'products' ? $faker->numberBetween(1, 20) : $type == 'admins' ? $faker->numberBetween(1, 10) : $type == 'banners' ? $faker->numberBetween(1, 15) : $faker->numberBetween(1, 50), 'imageable_type' => str_replace(' ', '', ucwords(str_singular(str_replace('_', ' ', $type))))]); } Cache::flush('arrImages'); }
public function __construct() { Cache::flush(); $config = Theme::first(); $themes = Config::get('themes'); $admin_theme = $themes[$config->admin_theme]; $user_theme = $themes[$config->user_theme]; View::share('admin_theme', $admin_theme); View::share('user_theme', $user_theme); }
function test_flush() { $c = new Cache(); $c->set('foo', 'test', 0, 10); $c->set('bar', 'test2'); $this->assertTrue($c->flush()); // check that it also flushed dot-files for timeouts too $files = glob($c->dir . '/{,.}*', GLOB_BRACE); $this->assertEquals(count($files), 2); }
public function run() { parent::run(); $this->call(FragmentSeeder::class); $this->call(UserSeeder::class); $this->call(TagSeeder::class); $this->call(ArticleSeeder::class); $this->call(PersonSeeder::class); $this->call(NewsItemSeeder::class); Cache::flush(); }
public function on_start() { $this->secCheck(); // if you just reverted, but didn't manually clear out your files - cache would be a prob here. $ca = new Cache(); $ca->flush(); Cache::disableCache(); Cache::disableLocalCache(); $this->site_version = Config::get('SITE_APP_VERSION'); Database::ensureEncoding(); }
/** * Register any other events for your application. * * @param \Illuminate\Contracts\Events\Dispatcher $events * @return void */ public function boot(DispatcherContract $events) { parent::boot($events); \Event::listen('*', function () { $event = \Event::firing(); if (starts_with($event, "Uniamo\\Events")) { // logger("Event fired: " . $event . "\n"); \Cache::flush(); // logger("Cleared cache"); } }); }
public function on_start() { $cnt = Loader::controller('/dashboard/system/backup_restore/update'); $cnt->secCheck(); // if you just reverted, but didn't manually clear out your files - cache would be a prob here. $ca = new Cache(); $ca->flush(); Cache::disableCache(); Cache::disableLocalCache(); $this->site_version = Config::get('SITE_APP_VERSION'); Database::ensureEncoding(); }
private static function deleteCache($configure) { if (in_array($configure->ckey, ['meta_title', 'meta_description', 'main_logo', 'favicon'])) { Cache::flush('meta_info'); } if (strpos($configure->ckey, 'api_') !== false) { Cache::flush('apiKeys'); } if (strpos($configure->ckey, 'google_drive_') !== false) { Cache::flush('googleDrive'); } }
/** * Deletes specified group. * * @param array $id */ public function delete($id) { try { $group = Sentry::findGroupById($id); $group->where('id', $id)->forceDelete(); \Cache::flush(); Event::fire('Groups.Deleted', array($id, Carbon::now(), 'Deleted')); return 'success'; } catch (GroupNotFoundException $e) { return 'Group was not found.'; } }
public function index() { \Cache::flush(); $user = Auth::User(); $filename = 'uploads/' . $user->id . '.jpg'; if (file_exists($filename)) { $img = 'uploads/' . $user->id . '.jpg'; return view('profile')->with('img', $img)->with('user', $user); } else { $default = 'uploads/default.jpg'; return view('profile')->with('img', $default)->with('user', $user); } }
/** * Tests that Home page displays correctly * * @return void */ public function testBackgroundTask() { // Clear cache Cache::flush(); // Run background task $exitCode = Artisan::call('refresh:results'); // Assert job ran successfully $this->assertEquals(0, $exitCode); // Check that cache values were set foreach (array_keys(AmazonConnector::$Categories) as $category) { $this->assertTrue(Cache::has($category)); } }