Drush: commands/pm/info.pm.inc Source File

  1. 7.x doxygen/html/info_8pm_8inc_source.html
  2. master doxygen/html/info_8pm_8inc_source.html
Go to the documentation of this file.
1 <?php
2 
3 /**
4  * @file
5  * pm-info command implementation.
6  */
7 
9 
10 /**
11  * Command callback. Show detailed info for one or more extensions.
12  */
13 function drush_pm_info() {
14  $result = array();
16 
17  $extension_info = drush_get_extensions(FALSE);
18  _drush_pm_expand_extensions($args, $extension_info);
19  // If no extensions are provided, show all.
20  if (count($args) == 0) {
21  $args = array_keys($extension_info);
22  }
23 
24  foreach ($args as $extension) {
25  if (isset($extension_info[$extension])) {
26  $info = $extension_info[$extension];
27  }
28  else {
29  drush_log(dt('!extension was not found.', array('!extension' => $extension)), LogLevel::WARNING);
30  continue;
31  }
32  if (drush_extension_get_type($info) == 'module') {
33  $data = _drush_pm_info_module($info);
34  }
35  else {
36  $data = _drush_pm_info_theme($info);
37  }
38  $result[$extension] = $data;
39  }
40  return $result;
41 }
42 
43 /**
44  * Output format formatter-filter callback.
45  *
46  * @see drush_parse_command()
47  * @see drush_outputformat
48  */
50  $result = array();
51  foreach ($data as $extension => $info) {
52  foreach($info as $key => $value) {
53  if (is_array($value)) {
54  if (empty($value)) {
55  $value = 'none';
56  }
57  else {
58  $value = implode(', ', $value);
59  }
60  }
61  $result[$extension][$key] = $value;
62  }
63  }
64  return $result;
65 }
66 
67 /**
68  * Return an array with general info of an extension.
69  */
70 function _drush_pm_info_extension($info) {
71  $data['extension'] = drush_extension_get_name($info);
72  $data['project'] = isset($info->info['project'])?$info->info['project']:dt('Unknown');
73  $data['type'] = drush_extension_get_type($info);
74  $data['title'] = $info->info['name'];
75  $data['config'] = isset($info->info['configure']) ? $info->info['configure'] : dt('None');
76  $data['description'] = $info->info['description'];
77  $data['version'] = $info->info['version'];
78  $data['date'] = isset($info->info['datestamp']) ? format_date($info->info['datestamp'], 'custom', 'Y-m-d') : NULL;
79  $data['package'] = $info->info['package'];
80  $data['core'] = $info->info['core'];
81  $data['php'] = $info->info['php'];
82  $data['status'] = drush_get_extension_status($info);
83  $data['path'] = drush_extension_get_path($info);
84 
85  return $data;
86 }
87 
88 /**
89  * Return an array with info of a module.
90  */
91 function _drush_pm_info_module($info) {
92  $major_version = drush_drupal_major_version();
93 
94  $data = _drush_pm_info_extension($info);
95  if ($info->schema_version > 0) {
96  $schema_version = $info->schema_version;
97  }
98  elseif ($info->schema_version == -1) {
99  $schema_version = "no schema installed";
100  }
101  else {
102  $schema_version = "module has no schema";
103  }
104  $data['schema_version'] = $schema_version;
105  if ($major_version == 7) {
106  $data['files'] = $info->info['files'];
107  }
108  $data['requires'] = $info->info['dependencies'];
109 
110  if ($major_version == 6) {
111  $requiredby = $info->info['dependents'];
112  }
113  else {
114  $requiredby = array_keys($info->required_by);
115  }
116  $data['required_by'] = $requiredby;
117  if ($info->status == 1) {
118  $role = drush_role_get_class();
119  $data['permissions'] = $role->getModulePerms(drush_extension_get_name($info));
120  }
121  return $data;
122 }
123 
124 /**
125  * Return an array with info of a theme.
126  */
127 function _drush_pm_info_theme($info) {
128  $major_version = drush_drupal_major_version();
129 
130  $data = _drush_pm_info_extension($info);
131 
132  $data['core'] = $info->info['core'];
133  $data['php'] = $info->info['php'];
134  $data['engine'] = $info->info['engine'];
135  $data['base_theme'] = isset($info->base_themes) ? implode($info->base_themes, ', ') : '';
136  $regions = $info->info['regions'];
137  $data['regions'] = $regions;
138  $features = $info->info['features'];
139  $data['features'] = $features;
140  if (count($info->info['stylesheets']) > 0) {
141  $data['stylesheets'] = '';
142  foreach ($info->info['stylesheets'] as $media => $files) {
143  $files = array_keys($files);
144  $data['media '.$media] = $files;
145  }
146  }
147  if (count($info->info['scripts']) > 0) {
148  $scripts = array_keys($info->info['scripts']);
149  $data['scripts'] = $scripts;
150  }
151  return $data;
152 }

File

doxygen/html/info_8pm_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/pm/info.pm.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_15591510fc66414792ea8adada328324.html">pm</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">info.pm.inc</div>  </div>
</div><!--header-->
<div class="contents">
<a href="info_8pm_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"> * pm-info command implementation.</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;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;use <a class="code" href="classDrush_1_1Log_1_1LogLevel.html">Drush\Log\LogLevel</a>;</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"></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"> * Command callback. Show detailed info for one or more extensions.</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"><a class="code" href="info_8pm_8inc.html#a979f36be571c082a364025ae4bce438b">   13</a></span>&#160;<span class="keyword">function</span> <a class="code" href="info_8pm_8inc.html#a979f36be571c082a364025ae4bce438b">drush_pm_info</a>() {</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;  $result = array();</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;  $args = <a class="code" href="pm_8drush_8inc.html#a34b2e74a73c176eed08207d9bcb4c587">pm_parse_arguments</a>(func_get_args());</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;  $extension_info = <a class="code" href="includes_2environment_8inc.html#a2f6ea049bc3f5361815aafe6f44a535d">drush_get_extensions</a>(FALSE);</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;  <a class="code" href="pm_8drush_8inc.html#a5f41049d5b474b8d5bbbe9f161ac1c90">_drush_pm_expand_extensions</a>($args, $extension_info);</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;  <span class="comment">// If no extensions are provided, show all.</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;  <span class="keywordflow">if</span> (count($args) == 0) {</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    $args = array_keys($extension_info);</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;  }</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;  <span class="keywordflow">foreach</span> ($args as $extension) {</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    <span class="keywordflow">if</span> (isset($extension_info[$extension])) {</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;      $info = $extension_info[$extension];</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    }</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;      <a class="code" href="group__logging.html#ga47324b65808524558a488916b150dd51">drush_log</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;!extension was not found.&#39;</span>, array(<span class="stringliteral">&#39;!extension&#39;</span> =&gt; $extension)), LogLevel::WARNING);</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;      <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    }</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="includes_2environment_8inc.html#a5536e4ffcf1cdf1f176e15a3aed81af7">drush_extension_get_type</a>($info) == <span class="stringliteral">&#39;module&#39;</span>) {</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;      $data = <a class="code" href="info_8pm_8inc.html#ad8628d53d40f2db788ec0bec2f9ac62e">_drush_pm_info_module</a>($info);</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    }</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;      $data = <a class="code" href="info_8pm_8inc.html#ac066152dd0bc2eed6c7284336aebe62e">_drush_pm_info_theme</a>($info);</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    }</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    $result[$extension] = $data;</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;  }</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;  <span class="keywordflow">return</span> $result;</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;}</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="comment"> * Output format formatter-filter callback.</span></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"> * @see drush_parse_command()</span></div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="comment"> * @see drush_outputformat</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"><a class="code" href="info_8pm_8inc.html#a8b95d41afdfc15b0008ea7390e562091">   49</a></span>&#160;<span class="keyword">function</span> <a class="code" href="info_8pm_8inc.html#a8b95d41afdfc15b0008ea7390e562091">_drush_pm_info_format_table_data</a>($data) {</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;  $result = array();</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;  <span class="keywordflow">foreach</span> ($data as $extension =&gt; $info) {</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    <span class="keywordflow">foreach</span>($info as $key =&gt; $value) {</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;      <span class="keywordflow">if</span> (is_array($value)) {</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        <span class="keywordflow">if</span> (empty($value)) {</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;          $value = <span class="stringliteral">&#39;none&#39;</span>;</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;        }</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;        <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;          $value = implode(<span class="stringliteral">&#39;, &#39;</span>, $value);</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;        }</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;      }</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;      $result[$extension][$key] = $value;</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">return</span> $result;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;}</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="comment"> * Return an array with general info of an extension.</span></div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="code" href="info_8pm_8inc.html#a0bf627d419ca89d4d9e5f0f3a54e457d">   70</a></span>&#160;<span class="keyword">function</span> <a class="code" href="info_8pm_8inc.html#a0bf627d419ca89d4d9e5f0f3a54e457d">_drush_pm_info_extension</a>($info) {</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;  $data[<span class="stringliteral">&#39;extension&#39;</span>] = <a class="code" href="includes_2environment_8inc.html#a317a284967256e1c0452a13462388c21">drush_extension_get_name</a>($info);</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;  $data[<span class="stringliteral">&#39;project&#39;</span>] = isset($info-&gt;info[<span class="stringliteral">&#39;project&#39;</span>])?$info-&gt;info[<span class="stringliteral">&#39;project&#39;</span>]:<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Unknown&#39;</span>);</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;  $data[<span class="stringliteral">&#39;type&#39;</span>] = <a class="code" href="includes_2environment_8inc.html#a5536e4ffcf1cdf1f176e15a3aed81af7">drush_extension_get_type</a>($info);</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;  $data[<span class="stringliteral">&#39;title&#39;</span>] = $info-&gt;info[<span class="stringliteral">&#39;name&#39;</span>];</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;  $data[<span class="stringliteral">&#39;config&#39;</span>] = isset($info-&gt;info[<span class="stringliteral">&#39;configure&#39;</span>]) ? $info-&gt;info[<span class="stringliteral">&#39;configure&#39;</span>] : <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;None&#39;</span>);</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;  $data[<span class="stringliteral">&#39;description&#39;</span>] = $info-&gt;info[<span class="stringliteral">&#39;description&#39;</span>];</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;  $data[<span class="stringliteral">&#39;version&#39;</span>] = $info-&gt;info[<span class="stringliteral">&#39;version&#39;</span>];</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;  $data[<span class="stringliteral">&#39;date&#39;</span>] = isset($info-&gt;info[<span class="stringliteral">&#39;datestamp&#39;</span>]) ? format_date($info-&gt;info[<span class="stringliteral">&#39;datestamp&#39;</span>], <span class="stringliteral">&#39;custom&#39;</span>, <span class="stringliteral">&#39;Y-m-d&#39;</span>) : NULL;</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;  $data[<span class="stringliteral">&#39;package&#39;</span>] = $info-&gt;info[<span class="stringliteral">&#39;package&#39;</span>];</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;  $data[<span class="stringliteral">&#39;core&#39;</span>] = $info-&gt;info[<span class="stringliteral">&#39;core&#39;</span>];</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;  $data[<span class="stringliteral">&#39;php&#39;</span>] = $info-&gt;info[<span class="stringliteral">&#39;php&#39;</span>];</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;  $data[<span class="stringliteral">&#39;status&#39;</span>] = <a class="code" href="group__extensions.html#gad7c908db0c414731d0933c93c4b083ea">drush_get_extension_status</a>($info);</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;  $data[<span class="stringliteral">&#39;path&#39;</span>] = <a class="code" href="includes_2environment_8inc.html#a62a951f395505ed28ea3f0a5a108419c">drush_extension_get_path</a>($info);</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;  <span class="keywordflow">return</span> $data;</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;}</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="comment"> * Return an array with info of a module.</span></div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="code" href="info_8pm_8inc.html#ad8628d53d40f2db788ec0bec2f9ac62e">   91</a></span>&#160;<span class="keyword">function</span> <a class="code" href="info_8pm_8inc.html#ad8628d53d40f2db788ec0bec2f9ac62e">_drush_pm_info_module</a>($info) {</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;  $major_version = <a class="code" href="drupal_8inc.html#ad2ccab77d4bc8e7355186f26cd328ac0">drush_drupal_major_version</a>();</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;  $data = <a class="code" href="info_8pm_8inc.html#a0bf627d419ca89d4d9e5f0f3a54e457d">_drush_pm_info_extension</a>($info);</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;  <span class="keywordflow">if</span> ($info-&gt;schema_version &gt; 0) {</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    $schema_version = $info-&gt;schema_version;</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;  }</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;  elseif ($info-&gt;schema_version == -1) {</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    $schema_version = <span class="stringliteral">&quot;no schema installed&quot;</span>;</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;  }</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;  <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    $schema_version = <span class="stringliteral">&quot;module has no schema&quot;</span>;</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;  $data[<span class="stringliteral">&#39;schema_version&#39;</span>] = $schema_version;</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;  <span class="keywordflow">if</span> ($major_version == 7) {</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    $data[<span class="stringliteral">&#39;files&#39;</span>] = $info-&gt;info[<span class="stringliteral">&#39;files&#39;</span>];</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;  }</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;  $data[<span class="stringliteral">&#39;requires&#39;</span>] = $info-&gt;info[<span class="stringliteral">&#39;dependencies&#39;</span>];</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;  <span class="keywordflow">if</span> ($major_version == 6) {</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    $requiredby = $info-&gt;info[<span class="stringliteral">&#39;dependents&#39;</span>];</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;  }</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;  <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    $requiredby = array_keys($info-&gt;required_by);</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;  }</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;  $data[<span class="stringliteral">&#39;required_by&#39;</span>] = $requiredby;</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;  <span class="keywordflow">if</span> ($info-&gt;status == 1) {</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    $role = drush_role_get_class();</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    $data[<span class="stringliteral">&#39;permissions&#39;</span>] = $role-&gt;getModulePerms(<a class="code" href="includes_2environment_8inc.html#a317a284967256e1c0452a13462388c21">drush_extension_get_name</a>($info));</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;  }</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;  <span class="keywordflow">return</span> $data;</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;}</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;<span class="comment"> * Return an array with info of a theme.</span></div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="code" href="info_8pm_8inc.html#ac066152dd0bc2eed6c7284336aebe62e">  127</a></span>&#160;<span class="keyword">function</span> <a class="code" href="info_8pm_8inc.html#ac066152dd0bc2eed6c7284336aebe62e">_drush_pm_info_theme</a>($info) {</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;  $major_version = <a class="code" href="drupal_8inc.html#ad2ccab77d4bc8e7355186f26cd328ac0">drush_drupal_major_version</a>();</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;  $data = <a class="code" href="info_8pm_8inc.html#a0bf627d419ca89d4d9e5f0f3a54e457d">_drush_pm_info_extension</a>($info);</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;  $data[<span class="stringliteral">&#39;core&#39;</span>] = $info-&gt;info[<span class="stringliteral">&#39;core&#39;</span>];</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;  $data[<span class="stringliteral">&#39;php&#39;</span>] = $info-&gt;info[<span class="stringliteral">&#39;php&#39;</span>];</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;  $data[<span class="stringliteral">&#39;engine&#39;</span>] = $info-&gt;info[<span class="stringliteral">&#39;engine&#39;</span>];</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;  $data[<span class="stringliteral">&#39;base_theme&#39;</span>] = isset($info-&gt;base_themes) ? implode($info-&gt;base_themes, <span class="stringliteral">&#39;, &#39;</span>) : <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;  $regions = $info-&gt;info[<span class="stringliteral">&#39;regions&#39;</span>];</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;  $data[<span class="stringliteral">&#39;regions&#39;</span>] = $regions;</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;  $features = $info-&gt;info[<span class="stringliteral">&#39;features&#39;</span>];</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;  $data[<span class="stringliteral">&#39;features&#39;</span>] = $features;</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;  <span class="keywordflow">if</span> (count($info-&gt;info[<span class="stringliteral">&#39;stylesheets&#39;</span>]) &gt; 0) {</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    $data[<span class="stringliteral">&#39;stylesheets&#39;</span>] = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    <span class="keywordflow">foreach</span> ($info-&gt;info[<span class="stringliteral">&#39;stylesheets&#39;</span>] as $media =&gt; $files) {</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;      $files = array_keys($files);</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;      $data[<span class="stringliteral">&#39;media &#39;</span>.$media] = $files;</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    }</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;  }</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;  <span class="keywordflow">if</span> (count($info-&gt;info[<span class="stringliteral">&#39;scripts&#39;</span>]) &gt; 0) {</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;    $scripts = array_keys($info-&gt;info[<span class="stringliteral">&#39;scripts&#39;</span>]);</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    $data[<span class="stringliteral">&#39;scripts&#39;</span>] = $scripts;</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;  }</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;  <span class="keywordflow">return</span> $data;</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</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:56 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>