Skip to content

Commit

Permalink
Rewrite namespace before module ID
Browse files Browse the repository at this point in the history
If the module ID is contained within the namespace, renaming the module
ID before the namespace may prevent the latter from being renamed.
  • Loading branch information
verement authored Oct 11, 2021
1 parent 4524d16 commit f819f70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/rewrite-module-id.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@

// Replace in files
$fileContent = file_get_contents($file);
$fileContent = str_replace($oldNamespace, $newNamespace, $fileContent);
$fileContent = str_replace($oldModuleId, $newModuleId, $fileContent);
$fileContent = str_replace(ucfirst($oldModuleId), ucfirst($newModuleId), $fileContent);
$fileContent = str_replace(dashesToCamelCase($oldModuleId), dashesToCamelCase($newModuleId), $fileContent);
$fileContent = str_replace(ucfirst(dashesToCamelCase($oldModuleId)), ucfirst(dashesToCamelCase($newModuleId)), $fileContent);
$fileContent = str_replace($oldNamespace, $newNamespace, $fileContent);
file_put_contents($file, $fileContent);
print "Searched&replaced in: " . $file . "\n";

Expand Down

0 comments on commit f819f70

Please sign in to comment.