Archive for August 17th, 2006
PHP Developer - August 17th, 2006
Jim Plush shares a handy hint he’s come upon while working with debug statements in his code - how to speed them up by 85%.
For many of us we have a configuration file for our web applications. In that configuration file there is usually a DEBUG constant that we can turn on to print out helpful debug statements on the screen or to a flat file.
If you do something similar to get data from your applications consider adding a test for the debug value before calling the function directly. If you do you’ll get about an 85% speed gain when debug is turned off. Which probably will be 98% of the time your application is running.
He includes sample code to illustrate along with some of the testing parameters that he followed to get at the 85% mark he did.
Continue Reading ·
PHP Developer - August 17th, 2006
IBM’s developerWorks section has started off a new series today with part one of their “Kick-start takes you to the movies” series focusing on using DB2 and PHP to create a personal movie database application.
Explore PHP and XML development using the Eclipse IDE, DB2 Express-C 9, and WebSphere Application Server Community Edition. Learn how to install and configure these applications, part of a program designed to kick-start your application development, to develop a Web-based movie information database. This is part one of a two-part tutorial, covering the installation and configuration of the tools, along with some basic proof-of-concept code development.
You’ll need the Eclipse IDE and a web server with PHP and DB2 installed to follow along with this part, but once those are in place, the rest is smooth sailing. They walk you through each step of the way - setting up the XML database, creating your project, creating all of the database tables, and connecting your PHP to the database.
Continue Reading ·
PHP Developer - August 17th, 2006
Sebastian Bergmann has a quick note today on his blog about an article from IBM that taks about using unit testing, specifically PHPUnit.
IBM DeveloperWorks has an article titled “Check your PHP code at every level with unit tests” that suggests unit tests for PHP code at the module, database, and user-interface levels and proposes IBM not only uses my software, but also advocates it.
You can find out complete information on PHPUnit from the project homepage and about unit testing from here.
Continue Reading ·
PHP Developer - August 17th, 2006
The International PHP Magazine has posted the results from their latest poll, this time asking which one of their options is the most dangerous kind of problem an application can have.
Options included “remote code execution”, “SQL injections”, and “file system attacks”. Topping the charts, and almost typing for first place are “remote code execution” and “SQL injection”, with SQL edging out the remote code.
The majority believes that ‘SQL Injection’ is the most common PHP attack as it garnered 33.6% of the votes. The PHP attack ‘Remote Code Execution’ scored 30.9% of the votes. The options ‘File system attacks’ and ‘Cross-site Scripting’ bagged 10.9% and 8.2% respectively. Not many people seem to consider the existence of any other PHP attack as the option ‘Others’ polled a dismal 0.9%.
Their latest poll goes with a different subject, asking readers to vote on which of their options is the best way to speed up a site. Check it out and cast your vote today!
Continue Reading ·
PHP Developer - August 17th, 2006
Joshua Eichorn is back today with the answers to the questions as posed by the readers of his blog previously.
Your AJAX answers from my AJAX questions post are below, I hope everyone finds them helpful.
The questions answered include:
- How can I find out whether a connection is broken?
- Why would you want to use HTML_AJAX when there are far better tools for the job, pure javascript solutions such as prototype or jquery?
- What is the best way to ‘degrade’ a website when Javascript/XMLHttpRequest support is disabled?
- When utilizing an AJAX API such as Google Maps, how do you execute embedded Javascript commands in a page generated on-the-fly?
…as well as a few more. Where appropriate, he also includes code to help illustrate his point.
Continue Reading ·