Monday 2 February 2015

Friendly PHP debug web browser pane (quick drop in)


Every once in a while I wish to still use the website whilst still debugging. 



This quick drop in code will help you produce that effect with icons to hide and expand the debug pane.

1) Copy this into the area wish to debug.  Must be within a <body></body> rendering of the website.

2) Rename VARNAME with the variable you wish to debug e.g. $_SERVER

 $debug_out = "<div id=\"debug-pane\" style=\"border : solid 2px #f00; background : #000000; color : #fff; padding : 4px; width : 98%; height : 200px; overflow : auto; position: fixed; z-index: 9999; bottom: 0;\">";  
 $debug_out .= "<div style=\"background:red; color:#00; overflow : auto; position: fixed; z-index: 9999; \">";  
 $debug_out .= "<a href=\"#\" onclick=\"javascript:document.getElementById('debug-pane').style.display = 'none'; return false;\" style=\"color:#fff !important; text-decoration:none;\">[x] Hide debug&nbsp;</a><br />";  
 $debug_out .= "<a href=\"#\" onclick=\"javascript:document.getElementById('debug-pane').style.height = '90%'; return false;\" style=\"color:#fff !important; text-decoration:none;\">[x] Full screen&nbsp;</a>";  
 $debug_out .= "</div>";  
 $debug_out .= "<pre id=\"debug-contents\" style=\"margin-left:250px\">";  
 $debug_out .= "<strong><u>VARNAME</u></strong>\n";  
 $debug_out .= print_r(VARNAME, TRUE)."\n";  
 $debug_out .= "</pre>";  
 $debug_out .= "</div>";  
 echo $debug_out;  

Tuesday 23 September 2014

SVN 1.6.23 on OSx Maverick 10.9 gone after an xcode update

Symtom

After an xcode update version 6.0.1 was released, Subversion 1.6.23 was removed for security reasons.  http://support.apple.com/kb/HT6444?viewlocale=en_US&locale=en_US

Currently I don't wish to update to the latest SVN just yet.

Work around

For people using xcode and lost their SVN "subversion-1.6.23" and don't wish to change just yet due to project using that version at the time before launch.

Follow these rough steps (So fill in the gaps to extract the files) to compile a specific version.
  1. Agree to xcode license
    sudo xcodebuild -license

  2. Download xcode command line tools
    sudo xcode-select --install

  3. Download, extract, compile and install neon
    http://www.webdav.org/neon/neon-0.29.0.tar.gz
    ./configure --with-ssl
    make
    make install

  4. Download, extract, compile and install subversion
    http://archive.apache.org/dist/subversion/subversion-1.6.23.tar.gz
    ./configure  -without-apxs --with-neon=/usr/local --with-ssl
    make
    make install
     
  5. Test "svn" has http and https protocols
    /usr/local/bin/svn --version
    You should see ra_neon http and https

Then you can configure your IDEs (e.g. Coda) or use setup bash_alias to point to point to "/usr/local/bin/svn".

You can later change to the latest SVN when you feel ready which is located at  "/usr/bin/svn".