Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php drupal子域上的模块_Php_Drupal_Content Management System - Fatal编程技术网

Php drupal子域上的模块

Php drupal子域上的模块,php,drupal,content-management-system,Php,Drupal,Content Management System,随着新模块的加载,我的drupal站点变得非常沉重和缓慢。除了站点的store部分之外,这些模块中的一些是不需要的 我正在考虑创建一个存储子域,并以某种方式仅在该子域中加载这些模块 这是否意味着我必须安装两次drupal,一次安装在store.mydrupalite.com上,一次安装在mydrupalite.com 在store子域中,除了专门的store模块外,我还需要重新安装基本模块,还是有办法让store子域以某种方式从主站点继承模块 如果用户已经登录到主站点怎么办。他们是否需要重新登

随着新模块的加载,我的drupal站点变得非常沉重和缓慢。除了站点的store部分之外,这些模块中的一些是不需要的

我正在考虑创建一个
存储
子域,并以某种方式仅在该子域中加载这些模块

  • 这是否意味着我必须安装两次drupal,一次安装在
    store.mydrupalite.com
    上,一次安装在
    mydrupalite.com
  • 在store子域中,除了专门的store模块外,我还需要重新安装基本模块,还是有办法让store子域以某种方式从主站点继承模块
  • 如果用户已经登录到主站点怎么办。他们是否需要重新登录
    存储
    子域,或者是否有办法共享数据库
  • 这个想法真的有什么好处吗?还是我把事情复杂化了
  • 如果我把事情复杂化了,我应该怎么做呢

如果您在不同的域上创建第二个站点,那么您实际上是在创建第二个单独的站点,该站点具有不同的用户存储、不同的配置和不同的数据库

您不必做的一件事是重新安装Drupal或重新下载所有模块:Drupal支持称为多站点配置的功能,它允许多个站点运行相同的Drupal安装。如果确保要为两个站点共享的模块都位于“站点/所有”文件夹中,则只需在“站点”文件夹中为每个站点创建一个新文件夹,其中包含所需的域

例如,如果您有mydrupalite.com和store.mydrupalite.com,您将在站点文件夹中创建两个文件夹,分别称为mydrupalite.com和store.mydrupalite.com。在这些文件夹中,有settings.php和一个files文件夹,其中包含该特定站点的所有文件

您可以在Drupal.org上阅读更多关于Drupal的信息

综上所述,您所描述的可能不是最好的方式:将两个站点与不同的用户和数据存储同步在一起是维护的真正痛苦。除非模块调用hook_init()或其他全局钩子,否则当页面实际使用它实现的钩子之一时,它会按需加载

话虽如此,core中有一个模块,可以让您指定在站点拥挤时关闭哪些模块


但油门的作用仅此而已。您可能应该开始研究缓存机制,例如、,或者,即使您希望从Drupal安装中获得最大的性能。

如果您在不同的域上创建第二个站点,您实际上是在创建第二个单独的站点,其中包含不同的用户存储、不同的配置和不同的数据库

您不必做的一件事是重新安装Drupal或重新下载所有模块:Drupal支持称为多站点配置的功能,它允许多个站点运行相同的Drupal安装。如果确保要为两个站点共享的模块都位于“站点/所有”文件夹中,则只需在“站点”文件夹中为每个站点创建一个新文件夹,其中包含所需的域

例如,如果您有mydrupalite.com和store.mydrupalite.com,您将在站点文件夹中创建两个文件夹,分别称为mydrupalite.com和store.mydrupalite.com。在这些文件夹中,有settings.php和一个files文件夹,其中包含该特定站点的所有文件

您可以在Drupal.org上阅读更多关于Drupal的信息

综上所述,您所描述的可能不是最好的方式:将两个站点与不同的用户和数据存储同步在一起是维护的真正痛苦。除非模块调用hook_init()或其他全局钩子,否则当页面实际使用它实现的钩子之一时,它会按需加载

话虽如此,core中有一个模块,可以让您指定在站点拥挤时关闭哪些模块


但油门的作用仅此而已。您可能应该开始研究缓存机制,例如、,或者,如果您想从Drupal安装中获得最大的性能,甚至应该开始研究缓存机制。

如果您查看settings.php,它对所谓的缓存机制有很好的解释

从settings.php:

 * The configuration file to be loaded is based upon the rules below.
 *
 * The configuration directory will be discovered by stripping the
 * website's hostname from left to right and pathname from right to
 * left. The first configuration file found will be used and any
 * others will be ignored. If no other configuration file is found
 * then the default configuration file at 'sites/default' will be used.
 *
 * For example, for a fictitious site installed at
 * http://www.drupal.org/mysite/test/, the 'settings.php'
 * is searched in the following directories:
 *
 *  1. sites/www.drupal.org.mysite.test
 *  2. sites/drupal.org.mysite.test
 *  3. sites/org.mysite.test
 *
 *  4. sites/www.drupal.org.mysite
 *  5. sites/drupal.org.mysite
 *  6. sites/org.mysite
 *
 *  7. sites/www.drupal.org
 *  8. sites/drupal.org
 *  9. sites/org
 *
 * 10. sites/default
 *
 * If you are installing on a non-standard port number, prefix the
 * hostname with that number. For example,
 * http://www.drupal.org:8080/mysite/test/ could be loaded from
所以。您将创建一个目录
store.example.com
,并仅为该域放置一个settings.php。
在该目录中,创建一个目录
modules
,并将所有应该仅针对该域显示的模块放在该目录中。

如果您查看settings.php,它对所谓的模块有很好的解释

从settings.php:

 * The configuration file to be loaded is based upon the rules below.
 *
 * The configuration directory will be discovered by stripping the
 * website's hostname from left to right and pathname from right to
 * left. The first configuration file found will be used and any
 * others will be ignored. If no other configuration file is found
 * then the default configuration file at 'sites/default' will be used.
 *
 * For example, for a fictitious site installed at
 * http://www.drupal.org/mysite/test/, the 'settings.php'
 * is searched in the following directories:
 *
 *  1. sites/www.drupal.org.mysite.test
 *  2. sites/drupal.org.mysite.test
 *  3. sites/org.mysite.test
 *
 *  4. sites/www.drupal.org.mysite
 *  5. sites/drupal.org.mysite
 *  6. sites/org.mysite
 *
 *  7. sites/www.drupal.org
 *  8. sites/drupal.org
 *  9. sites/org
 *
 * 10. sites/default
 *
 * If you are installing on a non-standard port number, prefix the
 * hostname with that number. For example,
 * http://www.drupal.org:8080/mysite/test/ could be loaded from
所以。您将创建一个目录
store.example.com
,并仅为该域放置一个settings.php。 在该目录中,创建一个目录
modules
,并将所有应该仅针对该域显示的模块放在其中