<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>php sublimetext on random thoughts</title><link>https://awesomeprogrammer.com/categories/php-sublimetext/</link><description>Recent content in php sublimetext on random thoughts</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Mon, 05 Nov 2012 00:00:00 +0000</lastBuildDate><atom:link href="https://awesomeprogrammer.com/categories/php-sublimetext/index.xml" rel="self" type="application/rss+xml"/><item><title>Create build system for PHP under Sublime Text 2</title><link>https://awesomeprogrammer.com/blog/2012/11/05/create-build-system-for-php-under-sublime-text-2/</link><pubDate>Mon, 05 Nov 2012 00:00:00 +0000</pubDate><guid>https://awesomeprogrammer.com/blog/2012/11/05/create-build-system-for-php-under-sublime-text-2/</guid><description><![CDATA[<p>Lately I&rsquo;ve been working quite a lot with unit test using <a href="http://www.simpletest.org/">SimpleTest</a> - so I often had to run scripts directly from command line. But wouldn&rsquo;t it be cool if I just could write a test and run it directly under my code editor without even leaving it? And if you using <a href="http://www.sublimetext.com">Sublime Text 2</a> (and I really recommend checking it out - it&rsquo;s gorgeous, it&rsquo;s slim, it&rsquo;s ultra fast and you can do basically everything with it) - you easily can.</p>
<p>How to do it: from main menu choose: <strong>Tools</strong> -&gt; <strong>Build System</strong> -&gt; <strong>New Build System</strong>, new tab should pop up, now paste:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&#34;cmd&#34;</span>: [<span style="color:#e6db74">&#34;php&#34;</span>, <span style="color:#e6db74">&#34;$file&#34;</span>],
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&#34;selector&#34;</span>: <span style="color:#e6db74">&#34;source.php&#34;</span>
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>Here&rsquo;s quick explanation: it will run command <code>php</code> (I assume it&rsquo;s available globally from your system) and pass full path for currently opened file as an argument. <em>Selector</em> on the other hand is useful when you have setup your build system as <em>automatic</em> - it will just choose your new build when you are working with php files.</p>
<p>Now save it in your <em>User</em> directory (I recommend creating subdirectory called <em>build</em>) as <em>php.sublime-build</em>. Open some php file that can be run from command line, hit <em>CTRL+B</em> (default shortcut) and enjoy ;).</p>]]></description><content:encoded><![CDATA[<p>Lately I&rsquo;ve been working quite a lot with unit test using <a href="http://www.simpletest.org/">SimpleTest</a> - so I often had to run scripts directly from command line. But wouldn&rsquo;t it be cool if I just could write a test and run it directly under my code editor without even leaving it? And if you using <a href="http://www.sublimetext.com">Sublime Text 2</a> (and I really recommend checking it out - it&rsquo;s gorgeous, it&rsquo;s slim, it&rsquo;s ultra fast and you can do basically everything with it) - you easily can.</p>
<p>How to do it: from main menu choose: <strong>Tools</strong> -&gt; <strong>Build System</strong> -&gt; <strong>New Build System</strong>, new tab should pop up, now paste:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&#34;cmd&#34;</span>: [<span style="color:#e6db74">&#34;php&#34;</span>, <span style="color:#e6db74">&#34;$file&#34;</span>],
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&#34;selector&#34;</span>: <span style="color:#e6db74">&#34;source.php&#34;</span>
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>Here&rsquo;s quick explanation: it will run command <code>php</code> (I assume it&rsquo;s available globally from your system) and pass full path for currently opened file as an argument. <em>Selector</em> on the other hand is useful when you have setup your build system as <em>automatic</em> - it will just choose your new build when you are working with php files.</p>
<p>Now save it in your <em>User</em> directory (I recommend creating subdirectory called <em>build</em>) as <em>php.sublime-build</em>. Open some php file that can be run from command line, hit <em>CTRL+B</em> (default shortcut) and enjoy ;).</p>]]></content:encoded></item></channel></rss>