Drush: commands/core/topic.drush.inc Source File

  1. 7.x doxygen/html/topic_8drush_8inc_source.html
  2. master doxygen/html/topic_8drush_8inc_source.html
Go to the documentation of this file.
1 <?php
2 
3 /**
4  * @file
5  * Topic command and associated hooks.
6  */
7 
8 /**
9  * Implementation of hook_drush_command().
10  *
11  * @return
12  * An associative array describing your command(s).
13  */
14 function topic_drush_command() {
15  $items['core-topic'] = array(
16  'description' => 'Read detailed documentation on a given topic.',
17  'arguments' => array(
18  'topic name' => 'The name of the topic you wish to view. If omitted, list all topic descriptions (and names in parenthesis).',
19  ),
20  'examples' => array(
21  'drush topic' => 'Show all available topics.',
22  'drush topic docs-context' => 'Show documentation for the drush context API',
23  'drush docs-context' => 'Show documentation for the drush context API',
24  ),
25  'bootstrap' => DRUSH_BOOTSTRAP_NONE,
26  'remote-tty' => TRUE,
27  'aliases' => array('topic'),
28  'topics' => array('docs-readme'),
29  );
30 
31  return $items;
32 }
33 
34 /**
35  * Implement hook_drush_help_alter(). Show 'Topics' section on help detail.
36  */
37 function topic_drush_help_alter(&$command) {
38  $implemented = drush_get_commands();
39  foreach ($command['topics'] as $topic_name) {
40  // We have a related topic. Inject into the $command so the topic displays.
41  $command['sections']['topic_section'] = 'Topics';
42  $command['topic_section'][$topic_name] = $implemented[$topic_name]['description'];
43  }
44 }
45 
46 /**
47  * A command callback.
48  *
49  * Show a choice list of available topics and then dispatch to the respective command.
50  *
51  * @param string $topic_name
52  * A command name.
53  */
54 function drush_topic_core_topic($topic_name = NULL) {
55  $commands = drush_get_commands();
56  $topics = drush_get_topics();
57  if (isset($topic_name)) {
58  foreach (drush_get_topics() as $key => $topic) {
59  if (strstr($key, $topic_name) === FALSE) {
60  unset($topics[$key]);
61  }
62  }
63  }
64  if (empty($topics)) {
65  return drush_set_error('DRUSH_NO_SUCH_TOPIC', dt("No topics on !topic found.", array('!topic' => $topic_name)));
66  }
67  if (count($topics) > 1) {
68  // Show choice list.
69  foreach ($topics as $key => $topic) {
70  $choices[$key] = $topic['description'];
71  }
72  natcasesort($choices);
73  if (!$topic_name = drush_choice($choices, dt('Choose a topic'), '!value (!key)', array(5))) {
74  return drush_user_abort();
75  }
76  }
77  else {
78  $keys = array_keys($topics);
79  $topic_name = array_pop($keys);
80  }
81  return drush_dispatch($commands[$topic_name]);
82 }
83 
84 /**
85  * A command argument complete callback.
86  *
87  * @return
88  * Available topic keys.
89  */
91  return array('values' => array_keys(drush_get_topics()));
92 }
93 
94 /**
95  * Retrieve all defined topics
96  */
97 function drush_get_topics() {
98  $commands = drush_get_commands();
99  foreach ($commands as $key => $command) {
100  if (!empty($command['topic']) && empty($command['is_alias'])) {
101  $topics[$key] = $command;
102  }
103  }
104  return $topics;
105 }

File

doxygen/html/topic_8drush_8inc_source.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: commands/core/topic.drush.inc Source File</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><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><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="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#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"><a class="el" href="dir_afac61274991793aa7e9133a8f4f291e.html">commands</a></li><li class="navelem"><a class="el" href="dir_5762b63965e3a68a35f77c23b4dd4668.html">core</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">topic.drush.inc</div>  </div>
</div><!--header-->
<div class="contents">
<a href="topic_8drush_8inc.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;&lt;?php</div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * @file</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *   Topic command and associated hooks.</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * Implementation of hook_drush_command().</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * @return</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> *   An associative array describing your command(s).</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"><a class="code" href="topic_8drush_8inc.html#a5d5a8b3fedbb6057d10faa8a9897b197">   14</a></span>&#160;<span class="keyword">function</span> <a class="code" href="topic_8drush_8inc.html#a5d5a8b3fedbb6057d10faa8a9897b197">topic_drush_command</a>() {</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;  $items[<span class="stringliteral">&#39;core-topic&#39;</span>] = array(</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;    <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Read detailed documentation on a given topic.&#39;</span>,</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;    <span class="stringliteral">&#39;arguments&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;      <span class="stringliteral">&#39;topic name&#39;</span> =&gt; <span class="stringliteral">&#39;The name of the topic you wish to view. If omitted, list all topic descriptions (and names in parenthesis).&#39;</span>,</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;    ),</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;    <span class="stringliteral">&#39;examples&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;      <span class="stringliteral">&#39;drush topic&#39;</span> =&gt; <span class="stringliteral">&#39;Show all available topics.&#39;</span>,</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;      <span class="stringliteral">&#39;drush topic docs-context&#39;</span> =&gt; <span class="stringliteral">&#39;Show documentation for the drush context API&#39;</span>,</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;      <span class="stringliteral">&#39;drush docs-context&#39;</span> =&gt; <span class="stringliteral">&#39;Show documentation for the drush context API&#39;</span>,</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    ),</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    <span class="stringliteral">&#39;bootstrap&#39;</span> =&gt; DRUSH_BOOTSTRAP_NONE,</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    <span class="stringliteral">&#39;remote-tty&#39;</span> =&gt; TRUE,</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    <span class="stringliteral">&#39;aliases&#39;</span> =&gt; array(<span class="stringliteral">&#39;topic&#39;</span>),</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    <span class="stringliteral">&#39;topics&#39;</span> =&gt; array(<span class="stringliteral">&#39;docs-readme&#39;</span>),</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;  );</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;  <span class="keywordflow">return</span> $items;</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;}</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="comment"> * Implement hook_drush_help_alter(). Show &#39;Topics&#39; section on help detail.</span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="code" href="topic_8drush_8inc.html#a344ae16f10767b01599d5a0d4ee711e3">   37</a></span>&#160;<span class="keyword">function</span> <a class="code" href="topic_8drush_8inc.html#a344ae16f10767b01599d5a0d4ee711e3">topic_drush_help_alter</a>(&amp;$command) {</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;  $implemented = <a class="code" href="command_8inc.html#af0c377881e5c9c772f0cad80ea016452">drush_get_commands</a>();</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;  <span class="keywordflow">foreach</span> ($command[<span class="stringliteral">&#39;topics&#39;</span>] as $topic_name) {</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    <span class="comment">// We have a related topic. Inject into the $command so the topic displays.</span></div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    $command[<span class="stringliteral">&#39;sections&#39;</span>][<span class="stringliteral">&#39;topic_section&#39;</span>] = <span class="stringliteral">&#39;Topics&#39;</span>;</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    $command[<span class="stringliteral">&#39;topic_section&#39;</span>][$topic_name] = $implemented[$topic_name][<span class="stringliteral">&#39;description&#39;</span>];</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;  }</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;}</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="comment"> * A command callback.</span></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="comment"> * Show a choice list of available topics and then dispatch to the respective command.</span></div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="comment"> * @param string $topic_name</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="comment"> *   A command name.</span></div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="code" href="topic_8drush_8inc.html#ae8a604f9b99910a82bc193b3d11490cc">   54</a></span>&#160;<span class="keyword">function</span> <a class="code" href="topic_8drush_8inc.html#ae8a604f9b99910a82bc193b3d11490cc">drush_topic_core_topic</a>($topic_name = NULL) {</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;  $commands = <a class="code" href="command_8inc.html#af0c377881e5c9c772f0cad80ea016452">drush_get_commands</a>();</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;  $topics = <a class="code" href="topic_8drush_8inc.html#a6565f0ae92a81e15b374bf7a4147362b">drush_get_topics</a>();</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;  <span class="keywordflow">if</span> (isset($topic_name)) {</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <span class="keywordflow">foreach</span> (<a class="code" href="topic_8drush_8inc.html#a6565f0ae92a81e15b374bf7a4147362b">drush_get_topics</a>() as $key =&gt; $topic) {</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;      <span class="keywordflow">if</span> (strstr($key, $topic_name) === FALSE) {</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;        unset($topics[$key]);</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;      }</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    }</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;  }</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;  <span class="keywordflow">if</span> (empty($topics)) {</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4">drush_set_error</a>(<span class="stringliteral">&#39;DRUSH_NO_SUCH_TOPIC&#39;</span>, <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;No topics on !topic found.&quot;</span>, array(<span class="stringliteral">&#39;!topic&#39;</span> =&gt; $topic_name)));</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;  }</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;  <span class="keywordflow">if</span> (count($topics) &gt; 1) {</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="comment">// Show choice list.</span></div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <span class="keywordflow">foreach</span> ($topics as $key =&gt; $topic) {</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;      $choices[$key] = $topic[<span class="stringliteral">&#39;description&#39;</span>];</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    }</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    natcasesort($choices);</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    <span class="keywordflow">if</span> (!$topic_name = <a class="code" href="group__userinput.html#ga7e823bcd58051b17e6e5601340f0c784">drush_choice</a>($choices, <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Choose a topic&#39;</span>), <span class="stringliteral">&#39;!value (!key)&#39;</span>, array(5))) {</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga366aaafdf8c774a58653c64a65b6d91c">drush_user_abort</a>();</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    }</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;  }</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;  <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    $keys = array_keys($topics);</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    $topic_name = array_pop($keys);</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;  }</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;  <span class="keywordflow">return</span> <a class="code" href="group__dispatching.html#ga5db6ec7318291b3692bf905b87a9276b">drush_dispatch</a>($commands[$topic_name]);</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;}</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="comment"> * A command argument complete callback.</span></div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="comment"> * @return</span></div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<span class="comment"> *   Available topic keys.</span></div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"><a class="code" href="topic_8drush_8inc.html#aeb0d8445f69455eb3eebf375b0dbfd50">   90</a></span>&#160;<span class="keyword">function</span> <a class="code" href="topic_8drush_8inc.html#aeb0d8445f69455eb3eebf375b0dbfd50">topic_core_topic_complete</a>() {</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;  <span class="keywordflow">return</span> array(<span class="stringliteral">&#39;values&#39;</span> =&gt; array_keys(<a class="code" href="topic_8drush_8inc.html#a6565f0ae92a81e15b374bf7a4147362b">drush_get_topics</a>()));</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;}</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;<span class="comment"> * Retrieve all defined topics</span></div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"><a class="code" href="topic_8drush_8inc.html#a6565f0ae92a81e15b374bf7a4147362b">   97</a></span>&#160;<span class="keyword">function</span> <a class="code" href="topic_8drush_8inc.html#a6565f0ae92a81e15b374bf7a4147362b">drush_get_topics</a>() {</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;  $commands = <a class="code" href="command_8inc.html#af0c377881e5c9c772f0cad80ea016452">drush_get_commands</a>();</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;  <span class="keywordflow">foreach</span> ($commands as $key =&gt; $command) {</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    <span class="keywordflow">if</span> (!empty($command[<span class="stringliteral">&#39;topic&#39;</span>]) &amp;&amp; empty($command[<span class="stringliteral">&#39;is_alias&#39;</span>])) {</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;      $topics[$key] = $command;</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    }</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;  }</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;  <span class="keywordflow">return</span> $topics;</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Nov 2 2016 07:28:54 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>