Skip to content

Commit

Permalink
Deployed 3f2de79 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 20, 2024
1 parent c5d3d4a commit 1f72a20
Show file tree
Hide file tree
Showing 6 changed files with 243 additions and 246 deletions.
4 changes: 2 additions & 2 deletions 12.x/dependency-injection/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5259,7 +5259,7 @@ <h1 id="dependency-injection">Dependency Injection<a class="headerlink" href="#d
</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+</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>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>).</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 Down Expand Up @@ -5298,7 +5298,7 @@ <h2 id="inflection">Inflection<a class="headerlink" href="#inflection" title="Pe
<small>

Last update:
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">March 9, 2024</span>
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">March 20, 2024</span>


</small>
Expand Down
2 changes: 1 addition & 1 deletion 12.x/search/search_index.json

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions 12.x/site-alias-manager/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5202,11 +5202,8 @@
<h1 id="site-alias-manager">Site Alias Manager<a class="headerlink" href="#site-alias-manager" title="Permanent link">&para;</a></h1>
<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 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>
<li>An informative example is the <a href="https://github.com/drush-ops/drush/blob/13.x/src/Commands/core/BrowseCommands.php">browse command</a></li>
<li>A commandfile gets usually access to the SAM via <a href="../dependency-injection/#autowire">autowire</a>. The type hint to use is SiteAliasManagerInterface</li>
<li>If an alias was used for the current request, it is available via <code>$this-&gt;siteAliasManager-&gt;getself()</code>.</li>
<li>The SAM generally deals in <a href="https://github.com/consolidation/site-alias/blob/main/src/SiteAlias.php">SiteAlias</a> objects. That is how any given site alias is represented. See its methods for determining things like whether the alias points to a local host or remote host.</li>
<li><a href="../site-aliases/">Site alias docs</a>.</li>
Expand All @@ -5219,7 +5216,7 @@ <h1 id="site-alias-manager">Site Alias Manager<a class="headerlink" href="#site-
<small>

Last update:
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">March 9, 2024</span>
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">March 20, 2024</span>


</small>
Expand Down
Loading

0 comments on commit 1f72a20

Please sign in to comment.