Drush: Drush\CommandFiles\core\InitCommandFile Class Reference

Public Member Functions

 initializeDrush ($options=[ 'edit'=> '', 'add-path'=> '',])

Protected Member Functions

 findBashrc ($home)
 findPathToDrush ()
 bashAddition ($file)

Detailed Description

Definition at line 6 of file InitCommandFile.php.

Member Function Documentation

Drush\CommandFiles\core\InitCommandFile::findBashrc (   $home)
protected

Determine which .bashrc file is best to use on this platform.

Definition at line 131 of file InitCommandFile.php.

Referenced by Drush\CommandFiles\core\InitCommandFile\initializeDrush().

Here is the caller graph for this function:

Drush\CommandFiles\core\InitCommandFile::findPathToDrush ( )
protected

Determine where Drush is located, so that we can add that location to the $PATH

Definition at line 139 of file InitCommandFile.php.

Referenced by Drush\CommandFiles\core\InitCommandFile\initializeDrush().

Here is the caller graph for this function:

Drush\CommandFiles\core\InitCommandFile::initializeDrush (   $options = [ 'edit' =,
''  ,
'add-path'  ,
''  ,
 
)

Initialize local Drush configuration

core-init

Todo:
: -options

Enrich the bash startup file with completion and aliases. $edit Open the new config file in an editor. $add-path Always add Drush to the $PATH in the user's .bashrc file, even if it is already in the $PATH. Use –no-add-path to skip updating .bashrc with the Drush $PATH. Default is to update .bashrc only if Drush is not already in the $PATH. init core-init –edit Enrich Bash and open drush config file in editor. core-init –edit –bg Return to shell prompt as soon as the editor window opens

Definition at line 27 of file InitCommandFile.php.

References drush_confirm(), drush_get_editor(), drush_server_home(), drush_shell_exec_interactive(), drush_user_abort(), drush_which(), dt(), Drush\CommandFiles\core\InitCommandFile\findBashrc(), and Drush\CommandFiles\core\InitCommandFile\findPathToDrush().

Here is the call graph for this function:


The documentation for this class was generated from the following file:

File

doxygen/html/classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile.html
View source
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Drush: Drush\CommandFiles\core\InitCommandFile Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Drush
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>Drush</b></li><li class="navelem"><b>CommandFiles</b></li><li class="navelem"><b>core</b></li><li class="navelem"><a class="el" href="classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile.html">InitCommandFile</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Drush\CommandFiles\core\InitCommandFile Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aaba009dac682ac302e72004890accbf2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile.html#aaba009dac682ac302e72004890accbf2">initializeDrush</a> ($options=[ 'edit'=&gt; '', 'add-path'=&gt; '',])</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:aeebd01a93f06ac9e8c94a1baee456cd8"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile.html#aeebd01a93f06ac9e8c94a1baee456cd8">findBashrc</a> ($home)</td></tr>
<tr class="memitem:a892da03cb57ffd6950e6fad157ade543"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile.html#a892da03cb57ffd6950e6fad157ade543">findPathToDrush</a> ()</td></tr>
<tr class="memitem:a5a9d8a509f62516dbaaf871bfe7da045"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5a9d8a509f62516dbaaf871bfe7da045"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>bashAddition</b> ($file)</td></tr>
</table>
<a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock">
<p>Definition at line <a class="el" href="InitCommandFile_8php_source.html#l00006">6</a> of file <a class="el" href="InitCommandFile_8php_source.html">InitCommandFile.php</a>.</p>
</div><h2>Member Function Documentation</h2>
<a class="anchor" id="aeebd01a93f06ac9e8c94a1baee456cd8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">Drush\CommandFiles\core\InitCommandFile::findBashrc </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$home</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Determine which .bashrc file is best to use on this platform. </p>

<p>Definition at line <a class="el" href="InitCommandFile_8php_source.html#l00131">131</a> of file <a class="el" href="InitCommandFile_8php_source.html">InitCommandFile.php</a>.</p>

<p>Referenced by <a class="el" href="InitCommandFile_8php_source.html#l00027">Drush\CommandFiles\core\InitCommandFile\initializeDrush()</a>.</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile_aeebd01a93f06ac9e8c94a1baee456cd8_icgraph.png" border="0" usemap="#classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile_aeebd01a93f06ac9e8c94a1baee456cd8_icgraph" alt=""/></div>
<map name="classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile_aeebd01a93f06ac9e8c94a1baee456cd8_icgraph" id="classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile_aeebd01a93f06ac9e8c94a1baee456cd8_icgraph">
<area shape="rect" id="node3" href="classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile.html#aaba009dac682ac302e72004890accbf2" title="Drush\\CommandFiles\l\\core\\InitCommandFile\l\\initializeDrush" alt="" coords="208,5,363,69"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a892da03cb57ffd6950e6fad157ade543"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">Drush\CommandFiles\core\InitCommandFile::findPathToDrush </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Determine where <a class="el" href="classDrush.html">Drush</a> is located, so that we can add that location to the $PATH </p>

<p>Definition at line <a class="el" href="InitCommandFile_8php_source.html#l00139">139</a> of file <a class="el" href="InitCommandFile_8php_source.html">InitCommandFile.php</a>.</p>

<p>Referenced by <a class="el" href="InitCommandFile_8php_source.html#l00027">Drush\CommandFiles\core\InitCommandFile\initializeDrush()</a>.</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile_a892da03cb57ffd6950e6fad157ade543_icgraph.png" border="0" usemap="#classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile_a892da03cb57ffd6950e6fad157ade543_icgraph" alt=""/></div>
<map name="classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile_a892da03cb57ffd6950e6fad157ade543_icgraph" id="classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile_a892da03cb57ffd6950e6fad157ade543_icgraph">
<area shape="rect" id="node3" href="classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile.html#aaba009dac682ac302e72004890accbf2" title="Drush\\CommandFiles\l\\core\\InitCommandFile\l\\initializeDrush" alt="" coords="208,5,363,69"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="aaba009dac682ac302e72004890accbf2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Drush\CommandFiles\core\InitCommandFile::initializeDrush </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$options</em> = <code>[&#160;'edit'&#160;=</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">''&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">'add-path'&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">''&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">]&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Initialize local <a class="el" href="classDrush.html">Drush</a> configuration</p>
<p>core-init</p>
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000012">Todo:</a></b></dt><dd>: -options</dd></dl>
<p>Enrich the bash startup file with completion and aliases.  $edit Open the new config file in an editor.  $add-path Always add <a class="el" href="classDrush.html">Drush</a> to the $PATH in the user's .bashrc file, even if it is already in the $PATH. Use &ndash;no-add-path to skip updating .bashrc with the <a class="el" href="classDrush.html">Drush</a> $PATH. Default is to update .bashrc only if <a class="el" href="classDrush.html">Drush</a> is not already in the $PATH.  init  core-init &ndash;edit Enrich Bash and open drush config file in editor.  core-init &ndash;edit &ndash;bg Return to shell prompt as soon as the editor window opens </p>

<p>Definition at line <a class="el" href="InitCommandFile_8php_source.html#l00027">27</a> of file <a class="el" href="InitCommandFile_8php_source.html">InitCommandFile.php</a>.</p>

<p>References <a class="el" href="drush_8inc_source.html#l00395">drush_confirm()</a>, <a class="el" href="exec_8inc_source.html#l00092">drush_get_editor()</a>, <a class="el" href="includes_2environment_8inc_source.html#l00630">drush_server_home()</a>, <a class="el" href="exec_8inc_source.html#l00104">drush_shell_exec_interactive()</a>, <a class="el" href="drush_8inc_source.html#l01603">drush_user_abort()</a>, <a class="el" href="exec_8inc_source.html#l00174">drush_which()</a>, <a class="el" href="output_8inc_source.html#l00149">dt()</a>, <a class="el" href="InitCommandFile_8php_source.html#l00131">Drush\CommandFiles\core\InitCommandFile\findBashrc()</a>, and <a class="el" href="InitCommandFile_8php_source.html#l00139">Drush\CommandFiles\core\InitCommandFile\findPathToDrush()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile_aaba009dac682ac302e72004890accbf2_cgraph.png" border="0" usemap="#classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile_aaba009dac682ac302e72004890accbf2_cgraph" alt=""/></div>
<map name="classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile_aaba009dac682ac302e72004890accbf2_cgraph" id="classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile_aaba009dac682ac302e72004890accbf2_cgraph">
<area shape="rect" id="node3" href="group__userinput.html#gaa4169b83ff9dc4222af95d376b21268b" title="drush_confirm" alt="" coords="461,109,565,139"/><area shape="rect" id="node19" href="group__commandwrappers.html#ga516aab026be224e57d9fc0fe9c3de79f" title="drush_get_editor" alt="" coords="455,5,572,35"/><area shape="rect" id="node22" href="includes_2environment_8inc.html#afae6d4a5a12623e5502ca262346c799b" title="drush_server_home" alt="" coords="236,496,372,525"/><area shape="rect" id="node24" href="group__commandwrappers.html#gad0b72e62d81d339d68dc2d3d36db75d6" title="drush_shell_exec_interactive" alt="" coords="209,316,399,345"/><area shape="rect" id="node36" href="group__errorhandling.html#ga366aaafdf8c774a58653c64a65b6d91c" title="drush_user_abort" alt="" coords="452,393,575,423"/><area shape="rect" id="node55" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96" title="dt" alt="" coords="708,500,745,529"/><area shape="rect" id="node67" href="group__commandwrappers.html#ga3baeb8291ac5fa5e67fd5cc1b1ee1f5e" title="drush_which" alt="" coords="257,549,351,579"/><area shape="rect" id="node70" href="classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile.html#aeebd01a93f06ac9e8c94a1baee456cd8" title="Drush\\CommandFiles\l\\core\\InitCommandFile\l\\findBashrc" alt="" coords="227,603,381,667"/><area shape="rect" id="node72" href="classDrush_1_1CommandFiles_1_1core_1_1InitCommandFile.html#a892da03cb57ffd6950e6fad157ade543" title="Drush\\CommandFiles\l\\core\\InitCommandFile\l\\findPathToDrush" alt="" coords="227,691,381,755"/><area shape="rect" id="node5" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5" title="drush_get_context" alt="" coords="1285,367,1413,396"/><area shape="rect" id="node7" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740" title="drush_print" alt="" coords="901,83,987,112"/><area shape="rect" id="node16" href="group__outputfunctions.html#ga6dc4aa94bd0a854c564a2538e166c749" title="drush_print_prompt" alt="" coords="660,32,793,61"/><area shape="rect" id="node9" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8" title="drush_get_option" alt="" coords="1080,83,1200,112"/><area shape="rect" id="node11" href="context_8inc.html#aee5781894bf828bfa508d9052553f809" title="_drush_get_option" alt="" coords="1285,109,1413,139"/><area shape="rect" id="node13" href="context_8inc.html#a9f6272c1a68141ce873c07aae3a316ac" title="drush_context_names" alt="" coords="1275,56,1424,85"/><area shape="rect" id="node26" href="group__commandwrappers.html#ga0eed47c4d6d19d386936ad57f34b10b2" title="_drush_shell_exec" alt="" coords="448,291,579,320"/><area shape="rect" id="node28" href="group__commandwrappers.html#gac21dc9409bff5197d255978c3cf6e761" title="_drush_shell_exec_output_set" alt="" coords="628,237,825,267"/><area shape="rect" id="node32" href="group__commandwrappers.html#ga3a1bb3ae751f14749ce1dbe4ec9c3288" title="drush_shell_proc_open" alt="" coords="649,291,804,320"/><area shape="rect" id="node38" href="group__logging.html#ga47324b65808524558a488916b150dd51" title="drush_log" alt="" coords="688,447,765,476"/><area shape="rect" id="node52" href="context_8inc.html#af983acfe90e7d7bbdbd67c57f93708ba" title="drush_set_context" alt="" coords="880,393,1008,423"/><area shape="rect" id="node40" href="group__logging.html#ga10110f5007bd6fd1b7915e9dece4774f" title="_drush_log" alt="" coords="901,447,987,476"/><area shape="rect" id="node42" href="backend_8inc.html#a38490210d77373f3d8492caf4e9a3190" title="drush_backend_packet" alt="" coords="1063,495,1217,524"/><area shape="rect" id="node46" href="classDrush.html#aeda0f4644c7f586f873055d39dd755a5" title="Drush\\logger" alt="" coords="1092,548,1188,577"/><area shape="rect" id="node48" href="classDrush.html#a83560a0aab97e348848b3615f152af54" title="Drush\\service" alt="" coords="1481,575,1583,604"/><area shape="rect" id="node50" href="classDrush.html#abce7035069a9f7517f908b82bdd4dae0" title="Drush\\getContainer" alt="" coords="1633,575,1767,604"/><area shape="rect" id="node57" href="drupal_8inc.html#ad2ccab77d4bc8e7355186f26cd328ac0" title="drush_drupal_major\l_version" alt="" coords="877,573,1011,619"/><area shape="rect" id="node65" href="group__outputfunctions.html#ga2391425402626377e6464f1f649f8c65" title="find_legacy_dt_args" alt="" coords="875,500,1013,529"/><area shape="rect" id="node59" href="drupal_8inc.html#a203e989fd043d054d774954e2b2dff21" title="drush_drupal_version" alt="" coords="1068,601,1212,631"/><area shape="rect" id="node61" href="classDrush.html#a104f09419bc8a46c4bf205b49268b3a4" title="Drush\\bootstrapManager" alt="" coords="1267,600,1432,629"/></map>
</div>
</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>lib/Drush/CommandFiles/core/<a class="el" href="InitCommandFile_8php_source.html">InitCommandFile.php</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Nov 2 2016 07:30:13 for Drush by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.2
</small></address>
</body>
</html>