• <small id='kjrym'></small><noframes id='kjrym'>

  • <i id='kjrym'><tr id='kjrym'><dt id='kjrym'><q id='kjrym'><span id='kjrym'><b id='kjrym'><form id='kjrym'><ins id='kjrym'></ins><ul id='kjrym'></ul><sub id='kjrym'></sub></form><legend id='kjrym'></legend><bdo id='kjrym'><pre id='kjrym'><center id='kjrym'></center></pre></bdo></b><th id='kjrym'></th></span></q></dt></tr></i><div id='kjrym'><tfoot id='kjrym'></tfoot><dl id='kjrym'><fieldset id='kjrym'></fieldset></dl></div>

      <tfoot id='kjrym'></tfoot>
        <bdo id='kjrym'></bdo><ul id='kjrym'></ul>
      <legend id='kjrym'><style id='kjrym'><dir id='kjrym'><q id='kjrym'></q></dir></style></legend>

      1. Drush 9 别名文件应该在 Drupal 8 中的什么位置?

        时间:2023-06-22
          <tbody id='WxDWi'></tbody>

        <small id='WxDWi'></small><noframes id='WxDWi'>

      2. <legend id='WxDWi'><style id='WxDWi'><dir id='WxDWi'><q id='WxDWi'></q></dir></style></legend>

          <bdo id='WxDWi'></bdo><ul id='WxDWi'></ul>

                <tfoot id='WxDWi'></tfoot>

                • <i id='WxDWi'><tr id='WxDWi'><dt id='WxDWi'><q id='WxDWi'><span id='WxDWi'><b id='WxDWi'><form id='WxDWi'><ins id='WxDWi'></ins><ul id='WxDWi'></ul><sub id='WxDWi'></sub></form><legend id='WxDWi'></legend><bdo id='WxDWi'><pre id='WxDWi'><center id='WxDWi'></center></pre></bdo></b><th id='WxDWi'></th></span></q></dt></tr></i><div id='WxDWi'><tfoot id='WxDWi'></tfoot><dl id='WxDWi'><fieldset id='WxDWi'></fieldset></dl></div>
                  本文介绍了Drush 9 别名文件应该在 Drupal 8 中的什么位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我尝试了一些方法来为我的本地 Drupal 项目创建别名,我指的是:https://www.drupal.org/node/1401522
                  https://www.drupal.org/project/drush/issues/831272
                  https://www.drupal.org/project/drush/issues/786766

                  I have tried some ways to create an alias for my local Drupal project, I'm referring to : https://www.drupal.org/node/1401522
                  https://www.drupal.org/project/drush/issues/831272
                  https://www.drupal.org/project/drush/issues/786766

                  我可以通过运行这个命令来连接:

                  I can connect by running this command :

                  drush --root=C:/wamp64/www/executive-coatings --uri=http://localhost:81/executive-coatings status
                  

                  输出:

                   Drupal version   : 8.6.13
                   Site URI         : http://localhost:81/executive-coatings
                   DB driver        : mysql
                   DB hostname      : localhost
                   DB port          : 3306
                   DB username      : root
                   DB name          : dev_ecc_new
                   Database         : Connected
                   Drupal bootstrap : Successful
                   Default theme    : ecc_front
                   Admin theme      : adminimal_theme
                   PHP binary       : C:wamp64inphpphp7.2.10php.exe
                   PHP config       : C:wamp64inphpphp7.2.10php.ini
                   PHP OS           : WINNT
                   Drush script     : C:wamp64wwwexecutive-coatingsvendorindrush.phar
                   Drush version    : 9.6.2
                   Drush temp       : C:UserskAppDataLocalTemp
                   Drush configs    : C:/Users/k/.drush/drush.yml
                                      C:/wamp64/www/executive-coatings/vendor/drush/drush/drush.yml
                   Install profile  : minimal
                   Drupal root      : C:wamp64wwwexecutive-coatings
                   Site path        : sites/default
                   Files, Public    : sites/default/files
                   Files, Temp      : /tmp
                  

                  但是当我尝试使用 drush 别名时,它不起作用.这是我的别名文件:

                  But when I try to use a drush alias it doesn't work. Here my alias file :

                  $aliases['local'] = array(
                        'uri' => 'localhost:81/executive-coatings',
                        'root' => 'C:/wamp64/www/executive-coatings',
                    'path-aliases' => array(
                      '%dump-dir' => '/tmp',
                    ),
                  );
                  

                  运行 drush @local status 返回 [preflight] 找不到别名 @local.

                  我想我把别名文件放在了错误的目录中,你能提供正确的路径吗?

                  I think I put my alias file in the wrong directory, can you provide the correct path ?

                  推荐答案

                  Alias 文件位置在这里不是您唯一的问题,因为您运行的是 Drush 9.x.这里是 Drush 8.x 和 Drush 9.x 之间关于别名的主要变化:

                  Alias file location is not your only issue here, because you are running Drush 9.x. Here the major changes between Drush 8.x and Drush 9.x regarding aliases :

                  • 站点别名不再是 PHP 文件而是 YAML 文件.希望 Drush 9.x 带有一个命令来转换你旧的 drush 8 别名:

                  • Site aliases are no longer PHP files but YAML files. Hopefully Drush 9.x comes with a command to convert your old drush 8 aliases :

                  drush site:alias-convert
                  

                • 默认情况下不再解析 Drush 8 中使用的用户别名位置(~/.drush/sites/etc/drush/sites),但是你可以在你的 ~/.drush/drush.yml 配置文件中注册任何可以放置别名文件的位置.可以通过运行以下命令自动设置旧的 Drush 8 路径:

                • The user alias locations used in Drush 8 (~/.drush/sites, /etc/drush/sites) are by default no longer parsed, but you can register any location where alias files may be placed in your ~/.drush/drush.yml configuration file. Setting the old Drush 8 paths can be done automatically by running :

                  drush core:init
                  

                  它将以下内容写入 ~/.drush/drush.yml :

                  It writes the following to ~/.drush/drush.yml :

                  drush:
                    paths:
                      alias-path:
                        - '${env.home}/.drush/sites'
                        - /etc/drush/sites
                  

                  例如在您的情况下,可以在文件中完成为网站 executive-coatings 别名 ecc 定义一个本地环境(提供此位置已按上述方式注册)~/.drush/sites/ecc.site.yml.

                  For example in your case, defining a local environment for the website executive-coatings aliased ecc may be done in the file (provided this location is registered as mentioned above) ~/.drush/sites/ecc.site.yml.

                  您还可以在以下位置(在该网站的项目根目录下,使用 self 在文件命名中):

                  You can also define environment aliases (eg. @dev, @preprod, etc.) for a given website at the following location (under the project root of that website, using self in the file naming) :

                  <DRUPAL_ROOT>/drush/sites/self.site.yml
                  

                • 有用的链接:
                  - https://github.com/drush-ops/drush/blob/master/examples/example.site.yml
                  - https://github.com/consolidation/site-alias

                  这篇关于Drush 9 别名文件应该在 Drupal 8 中的什么位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何以编程方式向 Drupal 7 中的用户配置文件添加新字段 下一篇:Drupal - 使用 boostrap 在 Drupal 之外检查登录用户不起作用

                  相关文章

                    <small id='XEZF6'></small><noframes id='XEZF6'>

                  1. <legend id='XEZF6'><style id='XEZF6'><dir id='XEZF6'><q id='XEZF6'></q></dir></style></legend>
                        <bdo id='XEZF6'></bdo><ul id='XEZF6'></ul>
                    1. <tfoot id='XEZF6'></tfoot>
                    2. <i id='XEZF6'><tr id='XEZF6'><dt id='XEZF6'><q id='XEZF6'><span id='XEZF6'><b id='XEZF6'><form id='XEZF6'><ins id='XEZF6'></ins><ul id='XEZF6'></ul><sub id='XEZF6'></sub></form><legend id='XEZF6'></legend><bdo id='XEZF6'><pre id='XEZF6'><center id='XEZF6'></center></pre></bdo></b><th id='XEZF6'></th></span></q></dt></tr></i><div id='XEZF6'><tfoot id='XEZF6'></tfoot><dl id='XEZF6'><fieldset id='XEZF6'></fieldset></dl></div>