Magento downloader remember server path

我多次把 Magento 从一个服务器移动到另一个服务器,一直认为 Magento 不在意安装路径的改变,因为 Magento 总是在运行时检测安装位置(对比 WordPress 把 server absolute path 保存在数据库里,而且每个上传的文件都要保存一遍,不可取)。但今天我发现我错了:Magento downloader 仍保存有部分 server path 的信息,迁移 Magento 到新服务器后,Magento connect 不能正常工作。

有人提供了以下方法查找替换 downloader 目录下所有文件里的 OLD_PATH 成 NEW_PATH:

//shows all files with OLD_PATH element
find . -type f -exec grep -q "OLD_PATH" '{}' \; -print
//Replaces OLD_PATH string in all occurrences in every file to NEW_PATH
find . -type f -print | xargs sed -i -e ’s/OLD_PATH/NEW_PATH/g’

我试了试,查找替换是成功的,但 magento connect 还是不能工作,还是把 downloader 删了重装一遍来得干脆利落。

Related Posts

Leave a comment

Your email address will not be published. Required fields are marked *