snipt

Ctrl+h for KB shortcuts

PHP

icdsoft create rails project from php script

1
2
3
4
<?php
putenv("HOME=/home/$user");
system("rails project_name 2>&1");
?>
https://snipt.net/embed/4fca390133c45f593726a0d876309ef8/
/raw/4fca390133c45f593726a0d876309ef8/
4fca390133c45f593726a0d876309ef8
php
PHP
4
2019-08-24T09:24:22
True
False
False
/api/public/snipt/4979/
icdsoft-create-rails-project-from-php-script
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><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="nb">putenv</span><span class="p">(</span><span class="s2">&quot;HOME=/home/</span><span class="si">$user</span><span class="s2">&quot;</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a><span class="nb">system</span><span class="p">(</span><span class="s2">&quot;rails project_name 2&gt;&amp;1&quot;</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
php, rails