Skip to content

Instantly share code, notes, and snippets.

@sun
Created March 16, 2014 22:45
Show Gist options
  • Save sun/9590977 to your computer and use it in GitHub Desktop.
Save sun/9590977 to your computer and use it in GitHub Desktop.
D8 cc.php
<?php
/**
* @file
* Script to flush all caches in Drupal 8.
*
* Place this script into your Drupal document root; i.e., /cc.php
* and request it in your browser.
*/
use Symfony\Component\HttpFoundation\RedirectResponse;
require_once __DIR__ . '/core/vendor/autoload.php';
require_once __DIR__ . '/core/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
drupal_flush_all_caches();
drupal_set_message(t('Flushed all caches.'));
$response = new RedirectResponse($GLOBALS['base_path']);
$response->send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment