#!/bin/bash # Note: Windows/Cygwin users will see "Permission denied" errors caused by # sed --in-place. You should be able to ignore those errors, but then again, # it's also possible that all of your file permissions will be hosed. # Fix them with this command: # attrib -R core\* /S # Drupal\enity\* -> Drupal\Core\Entity\* mkdir core/lib/Drupal/Core/Entity git mv core/modules/entity/lib/Drupal/entity/*.php core/lib/Drupal/Core/Entity/ # entity.module -> entity.inc git mv core/modules/entity/entity.module core/includes/entity.inc # Entity tests -> Drupal/system/Tests/Entity/* mkdir core/modules/system/lib/Drupal/system/Tests/Entity git mv core/modules/entity/lib/Drupal/entity/Tests/* core/modules/system/lib/Drupal/system/Tests/Entity/ # Entity test modules -> system/tests/modules/ git mv core/modules/entity/tests/modules/* core/modules/system/tests/modules/ # entity.api.php -> includes/entity.api.php git mv core/modules/entity/entity.api.php core/includes/ # Remove entity module directory. git rm -r core/modules/entity # Adjust all entity test namespace references in files throughout core. for file in `grep -rl 'Drupal\\\\entity\\\\Tests' ./core/*`; do sed -i 's/Drupal\\entity\\Tests/Drupal\\system\\Tests\\Entity/g' $file done # Adjust all partial namespace references in files throughout core. for file in `grep -rl 'Drupal\\\\entity\\\\' ./core/*`; do sed -i 's/Drupal\\entity\\/Drupal\\Core\\Entity\\/g' $file done # Adjust all exact namespace references in files throughout core. for file in `grep -rl 'Drupal\\\\entity' ./core/*`; do sed -i 's/Drupal\\entity/Drupal\\Core\\Entity/g' $file done # Remove entity module dependencies from all .info files. #find ./core -name "*.info" -type f -exec sed -i '/dependencies\[\]\s*=\s*entity\s*/d' '{}' \; find ./core -name '*.info' | xargs -l1 grep -l 'entity' | xargs sed -i "/dependencies.*entity/d" # MANUAL TODOs: # 1) Add entity.inc to _drupal_bootstrap_code(). # 2) Move hook_modules_preenable() and hook_modules_disabled() implementations # directly into module.inc. # 3) Delete entity_help().