コード例 #1
0
 public function getLogout()
 {
     \Session::flush();
     \Cache::flush();
     \Auth::logout();
     return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
 }
コード例 #2
0
ファイル: Entity.php プロジェクト: crowdtruth/crowdtruth
 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
0
ファイル: HomeController.php プロジェクト: vcorobceanu/WebAPL
 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
0
 public function team()
 {
     \Cache::flush();
     $users = User::all();
     $bugs = Bug::all();
     return view('team')->with('users', $users)->with('bugs', $bugs);
 }
コード例 #5
0
ファイル: shm.php プロジェクト: jvinet/pronto
 /**
  * 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
0
ファイル: Page.php プロジェクト: baochung2601/vieclam
 public static function boot()
 {
     parent::boot();
     static::updated(function ($cache) {
         Cache::flush();
     });
 }
コード例 #7
0
 public function doLogout()
 {
     //on se deconnecte, on efface tout
     Auth::logout();
     Cache::flush();
     Session::clear();
     return Redirect::to('/');
 }
コード例 #8
0
 /**
  * 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
0
ファイル: db.php プロジェクト: rollinsb1010/bbcom
 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
0
 /**
  * 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
0
ファイル: memcache.php プロジェクト: jvinet/pronto
 function flush()
 {
     if (!$this->active) {
         return false;
     }
     parent::flush();
     return $this->memcache->flush();
 }
コード例 #12
0
ファイル: CmsController.php プロジェクト: ksp-media/laikacms
 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
0
 public function _destroy($id)
 {
     if ($id) {
         return Cache::delete($id, $this->savePath);
     } else {
         return Cache::flush($this->savePath);
     }
 }
コード例 #14
0
 public function setUp()
 {
     parent::setUp();
     Cache::flush();
     // TODO remove quick fix
     Queue::shouldReceive('connection');
     $command = new QueueCheckerCommand();
     $this->tester = new CommandTester($command);
 }
コード例 #15
0
ファイル: CacheRepository.php プロジェクト: jinseokoh/ask
 /**
  * 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);
 }
コード例 #17
0
ファイル: CacheHandler.php プロジェクト: SH4CK3RS/l5essential
 /**
  * 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();
 }
コード例 #18
0
ファイル: clear_cache.php プロジェクト: nbourguig/concrete5
	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()));
		}
	}
コード例 #19
0
 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/');
 }
コード例 #20
0
 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');
 }
コード例 #21
0
 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);
 }
コード例 #22
0
ファイル: CacheTest.php プロジェクト: Selwyn-b/elefant
 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);
 }
コード例 #23
0
 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();
 }
コード例 #24
0
ファイル: upgrade.php プロジェクト: nveid/concrete5
 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();
 }
コード例 #25
0
 /**
  * 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");
         }
     });
 }
コード例 #26
0
ファイル: upgrade.php プロジェクト: nanpou/concrete5
 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();
 }
コード例 #27
0
ファイル: Configure.php プロジェクト: nguyendaivu/imagestock
 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');
     }
 }
コード例 #28
0
ファイル: SentryGroup.php プロジェクト: onlystar1991/mtdb
 /**
  * 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.';
     }
 }
コード例 #29
0
 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);
     }
 }
コード例 #30
0
ファイル: StaticPageTest.php プロジェクト: Aquilent/epa-eds
 /**
  * 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));
     }
 }