Skip to content

Commit

Permalink
Deployed 7a27c1b to 12.x with MkDocs 1.4.3 and mike 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Mar 9, 2024
1 parent 7aded60 commit a32afb3
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion 12.x/commands/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5269,7 +5269,7 @@ <h1 id="creating-custom-commands">Creating Custom Commands<a class="headerlink"
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<ol>
<li>You may now use <a href="https://github.com/drush-ops/drush/blob/13.x/src/Commands/AutowireTrait.php">Autowire</a> to inject Drupal and Drush dependencies. Prior approaches were using a [create() method](dependency-injection.md#create-method and using a <a href="https://www.drush.org/11.x/dependency-injection/#services-files">drush.services.yml file</a>. These are now deprecated.</li>
<li>You may now use <a href="https://github.com/drush-ops/drush/blob/13.x/src/Commands/AutowireTrait.php">Autowire</a> to inject Drupal and Drush dependencies. Prior approaches were using a [create() method](dependency-injection.md#create-method] and using a <a href="https://www.drush.org/11.x/dependency-injection/#services-files">drush.services.yml file</a>. These are now deprecated.</li>
<li>Drush 12 expects all commandfiles in the <code>&lt;module-name&gt;/src/Drush/&lt;Commands|Generators&gt;</code> directory. The <code>Drush</code> subdirectory is a new requirement.</li>
</ol>
</div>
Expand Down
10 changes: 4 additions & 6 deletions 12.x/dependency-injection/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5258,8 +5258,8 @@ <h1 id="dependency-injection">Dependency Injection<a class="headerlink" href="#d
<p>Drush 11 and prior required <a href="https://www.drush.org/11.x/dependency-injection/#services-files">dependency injection via a drush.services.yml file</a>. This approach is deprecated in Drush 12+.</p>
</div>
<h2 id="autowire">Autowire<a class="headerlink" href="#autowire" title="Permanent link">&para;</a></h2>
<p><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.75 6.5a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5Z"/><path d="M2.5 1h8.44a1.5 1.5 0 0 1 1.06.44l10.25 10.25a1.5 1.5 0 0 1 0 2.12l-8.44 8.44a1.5 1.5 0 0 1-2.12 0L1.44 12A1.497 1.497 0 0 1 1 10.94V2.5A1.5 1.5 0 0 1 2.5 1Zm0 1.5v8.44l10.25 10.25 8.44-8.44L10.94 2.5Z"/></svg></span> 12.5+
Command files may inject Drush and Drupal services by adding the <a href="https://github.com/drush-ops/drush/blob/12.x/src/Commands/AutowireTrait.php">AutowireTrait</a> to the class (example: <a href="https://github.com/drush-ops/drush/blob/12.x/src/Commands/pm/MaintCommands.php">PmCommands</a>). This enables your <a href="https://www.drupal.org/node/3396179">Constructor parameter type hints determine the the injected service</a>. When a type hint is insufficient, an <a href="https://www.drupal.org/node/3396179">#[Autowire] Attribute</a> on the constructor property (with <em>service:</em> named argument) directs AutoWireTrait to the right service (example: <a href="https://github.com/drush-ops/drush/blob/12.x/src/Commands/core/LoginCommands.php">LoginCommands</a>). This Attribute is currently <em>required</em> when injecting Drush services (not required for Drupal services).</p>
<p><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.75 6.5a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5Z"/><path d="M2.5 1h8.44a1.5 1.5 0 0 1 1.06.44l10.25 10.25a1.5 1.5 0 0 1 0 2.12l-8.44 8.44a1.5 1.5 0 0 1-2.12 0L1.44 12A1.497 1.497 0 0 1 1 10.94V2.5A1.5 1.5 0 0 1 2.5 1Zm0 1.5v8.44l10.25 10.25 8.44-8.44L10.94 2.5Z"/></svg></span> 12.5+</p>
<p>Command files may inject Drush and Drupal services by adding the <a href="https://github.com/drush-ops/drush/blob/12.x/src/Commands/AutowireTrait.php">AutowireTrait</a> to the class (example: <a href="https://github.com/drush-ops/drush/blob/12.x/src/Commands/pm/MaintCommands.php">PmCommands</a>). This enables your <a href="https://www.drupal.org/node/3396179">Constructor parameter type hints determine the the injected service</a>. When a type hint is insufficient, an <a href="https://www.drupal.org/node/3396179">#[Autowire] Attribute</a> on the constructor property (with <em>service:</em> named argument) directs AutoWireTrait to the right service (example: <a href="https://github.com/drush-ops/drush/blob/12.x/src/Commands/core/LoginCommands.php">LoginCommands</a>). This Attribute is currently <em>required</em> when injecting Drush services (not required for Drupal services).</p>
<p>If your command is not found by Drush, add the <code>-vvv</code> option for debug info about any service instantiation errors. If Autowire is still insufficient, a commandfile may implement its own <code>create()</code> method (see below).</p>
<h2 id="create-method">create() method<a class="headerlink" href="#create-method" title="Permanent link">&para;</a></h2>
<p><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.75 6.5a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5Z"/><path d="M2.5 1h8.44a1.5 1.5 0 0 1 1.06.44l10.25 10.25a1.5 1.5 0 0 1 0 2.12l-8.44 8.44a1.5 1.5 0 0 1-2.12 0L1.44 12A1.497 1.497 0 0 1 1 10.94V2.5A1.5 1.5 0 0 1 2.5 1Zm0 1.5v8.44l10.25 10.25 8.44-8.44L10.94 2.5Z"/></svg></span> 11.6+</p>
Expand All @@ -5281,13 +5281,11 @@ <h2 id="create-method">create() method<a class="headerlink" href="#create-method
See the <a href="https://www.drupal.org/docs/drupal-apis/services-and-dependency-injection/services-and-dependency-injection-in-drupal-8#s-injecting-dependencies-into-controllers-forms-and-blocks">Drupal Documentation</a> for details on how to inject Drupal services into your command file. This approach mimics Drupal's blocks, forms, and controllers.</p>
<h2 id="createearly-method">createEarly() method<a class="headerlink" href="#createearly-method" title="Permanent link">&para;</a></h2>
<p><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.75 6.5a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5Z"/><path d="M2.5 1h8.44a1.5 1.5 0 0 1 1.06.44l10.25 10.25a1.5 1.5 0 0 1 0 2.12l-8.44 8.44a1.5 1.5 0 0 1-2.12 0L1.44 12A1.497 1.497 0 0 1 1 10.94V2.5A1.5 1.5 0 0 1 2.5 1Zm0 1.5v8.44l10.25 10.25 8.44-8.44L10.94 2.5Z"/></svg></span> 12.0+</p>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>The createEarly() method was deprecated in Drush 12.5. Instead put a <code>#[CLI\Bootstrap(DrupalBootLevels::NONE)]</code> Attribute on the command class and inject dependencies via the usual <code>__construct</code> with <a href="https://github.com/drush-ops/drush/blob/13.x/src/Commands/AutowireTrait.php">AutowireTrait</a>. Note also that Drush commands packaged with Drupal modules are not discovered
<p>The <code>createEarly()</code> method was deprecated in Drush 12.5. Instead put a <code>#[CLI\Bootstrap(DrupalBootLevels::NONE)]</code> Attribute on the command class and inject dependencies via the usual <code>__construct</code> with <a href="https://github.com/drush-ops/drush/blob/13.x/src/Commands/AutowireTrait.php">AutowireTrait</a>. </p>
<p>Note also that Drush commands packaged with Drupal modules are not discovered
until after Drupal bootstraps, and therefore cannot use <code>createEarly()</code>. This
mechanism is only usable by PSR-4 discovered commands packaged with Composer
projects that are <em>not</em> Drupal modules.</p>
</div>
<h2 id="inflection">Inflection<a class="headerlink" href="#inflection" title="Permanent link">&para;</a></h2>
<p>A command class may implement the following interfaces. When doing so, implement the corresponding trait to satisfy the interface.</p>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion 12.x/search/search_index.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 12.x/site-alias-manager/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5203,7 +5203,7 @@ <h1 id="site-alias-manager">Site Alias Manager<a class="headerlink" href="#site-
<p>The <a href="https://github.com/consolidation/site-alias/blob/4.0.1/src/SiteAliasManager.php">Site Alias Manager (SAM)</a> service is used to retrieve information about one or all of the site aliases for the current installation.</p>
<ul>
<li>An informative example is the <a href="https://github.com/drush-ops/drush/blob/12.x/src/Commands/core/BrowseCommands.php">browse command</a></li>
<li>A commandfile gets access to the SAM as follows:
<li>A commandfile gets usually access to the SAM via <a href="../dependency-injection/#autowire">autowire</a> of a dependency:
<div class="highlight"><pre><span></span><code><span class="p">#[</span><span class="nd">Autowire</span><span class="p">(</span><span class="nx">service</span><span class="o">:</span> <span class="nx">DependencyInjection</span><span class="o">::</span><span class="na">SITE_ALIAS_MANAGER</span><span class="p">)]</span>
<span class="k">private</span> <span class="nx">readonly</span> <span class="nx">SiteAliasManagerInterface</span> <span class="nv">$siteAliasManager</span>
</code></pre></div></li>
Expand Down
Binary file modified 12.x/sitemap.xml.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
"version": "12.x",
"title": "12.x",
"aliases": [
"dev",
"latest"
"latest",
"dev"
]
},
{
Expand Down

0 comments on commit a32afb3

Please sign in to comment.