From f819f709b2c1e0b2c784fa1f7adf3ef2932035ee Mon Sep 17 00:00:00 2001 From: Rob Leslie Date: Mon, 11 Oct 2021 14:34:46 -0700 Subject: [PATCH] Rewrite namespace before module ID If the module ID is contained within the namespace, renaming the module ID before the namespace may prevent the latter from being renamed. --- docs/rewrite-module-id.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/rewrite-module-id.php b/docs/rewrite-module-id.php index b6938df..2cc8668 100644 --- a/docs/rewrite-module-id.php +++ b/docs/rewrite-module-id.php @@ -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";