使用 PHP 符号链接进行 Drupal 多站点

发布于 2024-10-03 23:58:11 字数 411 浏览 0 评论 0原文

抱歉,如果问题有点模糊。这是我的情况。

我将 Drupal 安装在 www.example.com/testing 的子文件夹中。在其中,我需要另一个子文件夹来存放主要 Drupal 安装的移动版本 (www.example.com/testing/mobile)。

因此,移动站点需要共享主要 Drupal 安装的数据库、代码库、模块、主题等。我相信我需要在“sites”文件夹中创建一个名为“mobile”的文件夹,其中包含 settings.php 文件的副本和一个名为“files”的目录。

然后我陷入了困境,不知道还需要做什么才能完成移动安装的设置。我看过一些有关使用符号链接的文章,但目前我无法理解!

任何帮助、建议或链接将不胜感激!另外,我无权访问 shell,因此无法在服务器上执行任何命令行编程。

谢谢,马克。

Sorry if the question is a bit vague. Here is my situation.

I have Drupal installed in a sub folder at www.example.com/testing. Within this, I want another sub folder for a mobile version of the main Drupal installation (www.example.com/testing/mobile).

Therefore, the mobile site needs to share the database, codebase, modules, themes etc of the main Drupal installation. I believe I need to create a folder within the 'sites' folder called 'mobile' which includes a copy of the settings.php file and a directory called 'files'.

I am then stuck as to what else I need to do to complete the set up of the mobile installation. I have seen some articles about using symlinks but it's going over my head at the moment!

Any help, advice or links would be appreciated! Also, I do not have access to shell so cannot perform any command line programming on the server.

Thanks, Mark.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

后eg是否自 2024-10-10 23:58:11

当移动设备上的用户访问网站时,您可以使用 Themekey 模块加载特定主题。这不需要复制代码或文件,您所要做的就是向它提供主题,它会完成剩下的工作。

http://drupal.org/project/themekey

至于符号链接,我喜欢在升级时使用它们代码。

这是一个示例:

mkdir share/1.0
ln -s share/1.0 public_html (or htdocs, whatever the server is set as)

这将创建一个符号链接,将您的虚拟主机 webroot 指向新目录。因此,当您更新代码并测试它时,您将为新版本的代码创建一个名为 1.1 的新文件夹,并更新符号链接。但是,在这种情况下,仅仅拥有网站的移动版本就不需要符号链接。

You could just use Themekey module to load a specific theme when a user on a mobile device visits the website. That would not require duplicating code or files, and all you have to do is supply the theme to it, and it will do the rest.

http://drupal.org/project/themekey

As for symlinks, I like to use them when I upgrade code.

Here is an example:

mkdir share/1.0
ln -s share/1.0 public_html (or htdocs, whatever the server is set as)

That would create a symlink pointing your virtual host webroot at the new directory. So, when you update the code and test it, you create a new folder called 1.1 for the new version of code, and update the symlink. But, symlinks are not needed in this case for simply having a mobile version of the website.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文