News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Volker Dusch:
Errors will be fixed. Warnings will be 'looked at'
October 04, 2012 @ 08:25:43

In a new post to his site Volker Dusch shares his thoughts about warnings in coding style checks (and how they differ from real errors).

When it comes to coding standards there is one rule that always makes me cringe when I stumble upon it: "Lines SHOULD be less than 120 chars long. If not a warning will be issued." Let me try to make a point why I consider WARNINGS in coding guideline checks hurtful.

He defines a warning first, so there's no confusion (something that should be done, but doesn't have to) and why he thinks there's not much of a place for them in the code guidelines. He suggests that, by having them, they take away time from the real issues, the errors. He notes that "should" rules on formatting shouldn't be added to your QA tools right away. Adding too many of these that spit out too many warnings (not errors) could just muddy the waters and make the developers more confused.

0 comments voice your opinion now!
errors warnings qa code style guidelines opinion


Zend Developer Zone:
The ZendCon Sessions Episode 24 Elegant Ways of Handling PHP Errors and Except
July 30, 2009 @ 11:30:03

The Zend Developer Zone has posted a new episode in their ZendCon Sessions series today - a recording of Eddo Rotman's talk on exception handling.

Welcome to the ZendCon 2008 edition of the ZendCon Sessions. [...] n this series we will be releasing regular sessions from ZendCon 2008 as we lead up to this year's ZendCon. This episode of The ZendCon Sessions was recorded live at ZendCon 2008 in Santa Clara, CA and features Eddo Rotman giving his talk: "Elegant Ways of Handling PHP Errors and Exceptions"

You can listen to this episode either through the in-page player, by downloading the mp3 or, of course, subscribing to the podcast feed.

0 comments voice your opinion now!
handling errors zendcon08 session podcast


DevShed:
Displaying User Comments in a Code Igniter Blog Application
December 23, 2008 @ 11:42:01

DevShed continues their series creating a simple blogging application with the CodeIgniter framework with this part of the series - adding in a display for user comments.

In this specific case, the first of these files was defined as a basic controller, and was provided with the ability to paginate the aforementioned blog entries via the corresponding pagination class included with CodeIgniter. However, in its current incarnation, the blog application is pretty limited. It doesn't let users post comments on each blog entry. Thus, in the next few lines I'll be improving the signature of the controller class to address this important issue.

The review the code from before (showing the pagination of the blog entries) and add onto it a new comments method and how to create a new view to show the messages visitors to the site have submitted.

1 comment voice your opinion now!
blog application tutorial codeigniter user comment display view action


Nessa's Blog:
Using PHP to Display Version Info (I and II)
October 19, 2007 @ 11:23:00

Nessa has two posts that talk about how to use PHP to display the versions of software running on the local machine.

I've been working on this application for work that does some simple server reporting, part of which involves displaying the versions of major software running on the machines. [...] I need to be aware of this to make sure that customers are being moved to servers with compatible versions. It's also good in tracking and planning upgrades.

In the first post she recommends using the exec function in PHP to run system commands to get things like the cpanel version, python version and what perl you have installed.

Part two shows a little bit different way to get some of the same information - using the data in the /proc/version file as a single resource to get OS information.

0 comments voice your opinion now!
display version information exec proc version file display version information exec proc version file


Stefan Mischook's Blog:
Turning on display_errors in WAMP - Video Tutorial
August 31, 2007 @ 07:55:00

Stefan Mischook has posted another video tutorial to help developers get started in their PHP travels. This time it covers how to turn on errors when using the popular WAMP installation package.

Within a WAMP installation, I ran into a little issue today when trying to change php.ini's 'display_errors' property. By default WAMP installs with 'display_errors' to 'Off' - This is a pain-in-the-ass setting when trying to write new PHP code because errors don't get displayed in the browser window

He includes the solution in the post but links as well to the video tutorial to show you exactly how it's done.

0 comments voice your opinion now!
wamp video tutorial enable error display wamp video tutorial enable error display


DevShed:
Working with PHP and MySQL
May 29, 2007 @ 09:31:00

DevShed has a new tutorial today that's part two in a series looking at working with the combination of PHP and MySQL - "Working with PHP and MySQL".

You'll learn how to select the database, fetch and display data, and more. This article is excerpted from chapter 9 of Learning PHP and MySQL, written by Michele Davis and Jon Phillips.

They start by selecting the database before moving on to the query. With a select query, they grab the information from the books tablw and display it out to the page (fetching with both a mysql_fetch_row and mysql_fetch_array).

1 comment voice your opinion now!
mysql tutorial select database fetch display mysql tutorial select database fetch display


JSLabs Blog:
How to write an image gallery script in PHP
December 13, 2006 @ 07:10:10

On the JSLabs Blog today, there's a quick new tutorial showing how to create an image gallery script to show off your latest photos and other images to the world.

This is a simple yet useful tutorial on how to write an image gallery script in PHP. It could be used for anything from banner rotation to just a couple of images that you would like to display in rotation on your website.

The code is broken up into two functions - GetAllFiles (grabs the files from the current directory) and DisplayImages (outputs the HTML to display and organize the images). The script doesn't require any external libraries and the functionality in it works with PHP 4.3.0 and above.

It's nothing fancy, but if you need a script to show the images in a directory (it can tell the difference between image and non-image), check this out.

0 comments voice your opinion now!
image gallery script display directory file html tutorial image gallery script display directory file html tutorial


DevShed:
Handling Entries for a Blogger Built with PHP
November 28, 2006 @ 09:58:00

DevShed has posted the second part of their (three part) series looking at the construction of a blogging application in PHP5. In this part, they look at how to handle the user's desire to input entries into the application via a HTML form.

In this second installment of the series, I'll show you how to expand the initial functionality of the already familiar "BlogProcessor" class so that it is capable of addressing all these (displaying all the entries, show the insert/update forms) issues.

They start with the simplest of the group - the displayBlogs method, outputting the full contents of the entries for the blog. Things get a bit tougher with the next step - creating the insert and update forms for pushing content into the database. Finally, they defined the header and footer functionality to make setting up the structure of the page simpler.

0 comments voice your opinion now!
part2 blog tutorial insert update form header footer display part2 blog tutorial insert update form header footer display


Ryan Malesevich's Blog:
iTunes Stats for Macintosh with PHP & MySQL Part 2
August 14, 2006 @ 10:55:41

Ryan Malesevich is back today with part two of his "iTunes Stats for Macintosh with PHP and MySQL" series, building on the groundwork laid in part one.

As promised I'm back again the second and should be the last part for the iTunes stats with PHP & MySQL. In the previous section I covered how to get your iTunes information from iTunes into a MySQL database. Since I didn't get any questions about it I can either assume that no one cares or no one had any troubles.

This part is not exclusive to a Mac, you can write your PHP scripts with any operating system that you want. So if you're not on a Mac but has a friend who does then you can send your friend your iTunes XML file and your friend can export the data for you. Let's get stated shall we.

Since in the first part of the series, he showed how to put information into the database, he shows in this second part how to get things back out. There's code samples for connecting to the database, the SQL to grab all of the data out from the table and echo out the information inside. He also links to his stats as an example.

1 comment voice your opinion now!
itunes stats part2 macintosh display database play count itunes stats part2 macintosh display database play count


SitePoint PHP Blog:
How strict is your dynamic language?
July 27, 2006 @ 06:00:58

Harry Fuecks wonders in this new post on the SitePoint PHP Blog "how strict is your dynamic language?"

Considering the "big four" dynamic, procedural languages; Perl, Python, PHP and Ruby, to an extent they're much of a muchness, offering only small variations on the same theme (ignoring PHP's lack of support for functional-style programming). But sometimes little things make a big difference, and perhaps most of all when your code is given input to handle which it wasn't designed for. Knocked up a simple example to compare them in this area...

He compares four languages - Perl, PHP, Ruby, and Python - by giving, for each, code examples and what the output would be, including what would error out. These examples help to illustrate his final points:

  • where is the point when a fatal error should be raised?
  • what is it the languages should actually complain about?

0 comments voice your opinion now!
strict dynamic language errors perl python ruby compare strict dynamic language errors perl python ruby compare



Community Events





Don't see your event here?
Let us know!


community library framework api install unittest release deployment language bugfix tips series interview podcast zendserver opinion symfony introduction package laravel

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework