snipt

Ctrl+h for KB shortcuts

Bash

Switch maintenance mode ON / OFF with Drush

1
2
3
4
5
# Switch maintenance mode OFF
drush vset maintenance_mode 0

# Switch maintenance mode ON
drush vset maintenance_mode 1
https://snipt.net/embed/af518d02dd5759e199b79f287f7f4ae3/
https://snipt.net/raw/af518d02dd5759e199b79f287f7f4ae3/
af518d02dd5759e199b79f287f7f4ae3
bash
Bash
5
2016-09-25T22:35:13
True
False
False
Jan 23, 2013 at 10:29 AM
/api/public/snipt/54309/
switch-maintenance-mode-on-off-with-drush
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="c"># Switch maintenance mode OFF</span> </span><span id="L-2"><a name="L-2"></a>drush vset maintenance_mode 0 </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="c"># Switch maintenance mode ON</span> </span><span id="L-5"><a name="L-5"></a>drush vset maintenance_mode 1 </span></pre></div> </td></tr></table>
"drupal 7", drush, maintenance, mode, off, on, switch

PHP

if else cascade alternative - switch hack

1
2
3
4
5
<?php
switch (true) {
  case test1==test2: ... break;
  case x1 > 14: ... break;
}
https://snipt.net/embed/5aca48442003c24db971af7e0bb5b3ac/
https://snipt.net/raw/5aca48442003c24db971af7e0bb5b3ac/
5aca48442003c24db971af7e0bb5b3ac
php
PHP
5
2016-09-26T20:39:11
True
False
False
/api/public/snipt/34713/
if-else-cascade-alternative-switch-hack
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a><span class="k">switch</span> <span class="p">(</span><span class="k">true</span><span class="p">)</span> <span class="p">{</span> </span><span id="L-3"><a name="L-3"></a> <span class="k">case</span> <span class="nx">test1</span><span class="o">==</span><span class="nx">test2</span><span class="o">:</span> <span class="o">...</span> <span class="k">break</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a> <span class="k">case</span> <span class="nx">x1</span> <span class="o">&gt;</span> <span class="mi">14</span><span class="o">:</span> <span class="o">...</span> <span class="k">break</span><span class="p">;</span> </span><span id="L-5"><a name="L-5"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
cascade, else, if, ifelse, switch
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.