Last active
December 29, 2015 02:48
-
-
Save delphian/7602731 to your computer and use it in GitHub Desktop.
Revisions
-
delphian revised this gist
Nov 22, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ */ // Needed for multisite bootstrap. $_SERVER['HTTP_HOST'] = 'my-site-name.com'; $_SERVER['SCRIPT_NAME'] = '/' . 'touch-all-fids.php'; // Bootstrap drupal. -
delphian revised this gist
Nov 22, 2013 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,8 @@ * When working on a drupal site on localhost instead of production often * there are no files in the localhost files directory. This script will * create (touch) empty filenames that match all files managed by the * drupal database. In a multi-site environment this script should be * located in the drupal root. * * bryan.hazelbaker@gmail.com */ -
delphian revised this gist
Nov 22, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,7 +20,7 @@ require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); function drupal_touch_all_fids() { $fids = array(); $result = db_query('SELECT * FROM file_managed'); foreach($result as $row) { @@ -29,4 +29,4 @@ function touch_all_fids() { } } drupal_touch_all_fids(); -
delphian created this gist
Nov 22, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ <?php /** * @file * When working on a drupal site on localhost instead of production often * there are no files in the localhost files directory. This script will * create (touch) empty filenames that match all files managed by the * drupal database. * * bryan.hazelbaker@gmail.com */ // Needed for multisite bootstrap. $_SERVER['HTTP_HOST'] = 'localhost'; $_SERVER['SCRIPT_NAME'] = '/' . 'touch-all-fids.php'; // Bootstrap drupal. $_SERVER['REMOTE_ADDR'] = ''; define('DRUPAL_ROOT', '/absolute/path/to/drupal/root'); require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); function touch_all_fids() { $fids = array(); $result = db_query('SELECT * FROM file_managed'); foreach($result as $row) { print($row->fid . "\r"); touch(drupal_realpath($row->uri)); } } touch_all_fids();