Shindig on PHP – Setting up a Debug Environment By Anash P. Oommen OverviewShindig is a new project in the Apache Software Foundation incubator and is an open source implementation of the OpenSocial specification and gadgets specification. Details of Shindig can be found at http://incubator.apache.org/shindig/ Shindig is currently available in Java and PHP. The following article explains how to setup a debug environment for the PHP version of Shindig on your windows machine. Setting up a development environmentAs one starts serious development with shindig, a development environment becomes indispensable. I have chosen to setup the development environment using PhpEd, an IDE for PHP. PhpEd is a commercial PHP IDE available from http://www.nusphere.com. You can download a trial version of this IDE from http://www.nusphere.com/download.php.ide.htm.
Run the setup and follow the instructions to complete the setup. Setting up remote debuggingPhpEd allows you to debug a website that is hosted on Apache. To enable this, one has to do the following steps:
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) index.php [L] </IfModule>
4. Open a web browser and navigate to http://localhost/shindig/php/dbg-wizard.php. If everything goes well, you should see a page like this:
Setting up a WorkspaceOpen PhpEd. Create a new workspace, and a new project in it. The new project window should show up like this:
Enter the following values in the various text boxes: Root directory: C:\Program Files\xampp\htdocs\shindig\php\ Run Mode: HTTP Mode (3-rd party WEB server) Root URL: http://localhost/shindig/php/ Remote Root Directory: C:\Program Files\xampp\htdocs\shindig\php\ Now save your project and workspace. We can start debugging Shindig from the SampleContainer page - http://localhost/shindig/php/gadgets/files/samplecontainer/samplecontainer.html. However, PHPEd does not debug files with .html extension, and to make things worse, there is no physical file at the location htdocs/shindig/php/gadgets/files/samplecontainer/samplecontainer.html. So, to allow debugging the samplecontainer page, we make a few adjustments to the Shindig files. 1. Create a new file named start.php in htdocs/shindig/php folder and add the following lines:
<html> <head> <title></title> </head> <body> <a href="http://localhost/shindig/php/gadgets/files/samplecontainer/samplecontainer.html">Launch Container</a> </body> </html> As you might note, this is a simple html with a link to the samplecontainer page. 2. Start debugging the start.php that we just created. Once the page loads, click the “Launch Container” link.
By default, PhpEd uses an embedded browser for debugging, but you can change this option if you want to use say, Firefox for debugging, as shown below: |




