News Feed
Jobs Feed
Sections




Recent Jobs

News Archive
feed this:

Sebastian Bergmann's Blog:
Sharing Fixtures and Stubbing/Mocking Static Methods
February 15, 2010 @ 12:55:49

Sebastian Bergmann has two recent posts dealing with some of the more difficult topics in unit testing. One looks at sharing fixtures between tests and the other talks about stubbing and mocking static methods in your tests.

From the first of the two tutorials:

A good example of a fixture that makes sense to share across several tests is a database connection: you log into the database once and reuse the database connection instead of creating a new connection for each test. This makes your tests run faster.

This fixture sharing example uses the setUpBeforeClass and tearDownAfterClass methods to create and destroy the connection.

In the second article Sebastian shows how to mock up a sample static function and mock it with the "staticExpects" helper.

0 comments voice your opinion now!
phpunit unittest stub mock static share fixture



Web Development Blog:
Search for photos using PHP and the flickr API
December 21, 2009 @ 15:16:31

On the Web Development Blog there's a recent post about connecting your PHP application with the Flickr API to search for photos with the help of a simple class.

We will be using the php function "file_get_contents" to receive data from flickr. The data which we will receive will be a serialized PHP array which means all we need to do is unserialize the array and we will easily be able to use the data returned. As an alternative we can use a cURL function to get the data, for example if the function "file_get_contents" is not allowed on your web host.

They show how to get your API key from the Flickr website and the sample code that you'll need to make a GET request (with file_get_contents) and an example of a loop displaying the response.

2 comments voice your opinion now!
flickr share api connect tutorial


Community News:
phpanywhere (Online PHP IDE)
April 29, 2009 @ 11:12:18

The phpanywhere site boasts itself as "the easiest way to bring work with you anywhere you go - without bringing anything". The free (still in beta) service offers online PHP editing through a web browser interface.

PHPanywhere is a web based free Integrated Development Environment or IDE for the PHP language, in other words it is an application that gives developers all the code editing capabilities they need to develop PHP applications online. It includes a real-time syntax code editor with support for all web formats and a powerful FTP editor.

You can add in FTP servers and pull files directly from them to edit and upload back over. You can also use the project sharing to allow others to see the current state of your code (real-time collaboration is "coming soon"). You can see screenshots of the editor interface, setting up FTP sites and modifying permissions for the files.

4 comments voice your opinion now!
phpanywhere online ide edit ftp share


Brandon Savage's Blog:
Where Comments Are Useful
January 01, 2009 @ 20:04:45

Brandon Savage has his own response to the "comments are harmful" post over on the PHP in Action blog:

There's a lot of good advice, especially about writing clean code. But the article fails to address a good number of really critical details and to some degree misses the point of Eli's article.

He mentions these points - the value of writing comments before hand, the usefulness of descriptive comments, how they can be used as a todo pointing to future development and using them to share the knowledge and let other people in on what you're thinking.

0 comments voice your opinion now!
comment useful before descriptive future development share


Nexen.net:
PHP Statistics for April 2008
May 06, 2008 @ 15:17:41

Damien Seguy has released the latest PHP statistics for last month - April 2008. Among the highlights are things like:

  • PHP 5.2.5 is now the most popular PHP version, ahead of 4.4.8
  • PHP 5 reaches 36.60% of PHP market share
  • Still a lot of migrations toward 5.2.5 and 4.4.8

You can check out the details on these and other statistics (like PHP usage by country and version) the complete monthly stats and the evolution stats. Oh, and don't forget - Damien and crew are the ones supplying the latest edition of the elePHPants to the PHP community!

1 comment voice your opinion now!
user statistics popular version market share nexen


Dotvoid.com:
Loosing market share with PHP 4
February 13, 2007 @ 07:56:00

From Dotvoid.com, there's a new posting talking about the continued use of PHP4 by developers and hosting companies and how it's effecting the community as a whole.

It is true that the PHP 5 uptake has been slow. Many internet service providers as well as many developers are reluctant to switch. This is probably, as others have stated, a circular dependency.

As ISP:s are reluctant to upgrade the popular open source projects are hesitant to upgrade. I still think the wrong people are worried. Still PHP 5 is increasing it's share and finally the day will come when version 4 will be considered legacy. Hopefully before PHP 6 is here but not necessarily.

He continues on, talking about what PHP5 is really about (it's not just the objects!) and things that can help make it an easier sell to those still lagging in a PHP4 world - like the Zend Framework.

0 comments voice your opinion now!
market share php4 php5 adoption zendframework market share php4 php5 adoption zendframework


SnippetCollection.com:
PHP Snippets & Examples
February 14, 2006 @ 07:09:05

Welcome to SnippetCollection.com. Here you can find a large collection of snippets and examples in ActionScript, Php, Java, Java Script, VB, VB.NET, C, C++, ASP, ASP.NET, Perl , SQL and Python.

SnippetCollection.com is just like it sounds - a resource for sharing those little handy pieces of code that we all use over and over again. There are various other categories, but the PHP section has its fair share of items in the list. Various topics and skill levels are represented here, everything from "calling a function" to advanced array operations. So, if you have a bit of code to share with the world, head over, sign up, and get started...

2 comments voice your opinion now!
snippets examples share snippets examples share



Community Events









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


wordpress podcast codeigniter conference developer feature drupal microsoft facebook sqlserver zendframework framework opinion symfony performance job extension joomla windows release

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