Drush: Drush\CommandFiles\core\StateCommands Class Reference

Public Member Functions

 get ($key, $options=['format'=> 'string', 'fields'=> ''])
 set ($key, $value, $options=['input-format'=> 'auto', 'value'=> NULL])
 delete ($key)

Detailed Description

Definition at line 7 of file StateCommands.php.

Member Function Documentation

Delete a state entry.

state-delete

DRUSH_BOOTSTRAP_DRUPAL_FULL

Parameters
string$keyThe state key, for example "system.cron_last". drush state-del system.cron_last Delete state entry for system.cron_last. sdel
Returns
void

Definition at line 82 of file StateCommands.php.

Drush\CommandFiles\core\StateCommands::get (   $key,
  $options = ['format' =,
'string'  ,
'fields'  ,
'']   
)

Display a state value.

state-get

DRUSH_BOOTSTRAP_DRUPAL_FULL

Parameters
string$keyThe key name. drush state-get system.cron_last Displays last cron run timestamp sget
Returns

Definition at line 22 of file StateCommands.php.

References Drush\CommandFiles\core\StateCommands\get().

Referenced by Drush\CommandFiles\core\StateCommands\get().

Here is the call graph for this function:

Here is the caller graph for this function:

Drush\CommandFiles\core\StateCommands::set (   $key,
  $value,
  $options = ['input-format' =,
'auto'  ,
'value'  ,
NULL]   
)

Set a state value.

state-set

DRUSH_BOOTSTRAP_DRUPAL_FULL

Parameters
string$keyThe state key, for example: system.cron_last.
mixed$valueThe value to assign to the state key. Use '-' to read from STDIN. input-format Type for the value. Defaults to 'auto'. Other recognized values: string, integer float, boolean, json, yaml. value For internal use only. -option value drush state-set system.cron_last 1406682882 –input-format=integer Sets a timestamp for last cron run. php -r "print json_encode(array(\'drupal\', \'simpletest\'));" | drush state-set –input-format=json foo.name - Set a key to a complex value (e.g. array) sset
Returns
void

Definition at line 46 of file StateCommands.php.

References dt().

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_1StateCommands.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\StateCommands 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_1StateCommands.html">StateCommands</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classDrush_1_1CommandFiles_1_1core_1_1StateCommands-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Drush\CommandFiles\core\StateCommands 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:a5d78388376f7a32ee52c5de2cc56d716"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDrush_1_1CommandFiles_1_1core_1_1StateCommands.html#a5d78388376f7a32ee52c5de2cc56d716">get</a> ($key, $options=['format'=&gt; 'string', 'fields'=&gt; ''])</td></tr>
<tr class="memitem:aeca1d15d62c7f550a658a9fa3d66ec3b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDrush_1_1CommandFiles_1_1core_1_1StateCommands.html#aeca1d15d62c7f550a658a9fa3d66ec3b">set</a> ($key, $value, $options=['input-format'=&gt; 'auto', 'value'=&gt; NULL])</td></tr>
<tr class="memitem:abf5813312e2d8838107604d805aade5f"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDrush_1_1CommandFiles_1_1core_1_1StateCommands.html#abf5813312e2d8838107604d805aade5f">delete</a> ($key)</td></tr>
</table>
<a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock">
<p>Definition at line <a class="el" href="StateCommands_8php_source.html#l00007">7</a> of file <a class="el" href="StateCommands_8php_source.html">StateCommands.php</a>.</p>
</div><h2>Member Function Documentation</h2>
<a class="anchor" id="abf5813312e2d8838107604d805aade5f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Drush\CommandFiles\core\StateCommands::delete </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$key</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Delete a state entry.</p>
<p>state-delete</p>
<p>DRUSH_BOOTSTRAP_DRUPAL_FULL </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramtype">string</td><td class="paramname">$key</td><td>The state key, for example "system.cron_last".  drush state-del system.cron_last Delete state entry for system.cron_last.  sdel</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>

<p>Definition at line <a class="el" href="StateCommands_8php_source.html#l00082">82</a> of file <a class="el" href="StateCommands_8php_source.html">StateCommands.php</a>.</p>

</div>
</div>
<a class="anchor" id="a5d78388376f7a32ee52c5de2cc56d716"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Drush\CommandFiles\core\StateCommands::get </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$options</em> = <code>['format'&#160;=</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">'string'&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">'fields'&#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>Display a state value.</p>
<p>state-get</p>
<p>DRUSH_BOOTSTRAP_DRUPAL_FULL </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramtype">string</td><td class="paramname">$key</td><td>The key name.  drush state-get system.cron_last Displays last cron run timestamp  sget</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd></dd></dl>

<p>Definition at line <a class="el" href="StateCommands_8php_source.html#l00022">22</a> of file <a class="el" href="StateCommands_8php_source.html">StateCommands.php</a>.</p>

<p>References <a class="el" href="StateCommands_8php_source.html#l00022">Drush\CommandFiles\core\StateCommands\get()</a>.</p>

<p>Referenced by <a class="el" href="StateCommands_8php_source.html#l00022">Drush\CommandFiles\core\StateCommands\get()</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_1StateCommands_a5d78388376f7a32ee52c5de2cc56d716_cgraph.png" border="0" usemap="#classDrush_1_1CommandFiles_1_1core_1_1StateCommands_a5d78388376f7a32ee52c5de2cc56d716_cgraph" alt=""/></div>
</div>
</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_1StateCommands_a5d78388376f7a32ee52c5de2cc56d716_icgraph.png" border="0" usemap="#classDrush_1_1CommandFiles_1_1core_1_1StateCommands_a5d78388376f7a32ee52c5de2cc56d716_icgraph" alt=""/></div>
</div>
</p>

</div>
</div>
<a class="anchor" id="aeca1d15d62c7f550a658a9fa3d66ec3b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Drush\CommandFiles\core\StateCommands::set </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$options</em> = <code>['input-format'&#160;=</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">'auto'&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">'value'&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">NULL]&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set a state value.</p>
<p>state-set</p>
<p>DRUSH_BOOTSTRAP_DRUPAL_FULL </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramtype">string</td><td class="paramname">$key</td><td>The state key, for example: system.cron_last. </td></tr>
    <tr><td class="paramtype">mixed</td><td class="paramname">$value</td><td>The value to assign to the state key. Use '-' to read from STDIN.  input-format Type for the value. Defaults to 'auto'. Other recognized values: string, integer float, boolean, json, yaml.  value For internal use only. -option value  drush state-set system.cron_last 1406682882 &ndash;input-format=integer Sets a timestamp for last cron run.  php -r "print json_encode(array(\'drupal\', \'simpletest\'));" | drush state-set &ndash;input-format=json foo.name - Set a key to a complex value (e.g. array)  sset</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>

<p>Definition at line <a class="el" href="StateCommands_8php_source.html#l00046">46</a> of file <a class="el" href="StateCommands_8php_source.html">StateCommands.php</a>.</p>

<p>References <a class="el" href="output_8inc_source.html#l00149">dt()</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_1StateCommands_aeca1d15d62c7f550a658a9fa3d66ec3b_cgraph.png" border="0" usemap="#classDrush_1_1CommandFiles_1_1core_1_1StateCommands_aeca1d15d62c7f550a658a9fa3d66ec3b_cgraph" alt=""/></div>
<map name="classDrush_1_1CommandFiles_1_1core_1_1StateCommands_aeca1d15d62c7f550a658a9fa3d66ec3b_cgraph" id="classDrush_1_1CommandFiles_1_1core_1_1StateCommands_aeca1d15d62c7f550a658a9fa3d66ec3b_cgraph">
<area shape="rect" id="node3" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96" title="dt" alt="" coords="231,63,268,92"/><area shape="rect" id="node5" href="drupal_8inc.html#ad2ccab77d4bc8e7355186f26cd328ac0" title="drush_drupal_major\l_version" alt="" coords="320,23,453,70"/><area shape="rect" id="node17" href="group__outputfunctions.html#ga2391425402626377e6464f1f649f8c65" title="find_legacy_dt_args" alt="" coords="317,93,456,123"/><area shape="rect" id="node7" href="drupal_8inc.html#a203e989fd043d054d774954e2b2dff21" title="drush_drupal_version" alt="" coords="505,32,649,61"/><area shape="rect" id="node9" href="classDrush.html#a104f09419bc8a46c4bf205b49268b3a4" title="Drush\\bootstrapManager" alt="" coords="699,5,864,35"/><area shape="rect" id="node15" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5" title="drush_get_context" alt="" coords="717,59,845,88"/><area shape="rect" id="node11" href="classDrush.html#a83560a0aab97e348848b3615f152af54" title="Drush\\service" alt="" coords="913,5,1015,35"/><area shape="rect" id="node13" href="classDrush.html#abce7035069a9f7517f908b82bdd4dae0" title="Drush\\getContainer" alt="" coords="1065,5,1199,35"/></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="StateCommands_8php_source.html">StateCommands.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>