{"id":53661,"date":"2021-10-20T03:01:59","date_gmt":"2021-10-19T17:01:59","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=53661"},"modified":"2021-10-19T18:16:33","modified_gmt":"2021-10-19T08:16:33","slug":"php-file-write-debugging-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-file-write-debugging-primer-tutorial\/","title":{"rendered":"PHP File Write Debugging Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/PHP\/australia_place_crowfly_distances.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"PHP File Write Debugging Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/php_web-server_file_based_debugging.gif\" title=\"PHP File Write Debugging Primer Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">PHP File Write Debugging Primer Tutorial<\/p><\/div>\n<p>Looking at <a title='PHPStorm and Xdebug Primer Tutorial' href='#phpsxpt'>PHPStorm and Xdebug Primer Tutorial<\/a> below reminds us that PHP can be debugged in that &#8220;step through the code&#8221; way that is sometimes useful.  The work of yesterday&#8217;s <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/australian-postcode-place-images-state-precedence-tutorial\/' title='Australian Postcode Place Images State Precedence Tutorial'>Australian Postcode Place Images State Precedence Tutorial<\/a> caused us to think about PHP debugging regarding a scenario &#8230;<\/p>\n<ul>\n<li>that occurred sporadically (ie. data based issue, or at least our interfacing to that data <font size=1>(&#8220;a bad carpenter blames his tools&#8221;)<\/font>) &#8230; and presented in one of the most cryptic ways possible <font size=1>(&#8220;a programmer&#8217;s nightmare&#8221;)<\/font>) &#8230;<\/li>\n<li>symptom, on these sporadic occasions and running in Safari web browser, its (Develop -&gt; Show Web Inspector) Web Inspector &#8220;Console&#8221; tab shows (a last) error &#8230;<br \/>\n<code><br \/>\nSyntaxError: Unexpected token ';' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fgc:1<br \/>\n<\/code><br \/>\n &#8230; before not displaying the Wikipedia images\n<\/ul>\n<p>Optimistic programmers will be thrown by &#8230; <a target=_blank title='?' href='https:\/\/www.youtube.com\/watch?v=uhiCFdWeQfA'>anyone, anyone<\/a>?  Yes, <a target=_blank href='https:\/\/en.wikipedia.org\/wiki\/Gottfried_Wilhelm_Leibniz' title='?'>Gottfried<\/a>, the &#8220;1&#8221; <b>is<\/b> supremely disappointing.  A &#8220;real&#8221; codeline &#8220;1&#8221; is very unlikely, though can happen as a result of &#8220;eval&#8221; in Javascript code.  <font size=1>(Spoiler alert: can happen in a continuous line of Javascript written out in that fashion by PHP).<\/font>  In our defence, even if we had immediately tweaked to &#8220;can happen in a continuous line of Javascript written out in that fashion by PHP&#8221; that would not have helped enormously.<\/p>\n<p>But what did we know?  We saw a pattern of this error regarding our &#8220;fgc&#8221; directory index.php PHP calling &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\nfunction relative_to_absolute($inth, $firstonly) {<br \/>\n \/\/ lots of code follows<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p> &#8230; but it resulted in &#8230;<\/p>\n<ul>\n<li>no Wikipedia images shown but no malfunctioning of the resultant webpage, otherwise &#8230; and &#8230;<\/li>\n<li>calling PHP debugging could not determine for us whether the problem occurred &#8230;\n<ol>\n<li>within relative_to_absolute function &#8230; or &#8230;<\/li>\n<li>as a result of the return values as a result of executing relative_to_absolute function<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<p>And here&#8217;s the thing for today&#8217;s relevance.  We decided not to involve any third party tools to debug the PHP.  We decided to use a &#8220;PHP File Write Debugging Approach&#8221; a little bit like Javascript debugging can be achieved by &#8220;console.log&#8221; (or maybe &#8220;alert&#8221;) messages directed to the user.<\/p>\n<p>Where did we intervene?  In and around &#8220;fgc&#8221; PHP calls of &#8220;relative_to_absolute&#8221;.<\/p>\n<p>And how did we intervene?  Well, here, for the first time we can recall, we wrote a (temporarily used) PHP &#8220;debugging&#8221; function of the (wrapper to file_put_contents) fashion &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n$dcount=0;<br \/>\n<br \/>\nfunction debugfile_put_contents($infn, $inct) {<br \/>\n  global $dcount;<br \/>\n  \/\/ if you want to leave this function in later after debugging, along with its calling codelines, make this codeline be \"return;\"<br \/>\n  if ($inct == \"\") {<br \/>\n    $dcount=0;<br \/>\n    while (file_exists('' . $dcount . '_junk.txt')) {<br \/>\n      unlink('' . $dcount . '_junk.txt');<br \/>\n      $dcount++;<br \/>\n    }<br \/>\n    $dcount=0;<br \/>\n    file_put_contents('' . $dcount . '_junk.txt', \"\");<br \/>\n  } else {<br \/>\n    file_put_contents($infn, $inct);<br \/>\n    file_put_contents('' . $dcount . '_junk.txt', $infn . ': ' . $inct);<br \/>\n    $dcount++;<br \/>\n  }<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p> &#8230; where up the top of &#8220;relative_to_absolute&#8221; <font color=blue>we&#8217;d place<\/font> &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\nfunction relative_to_absolute($inth, $firstonly) {<br \/>\n    global $udirname, $latis, $longis, $countryname, $countrycode, $bp, $pbbm, $wikiall, $oneis, $ithree;<br \/>\n    <font color=blue>debugfile_put_contents(\"junJUNKket7.txt\", \"\");<\/font><br \/>\n \/\/ lots more code follows<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p> &#8230; to &#8220;clean the slate&#8221;, so to speak, for each call of &#8220;relative_to_absolute&#8221;, and then at &#8220;interest points&#8221; <font color=purple>codelines like<\/font> &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n$bp=\"\";<br \/>\n<br \/>\nfunction relative_to_absolute($inth, $firstonly) {<br \/>\n    global $udirname, $latis, $longis, $countryname, $countrycode, $bp, $pbbm, $wikiall, $oneis, $ithree;<br \/>\n    <font color=blue>debugfile_put_contents(\"junJUNKket7.txt\", \"\");<\/font><br \/>\n \/\/ lots more code follows ... then at that \"finally arrived at \"interest point\" that happened to be at the end of the code of this function, it pans out ...<br \/>\n<font color=purple>debugfile_put_contents(\"junket6p.txt\", $outth);<\/font><br \/>\n      if (!$firstonly) {<br \/>\n<font color=purple>debugfile_put_contents(\"junket6pa.txt\", $outth);<\/font><br \/>\n        if ($bp != \"\") {<br \/>\n<font color=purple>debugfile_put_contents(\"junket6pb.txt\", $outth);<\/font><br \/>\n          $bp.=\"\\\";\";<br \/>\n<font color=purple>debugfile_put_contents(\"junket6pc.txt\", $bp);<\/font><br \/>\n        } else {<br \/>\n<font color=purple>debugfile_put_contents(\"junket6pd.txt\", $outth);<\/font><br \/>\n          $bp=\" parent.document.getElementById(\\\"ourcanvas\\\").setAttribute(\\\"data-geo\\\",\\\"\\\");   parent.document.getElementById(\\\"ourcanvas\\\").style.background=\\\"\\\";\";<br \/>\n<font color=purple>debugfile_put_contents(\"junket6pe.txt\", $outth);<\/font><br \/>\n        }<br \/>\n<font color=purple>debugfile_put_contents(\"junket6pf.txt\", $outth);<\/font><br \/>\n        <font color=brown>$bp=str_replace('\";,', ',', $bp);<\/font><br \/>\n        return $outh;<br \/>\n      }<br \/>\n<font color=purple>debugfile_put_contents(\"junket6q.txt\", $outth);<\/font><br \/>\n    }<br \/>\n    } catch (Exception $wuy) { }<br \/>\n<font color=purple>debugfile_put_contents(\"junket6r.txt\", $outth);<\/font><br \/>\n    if ($wikiall) { return str_replace(\"https:\/\/\", \"\/\/\", str_replace(\"http:\/\/\", \"\/\/\", str_replace(\"<a \", \"<a target=_blank \", str_replace(\"\n\n<form \", \"\n\n<form target=_blank \", $outth)))); } \n<font color=purple>debugfile_put_contents(\"junket6s.txt\", $outth);<\/font><br \/>\n    return $outth;<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p> &#8230; the debugging results getting us to add in the <font color=brown>&#8220;winning new codeline&#8221;<\/font>, as shown above, to solve our dilemma, given our &#8220;findings reporting regime&#8221; shown (via macOS Terminal) below &#8230;<\/p>\n<p><code><br \/>\nuser@Users-MacBook-Air htdocs % ls -lct PHP\/fgc\/*.* | more<br \/>\n-rw-r--r--  1 user  admin  96697 18 Oct 18:25 PHP\/fgc\/99_junk.txt<br \/>\n-rw-r--r--  1 user  admin  96682 18 Oct 18:25 PHP\/fgc\/junket6pf.txt<br \/>\n-rw-r--r--  1 user  admin    321 18 Oct 18:25 PHP\/fgc\/98_junk.txt<br \/>\n-rw-r--r--  1 user  admin    306 18 Oct 18:25 PHP\/fgc\/junket6pc.txt<br \/>\n-rw-r--r--  1 user  admin  96697 18 Oct 18:25 PHP\/fgc\/97_junk.txt<br \/>\n-rw-r--r--  1 user  admin  96682 18 Oct 18:25 PHP\/fgc\/junket6pb.txt<br \/>\n-rw-r--r--  1 user  admin  96697 18 Oct 18:25 PHP\/fgc\/96_junk.txt<br \/>\n-rw-r--r--  1 user  admin  96682 18 Oct 18:25 PHP\/fgc\/junket6pa.txt<br \/>\n-rw-r--r--  1 user  admin  96696 18 Oct 18:25 PHP\/fgc\/95_junk.txt<br \/>\n-rw-r--r--  1 user  admin  96682 18 Oct 18:25 PHP\/fgc\/junket6p.txt<br \/>\n-rw-r--r--  1 user  admin  96696 18 Oct 18:25 PHP\/fgc\/94_junk.txt<br \/>\n-rw-r--r--  1 user  admin  96682 18 Oct 18:25 PHP\/fgc\/junket6f.txt<br \/>\n-rw-r--r--  1 user  admin  96697 18 Oct 18:25 PHP\/fgc\/93_junk.txt<br \/>\n-rw-r--r--  1 user  admin  96682 18 Oct 18:25 PHP\/fgc\/junket6ff.txt<br \/>\n-rw-r--r--  1 user  admin  96696 18 Oct 18:25 PHP\/fgc\/92_junk.txt<br \/>\n-rw-r--r--  1 user  admin  96682 18 Oct 18:25 PHP\/fgc\/junket6d.txt<br \/>\n-rw-r--r--  1 user  admin  96696 18 Oct 18:25 PHP\/fgc\/91_junk.txt<br \/>\n-rw-r--r--  1 user  admin  96682 18 Oct 18:25 PHP\/fgc\/junket6c.txt<br \/>\n-rw-r--r--  1 user  admin  96696 18 Oct 18:25 PHP\/fgc\/90_junk.txt<br \/>\n-rw-r--r--  1 user  admin  96682 18 Oct 18:25 PHP\/fgc\/junket6b.txt<br \/>\n-rw-r--r--  1 user  admin  96696 18 Oct 18:25 PHP\/fgc\/89_junk.txt<br \/>\n-rw-r--r--  1 user  admin  96682 18 Oct 18:25 PHP\/fgc\/junket6a.txt<br \/>\n-rw-r--r--  1 user  admin  96695 18 Oct 18:25 PHP\/fgc\/88_junk.txt<br \/>\n-rw-r--r--  1 user  admin  96682 18 Oct 18:25 PHP\/fgc\/junket6.txt<br \/>\n-rw-r--r--  1 user  admin     66 18 Oct 18:25 PHP\/fgc\/87_junk.txt<br \/>\n-rw-r--r--  1 user  admin     52 18 Oct 18:25 PHP\/fgc\/junket2b.txt<br \/>\n-rw-r--r--  1 user  admin     66 18 Oct 18:25 PHP\/fgc\/86_junk.txt<br \/>\n-rw-r--r--  1 user  admin     52 18 Oct 18:25 PHP\/fgc\/junket2a.txt<br \/>\n-rw-r--r--  1 user  admin  96696 18 Oct 18:25 PHP\/fgc\/85_junk.txt<br \/>\n-rw-r--r--  1 user  admin  96697 18 Oct 18:25 PHP\/fgc\/84_junk.txt<br \/>\n-rw-r--r--  1 user  admin  96696 18 Oct 18:25 PHP\/fgc\/83_junk.txt<br \/>\n-rw-r--r--  1 user  admin  96696 18 Oct 18:25 PHP\/fgc\/82_junk.txt<br \/>\n-rw-r--r--  1 user  admin  96696 18 Oct 18:25 PHP\/fgc\/81_junk.txt<br \/>\n-rw-r--r--  1 user  admin  96696 18 Oct 18:25 PHP\/fgc\/80_junk.txt<br \/>\n-rw-r--r--  1 user  admin  96695 18 Oct 18:25 PHP\/fgc\/79_junk.txt<br \/>\n-rw-r--r--  1 user  admin     66 18 Oct 18:25 PHP\/fgc\/78_junk.txt<br \/>\n-rw-r--r--  1 user  admin     66 18 Oct 18:25 PHP\/fgc\/77_junk.txt<br \/>\n-rw-r--r--  1 user  admin     66 18 Oct 18:25 PHP\/fgc\/76_junk.txt<br \/>\n-rw-r--r--  1 user  admin  96696 18 Oct 18:25 PHP\/fgc\/75_junk.txt<br \/>\nuser@Users-MacBook-Air htdocs % cat  PHP\/fgc\/98_junk.txt<br \/>\njunket6pc.txt:  parent.document.getElementById(\"ourcanvas\").setAttribute(\"data-geo\",\"\");   parent.document.getElementById(\"ourcanvas\").style.backgroundPosition=\"left top,center top,right top,right center<font color=olive>\";,<\/font>left top,center top,right top,right center,right bottom,center bottom,left bottom,left center,left top,center top\";%                                               user@Users-MacBook-Air htdocs % head -5  PHP\/fgc\/99_junk.txt<br \/>\njunket6pf.txt: &lt;!DOCTYPE html&gt;<br \/>\n&lt;html class=\"client-nojs\" lang=\"en\" dir=\"ltr\"&gt;<br \/>\n&lt;head&gt;<br \/>\n&lt;meta charset=\"UTF-8\"\/&gt;<br \/>\n&lt;title&gt;Lawson, New South Wales - Wikipedia&lt;\/title&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; the <font color=olive>gadzooks<\/font> finding, above, tweaking with us that the PHP, with certain incoming data, could fail with its writing out of the Javascript DOM backgroundPosition code.   Aaaaahhh, that all figures!<\/p>\n<p><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/php_web-server_file_based_debugging.gif\" title=\"Tutorial picture\">Cute, huh?!<\/a><\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/php-file-write-debugging-primer-tutorial\/'>PHP File Write Debugging Primer Tutorial<\/a>.<\/p-->\n<hr>\n<p id='phpsxpt'>Previous relevant <a target=_blank title='PHPStorm and Xdebug Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/phpstorm-and-xdebug-primer-tutorial\/'>PHPStorm and Xdebug Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/PHPStorm\/Xdebug\/\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"PHPStorm and Xdebug Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/PHPStorm\/Xdebug\/phpstorm_xdebug-84of.jpg\" title=\"PHPStorm and Xdebug Primer Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">PHPStorm and Xdebug Primer Tutorial<\/p><\/div>\n<p>Though with a large variety of scenarios with code, you can debug a piece of code from the command line &#8230; and don&#8217;t get me wrong because sometimes the command line will be the only way &#8230; the experience of debugging is much better if it is combined with work within an IDE.<\/p>\n<p>In this scenario, what about debugging PHP?  We&#8217;ve been trying out PHPStorm, we talked about at <a target=_blank title='PHPStorm IDE Primer Tutorial' href='#pipt'>PHPStorm IDE Primer Tutorial<\/a>, as shown below, overseeing PHP projects and using the Xdebug debugger.<\/p>\n<p>Roughly speaking, what is required here is, via the <a target=_blank title='Xdebog configiration for PHPStorm information from JetBrains' href='https:\/\/www.jetbrains.com\/phpstorm\/help\/configuring-xdebug.html'>Xdebug Configuration<\/a> advice from JetBrains, the inventors of PHPStorm &#8230;<\/p>\n<ul>\n<li>If Xdebug is not installed, an Xdebug install would be required &#8230; and then &#8230;<\/li>\n<li>PHPStorm Preferences -&gt; Languages and Frameworks -&gt; PHP -&gt; &#8220;&#8230;&#8221; Button gives you both &#8230;\n<ol>\n<li>Location of relevant php.ini (which you&#8217;ll probably change) &#8230; and &#8230;<\/li>\n<li>Xdebug (or other debugger) existance status (to tell you if you are getting anywhere)<\/li>\n<\/ol>\n<li>Changes to that php.ini (of above) with, in our case, lots of stops and starts of our local MAMP Apache web server (to see those changes right)<\/li>\n<\/li>\n<\/ul>\n<p>Cutting to the chase what we found could work with our php.ini (after dismantling any pre-existing [zend] section blockages (though we didn&#8217;t have this)) was &#8230;<\/p>\n<p><code><br \/>\n[xdebug]<br \/>\nzend_extension=\"\/Applications\/MAMP\/bin\/php\/php5.4.10\/lib\/php\/extensions\/no-debug-non-zts-20100525\/xdebug.so\"<br \/>\n;zend_extension=\"\/usr\/lib\/php\/extensions\/no-debug-non-zts-20121212\/xdebug.so\"<br \/>\nxdebug.remote_enable=1<br \/>\nxdebug.remote_autostart=1<br \/>\nxdebug.remote_port=9123<br \/>\nxdebug.remote_host=\"127.0.0.1\"<br \/>\nxdebug.remote_handler=\"dbgp\"<br \/>\nxdebug.remote_mode=\"req\"<br \/>\nxdebug.remote_connect_back=0<br \/>\nxdebug.profiler_enable=1<br \/>\nxdebug.profiler_output_dir=\"\/Library\/pgAgent\/Downloads\/ansible-deployment\/tmp\"<br \/>\n<\/code><\/p>\n<p> &#8230; and we have to thank <a target=_blank title='Useful link' href='http:\/\/stackoverflow.com\/questions\/17736304\/enabling-xdebug-remote-debug-makes-apache-server-very-slow'>this link<\/a>, in particular, among many from the Open Source community, which helped &#8230; thanks.  Perhaps the most contentious configuration above is <i>xdebug.remote_autostart=1<\/i> which can cause extreme slowness on occasions &#8230; if that is the way for you you may want to make it <i>xdebug.remote_autostart=0<\/i> to not have the connection between Xdebug and PHP be checked so often.  And the paths shown were specifically suited only here, we hasten to add &#8230; <strike>dough<\/strike> doh!<\/p>\n<p>Other traps for young players could be &#8230;<\/p>\n<ul>\n<li>Start Listening for PHP Debug Connections (Run option) is useful (rather than &#8220;Stop&#8221; &#8230; doh!)<\/li>\n<li>Set some breakpoints<\/li>\n<li>Break at the First Line of Code (Run option) quite useful<\/li>\n<li>The initial connection between PHPStorm and Xdebug may take quite some time, and remember to accept the connection, should a connection window appear<\/li>\n<\/ul>\n<p>Today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/PHPStorm\/Xdebug\/\" title='Click picture'>slideshow<\/a> offering is <i>warts and all<\/i> as life is when you cannot be sure what happens next?!<\/p>\n<hr>\n<p id='pipt'>Previous relevant <a target=_blank title='PHPStorm IDE Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/phpstorm-ide-primer-tutorial\/'>PHPStorm IDE Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/PHPStorm\/\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"PHPStorm IDE Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/PHPStorm\/phpstorm-0of.jpg\" title=\"PHPStorm IDE Primer Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">PHPStorm IDE Primer Tutorial<\/p><\/div>\n<p>Unlike compiled software code, PHP code is often coded simply with the use of a good text editor.   That doesn&#8217;t mean programmers are not looking for a good PHP <a target=_blank rirle='Integrated Development Environment information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Integrated_development_environment'>IDE<\/a> if it comes along.  Today we are going to talk, for the first time at this blog, about a great IDE to use with PHP based projects.  It is called <a target=_blank title='PHPStorm landing page' href='https:\/\/www.jetbrains.com\/phpstorm\/'>PHPStorm<\/a> for good reason, as it is jam packed full of functionality and features, such as &#8230;<\/p>\n<ol>\n<li>PHP Code Editor<\/li>\n<ul>\n<li>PHP 5.3, 5.4, 5.5, 5.6 &#038; 7 support<\/li>\n<li>smart code completion<\/li>\n<li>syntax highlighting<\/li>\n<li>extended code formatting configuration<\/li>\n<li>on-the-fly error checking<\/li>\n<li>code folding<\/li>\n<li>language mixture support<\/li>\n<\/ul>\n<li>Debugging, Testing and Profiling<\/li>\n<ul>\n<li>context-relevant local variables and user-defined watches<\/li>\n<li>edit values on the fly<\/li>\n<li>remote debugging for your server<\/li>\n<li>debug in multiple sessions simultaneously<\/li>\n<li>keep debugging session alive while moving between pages<\/li>\n<\/ul>\n<li>HTML\/CSS\/JavaScript Editor<\/li>\n<ul>\n<li>DOM-based, browser-specific completion<\/li>\n<li>live editing preview<\/li>\n<li>utilize all the power of Emmet (formerly Zen Coding)<\/li>\n<li>JavaScript refactorings available are Rename, Extract Variable\/Function, Inline Variable\/Function, Move\/Copy, Safe Delete, Extract embedded script into file<\/li>\n<li>automatic compilation\/transpilation of modern web development languages to JavaScript (from CoffeeScript, TypeScript, Dart, etc) or CSS (from Sass, SCSS, Less, Stylus, Compass, etc.)<\/li>\n<li>JavaScript debugger<\/li>\n<li>auto-fixes for such problems as: missing required attributes, invalid attributes or illegal values, wrong references to files in links, duplicate attributes, invalid CSS selector format, invalid CSS properties, unused CSS class definitions, invalid local anchors<\/li>\n<li>Angular 2, TSLint, JSLint\/JSHint, Node.js, Flow support<\/li>\n<\/ul>\n<li>Development Environment<\/li>\n<ul>\n<li>version control for Git, Subversion, Mercurial, Perforce, CVS, TFS supported<\/li>\n<li>tools and code assistance features for work with database and SQL in your projects<\/li>\n<li>analyze schema with UML diagrams<\/li>\n<li>track any changes made to your source files, protecting you from any accidental losses or modifications<\/li>\n<li>helps developers to understand and change their code by providing editable UML class diagrams for PHP code<\/li>\n<li>plugin repository contains 250+ IDE plugins of all kinds<\/li>\n<li>Vagrant is a handy tool, allowing you to share a development virtual machine, is natively integrated<\/li>\n<li>REST Client is integrated in the IDE<\/li>\n<li>SSH Console let you connect to any remote machine and perform various actions via SSH<\/li>\n<li>Google App Engine applications for PHP development along with ability to delegate routine deployment tasks to the IDE<\/li>\n<li>Composer (dependency manager for PHP) is supported<\/li>\n<li>pre-configured command completion for various external command-line tools, including Composer, Symfony console, Zend Framework 2 tool (ZFTool), Zend Framework 1 tool, Drush for Drupal, Tools based on Symfony console (Laravel, Doctrine)<\/li>\n<li>ability to use a remote interpreter instead of a local one with PHP based application on real server or a virtualized one created with Vagrant<\/li>\n<li>completes and checks standard tags, properties, target names, path attribute values in build files, via Phing<\/li>\n<li>same integrated development environment on Windows, Mac OS X and Linux with your single key<\/li>\n<li>Docker plugin allows user to add Docker support to existing projects, view logs, manage Docker containers<\/li>\n<li>if ToDo list is in an issue\/bug tracking system, you can configure PhpStorm to work with the issues without switching from the IDE<\/li>\n<\/ul>\n<\/ol>\n<p> &#8230; and more features can be read about from the <a target=_blank title='PHPStorm landing page' href='https:\/\/www.jetbrains.com\/phpstorm\/'>PHPStorm<\/a> website, by JetBrains.  The information above comes from the website.<\/p>\n<p>With today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/PHPStorm\/\" title='click picture'>slideshow<\/a>, we take up our introductory look at PHPStorm after the install (onto a MacBook Pro laptop using a local Apache MAMP web server) and download, opening some existant PHP code, as a PHPStorm project, which we then Run (or Execute).<\/p>\n<p>We hope this is food for thought for you, in months not starting with M (because we want to remind you to <a target=_blank title='?' href='http:\/\/www.enotes.com\/shakespeare-quotes\/beware-ides-march'>&#8220;beware the ides of March&#8221;<\/a> &#8230; boom, boom), using the great PHP language in a more integrated and dynamic environment, to hand coded, text edited PHP.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d18791' onclick='var dv=document.getElementById(\"d18791\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/php\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d18791' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d18916' onclick='var dv=document.getElementById(\"d18916\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/debug\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d18916' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d53661' onclick='var dv=document.getElementById(\"d53661\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/file_put_contents\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d53661' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Looking at PHPStorm and Xdebug Primer Tutorial below reminds us that PHP can be debugged in that &#8220;step through the code&#8221; way that is sometimes useful. The work of yesterday&#8217;s Australian Postcode Place Images State Precedence Tutorial caused us to &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-file-write-debugging-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,29,37],"tags":[234,305,307,354,418,430,652,2178,932,997,1083,1252,1319,1404,2099,1411,3098,2400],"class_list":["post-53661","post","type-post","status-publish","format-standard","hentry","category-elearning","category-operating-system","category-tutorials","tag-command-line","tag-debug","tag-debugging","tag-dom","tag-file","tag-file_put_contents","tag-javascript","tag-macos","tag-php","tag-programming","tag-safari","tag-terminal","tag-tutorial","tag-web-browser","tag-web-inspector","tag-web-server","tag-wrapper","tag-write"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/53661"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=53661"}],"version-history":[{"count":12,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/53661\/revisions"}],"predecessor-version":[{"id":53673,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/53661\/revisions\/53673"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=53661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=53661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=53661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}