Advertisement
benshepherd

updateCaches.php

Aug 12th, 2017
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.54 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Console\Commands;
  4.  
  5. use Illuminate\Console\Command;
  6. use App\Http\Controllers\Cache\CacheController;
  7. use Illuminate\Support\Facades\Auth;
  8.  
  9. class updateCaches extends Command
  10. {
  11.     /**
  12.      * The name and signature of the console command.
  13.      *
  14.      * @var string
  15.      */
  16.     protected $signature = 'command:updateCaches';
  17.  
  18.     /**
  19.      * The console command description.
  20.      *
  21.      * @var string
  22.      */
  23.     protected $description = 'Update the caches of several pages on the website';
  24.  
  25.     /**
  26.      * Create a new command instance.
  27.      *
  28.      * @return void
  29.      */
  30.     public function __construct()
  31.     {
  32.         parent::__construct();
  33.     }
  34.  
  35.     /**
  36.      * Execute the console command.
  37.      *
  38.      * @return mixed
  39.      */
  40.     public function handle()
  41.     {
  42.         $this->line('Logged in: '.(Auth::check() ? 'Yes' : 'No'));
  43.  
  44.         $cacheController = new CacheController();
  45.         $this->line('Updating caches... This may take awhile.');
  46.  
  47.         $cacheController->homepage();
  48.         $this->line('Updated: homepage');
  49.  
  50. /*
  51.         $cacheController->browseCreations();
  52.         $this->line('Updated: browse creations');
  53.  
  54.         $cacheController->radio();
  55.         $this->line('Updated: radio');
  56.  
  57.         $cacheController->events();
  58.         $this->line('Updated: events');
  59.  
  60.         $this->line('Updating users...');
  61.         $count = $cacheController->users();
  62.         $this->line('Updated '.$count.' users');
  63. */
  64.         $cacheController->done();
  65.         $this->line('Done');
  66.     }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement