 | News Feed |
Sections
Community Events
|
| feed this: |  |
DevShed: Comparing Files and Databases with PHP Benchmarking Applications
posted Thursday May 08, 2008 @ 07:58:38
voice your opinion now!
BY CHRIS CORNUTT
DevShed is wrapping up their series looking at benchmarking your PHP applications with the third part - a look at comparing execution times of scripts that can either pull from a database or from a flat file.
This large, complex subject offers numerous possibilities for experimentation, which means that you'll surely have tons of fun creating timing systems with PHP. [...] his article, then, will be focused on evaluating different scripts that fetch sets of records, first from a database, and then from flat files.
They use the Timer class they defined in a previous part of the series and wrap it around both a database class (pulling user information from a MySQL database) and a fetch to a flat file for similar information. General exceptions are handled as a part of the resource connection class.
tagged with: database file compare timer class tutorial exception benchmark
DevShed: Using Timers to Benchmark PHP Applications
posted Wednesday April 30, 2008 @ 14:31:08
voice your opinion now!
BY CHRIS CORNUTT
DevShed has posted the second article in their series looking at benchmarking your PHP scripts. This time they look at the use of "timers" to check on script execution length.
Since you already know how to create timer functions and classes, in this tutorial, I'll create some concrete examples that show where these timing mechanisms can be applied in order to evaluate the performance of certain PHP applications.
They create a few classes that connect to a database and pull out rows (handing it off to a Result class). They use these classes in two examples - one with compression (output buffering) and one without using their Timer class to evaluate the differences.
tagged with: timer benchmark application tutorial class mysql row output buffering
Richard Heyes' Blog: Reading a specific line in a file
posted Monday April 07, 2008 @ 12:56:08
voice your opinion now!
BY CHRIS CORNUTT
Richard Heyes has thrown together some code for a simple thing that he's seen developers request over and over again - moving to/reading from a specific line in a file.
After reading something on the php-general list I decided that a) I'm bored, and b) I'll write something which handles it. So here it is.
His code is simple - looping through the lines of the file until it locates your desired target (with some error checking along the way). Plus, if it's already fetched, it keeps it in a cached array for future retrieval.
tagged with: reading specific file line example code class
Michael Kimsal's Blog: Another PHP bugbear…
posted Wednesday March 05, 2008 @ 19:08:00
voice your opinion now!
BY CHRIS CORNUTT
Micheal Kimsal has pointed out another "bugbear" he's found in his work with PHP - this time it's with the use of class constants.
My issue is not with the language itself (this time!) but how this sort of documentation is handled. Updating public documentation well ahead of a release creates confusion.
He's referring to the documentation for the class constants not quite matching up with the current functionality (resulting in a T_PAAMAYIM_NEKUDOTAYIM). He wants consistency in the documentation and maybe references to what it requires to use a certain bit of code.
tagged with: docuemntation static class constant consistent
Arnold Daniels' Blog: A dark corner of PHP class casting
posted Wednesday February 20, 2008 @ 12:08:00
voice your opinion now!
BY CHRIS CORNUTT
In this blog entry Arnold Daniels talks about an issue he had in the past (needing a bit more functionality than the PEAR DB library could offer) and how he ended up solving it with what he calls a "dark corner" of PHP - class casting.
PHP has a function serialize, which can create a hash from any type of variable, scalars, array, but objects as well. Using the unserialize function, PHP can recreate the variable from the serialized hashed. If we look at how an object is serialized, we see only the properties and the class name are stored.
His method allows for class manipulation via changes to the serialized class information (like changing the value of the name parameter). His "casttoclass()" function makes changing this value simple.
tagged with: class casting serialize extend parent child
PHPBuilder.com: Class Inheritance with PHP
posted Monday February 18, 2008 @ 07:58:00
voice your opinion now!
BY CHRIS CORNUTT
On PHPBuilder.com today, there's a new tutorial that takes a beginning look at PHP5's class inheritance model.
There are many benefits of inheritance with PHP, the most common is simplifying and reducing instances of redundant code. Class inheritance may sound complicated, but think of it this way. Consider a tree. A tree is made up of many parts, such as the roots that reside in the ground, the trunk, bark, branches, leaves, etc. Essentially inheritance is a connection between a child and its parent.
They choose to go with a "car" illustration instead and show how a child of the Product class (Car) can access the private properties of the parent. They also include an example of it in action with a bit of HTML output.
tagged with: inheritance class php5 object private protected public tutorial
DevShed: Using Yahoo Web Services to Perform Searches with an Object-Oriented Approach
posted Tuesday February 12, 2008 @ 13:23:41
voice your opinion now!
BY CHRIS CORNUTT
To finish up their series looking at using the Yahoo! web service search functionality in a PHP5 application, DevShed has posted this look at integrating the search functionality into a preexisting application.
In simple terms, my plan will consist of creating some compact and modular PHP 5 classes, which will define a few basic methods for working with the different web services offered by Yahoo!.
They take the code they created from before (earlier parts of the series) and format it to fit into its own standalone class that can be included anywhere in an application. They create the class so it can search not only the normal results but it can also pull in the data from the video search Yahoo! offers as well.
tagged with: yahoo search video object oriented oop class integrate
|