PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information
PhpRiot Latest Blog Posts
Displaying blog posts 181 to 200 of 225

07.12. One-click Deployment

07.12. One-click Deployment
Today's topic is deployment. It's called one-click deployment for a reason: Developers are lazy. It's hard to do less than clicking on one button, so that's our goal. With the growing need for lower time-to-market and faster response to user feedback it is inevitable to not be limited by technical factors (there are enough other obstacles already). The focus lies on reproducible results.So, what do we need? Actually, not much. Disregarding the tools and practices that build the foundation of agile...

Lukas Smith's Blog: Loose interface coupling

Lukas Smith's Blog: Loose interface coupling
In a new post to his blog Lukas Smith proposes an idea for a loosely coupled interface setup that would allow for easier integration between third-party libraries and other applications.Especially as for different libraries a different subset of the community could end up collaborating. Here I see 3 options: 1) each library bundles the interfaces (even though they sit in some common namespace), 2) each project asks their users to fetch the common interfaces from some other place 3) runtime "coupling"....

DevArticles.com: Singletons in PHP

DevArticles.com: Singletons in PHP
On DevArticles.com today there's a new tutorial posted talking about one of the more popular design patterns, the Singleton, and how it can be implemented in PHP.Though in the past they enjoyed both popularity and a certain amount of prestige, without a doubt Singletons have progressively become one of the most evil and despicable villains in object-oriented design. Singletons earned their bad reputation for a reason: bringing them to life requires the programmer to deal at least with a static method....

DZone.com: Codeigniter and Object-Oriented PHP: Two Guides

DZone.com: Codeigniter and Object-Oriented PHP: Two Guides
On DZone.com today John Esposito points out two CodeIgniter tutorials that can help you on your way to becoming a pro with this popular PHP framework.As Codeigniter builds on its (already considerable) popularity, now might be a good time to think about using the massively community-supported PHP framework to its maximum potential, if you aren't already. Here are two tutorials to check out, depending on your level of familiarity with object-oriented PHP and frameworks.Here's the two he mentions:...

Joshua Thijssen's Blog: SPL: Using the iteratorAggregate interface

Joshua Thijssen's Blog: SPL: Using the iteratorAggregate interface
Joshua Thijssen has a recent post spotlighting a part of the Standard PHP Library (SPL) that implements that Traversable interface, the IteratorAggregate interface.Together with its more famous brother "Iterator", they are currently the two only implementations of the "Traversable" interface, which is needed for objects so they can be used within a standard foreach() loop. But why and when should we use the iteratorAggregate?He answers his question with an example - a book that contains chapters. With a...

Twig: Don't forget to close your tags

Twig: Don't forget to close your tags
Just a little heads-up for people working with Symfony2/Twig: Today I ran into an issue that I couldn't figure out. "It shouldn't be this hard..." I thought, and indeed, it turned out not to be as hard. It's just easy to overlook: Make sure to close your twig tags correctly :)

Community News: Latest PECL Releases for 12.06.2011

Community News: Latest PECL Releases for 12.06.2011
Latest PECL Releases: intl 2.0.0b1 gearman 1.0.0 gmagick 1.0.10b1 functional 0.0.5 gearman 1.0.1

06.12. Doctrine 2 - Zend Framework Integration

06.12. Doctrine 2 - Zend Framework Integration
.serendipity_entry h1 { font-size: 20px; margin: 13px 0; } .serendipity_entry h2 { margin: 7px 0; } .serendipity_entry ul { padding-left: 3em; } .gist-data { max-height: 250px; overflow: auto; } In yesterday's article of our advent calendar, we explained the concepts underlying Doctrine 2. In today's article, we want to use that knowledge and create a simple Zend Framework (ZF) application that uses Doctrine 2 to persist its business objects. While explaining how to integrate Doctrine...

Dates and Times

Dates and Times
Having dealt with a lot of dates and timesa-aand the calculations between thema-a recently, I thought it might be a good idea to write down some of the issues I've encountered. The truth is, dates and times are hard! There are many different rules that make dealing with dates and times non-trivial. Often, people make mistakes, causing loss of information and general confusion. Deciding on a format One of the observations I've made is that nearly every system out there lacks a standard for passing around...

Elizabeth Naramore's Blog: PHP Internals, Let's Chat About the Future!

Elizabeth Naramore's Blog: PHP Internals, Let's Chat About the Future!
Elizabeth Naramore, host of the "Future of PHP" webcast series for EngineYard has put out a call for PHP internals developers inviting ones that would like to chat a bit.Consider this a call to the PHP Internals team. We've been doing a series of panel discussions over at Engine Yard about PHP-related frameworks and where they are going in the future, but one important piece that's missing is the discussion about the future of the PHP core. [...] If you're a core PHP contributor and you want to voice...

Christer Edvartsen's Blog: Running Multiple Versions of PHPUnit

Christer Edvartsen's Blog: Running Multiple Versions of PHPUnit
Christer Edvartsen has a recent post showing you how to get multiple PHPUnit versions installed and working on your application. There's been some issues lately due to some updates in recent PHPUnit versions:The latest version of PHPUnit (3.6.4 at the time of this writing) does not play well with the Zend Framework extensions (Zend_Test_PHPUnit). After asking Matthew Weier O'Phinney about this he answered that they had standardized on PHPUnit-3.4 for ZF1. Having just upgraded to the latest version of...

Till Klampaeckel's Blog: Cooking PHPUnit (and a chef-solo example on top)

Till Klampaeckel's Blog: Cooking PHPUnit (and a chef-solo example on top)
Till Klampaeckel has a new post to his blog combining two powerful technologies into one automated package that uses a Chef recipe to install PHPUnit as a part of the setup.If you follow my blog for a while, you might have noticed that I'm a huge fan of automation. I just moved one of our development servers the other day and had one of these moments where something just paid off. Taking for granted that I can spin up fully operational EC2 instances in minutes, I also had our development stack installed...

DZone.com: Self-Initializing Fakes in PHP

DZone.com: Self-Initializing Fakes in PHP
In a new post over on DZone.com Giorgio Sironi shows how to create a fake, an interface that mocks the interface to an external tool and provides cached results back to the calling script.We can specialize our Fake in a Self-Initializing Fake, which will provide an alternative implementation with the aid of the real one. In our Google Maps case, the Fake will use the real web service for its first response, and maintain an internal cache. This mechanism provides insurance about out-of-sync responses, and...

WebDevRadio: Episode 94: Keith Casey Interview from Zendcon 2011

WebDevRadio: Episode 94: Keith Casey Interview from Zendcon 2011
On the WebDevRadio podcast, Michael Kimsal has posted an interview with Keith Casey from this year's ZendCon 2011 conference.I got a chance to sit down with (the legend) Keith Casey. Keith's well known in the PHP community with his web2project project (among other things) and is now poised to be a greater force in the worlds of Twilio and the Austin tech scene. Volume is a little quiet here, so turn it up to hear Keith's words of wisdom.You can listen to the episode either via the in-page player or by...

PHPMaster.com: Charting with pChart

PHPMaster.com: Charting with pChart
On PHPMaster.com today there's a new post highlighting the use of pChart to graph out the data from your PHP application. pChart provides an easy interface to draw graphs with GD, supporting alpha transparency, shadowing, spline/cubic curves and much more.Created and maintained by Jean-Damien Pogolotti, a systems engineer based in Toulouse, France, pChart is a library that creates anti-aliased charts and graphs using PHP. It's object-oriented code has been recently redesigned and makes it easy to add...

Community News: Latest PEAR Releases for 12.05.2011

Community News: Latest PEAR Releases for 12.05.2011
Latest PEAR Releases: Net_LMTP 1.0.2 pearweb 1.25.0 Services_Webservice 0.6.0 File_XSPF 0.3.0 PHP_CodeSniffer 1.3.2 PhpDocumentor 1.4.4 Date_Holidays_EnglandWales 0.1.4

Loose interface coupling

Loose interface coupling
OK, I think this is likely a stupid crazy idea, but it has so much practical benefits at first sight that I want to bring it up on the blog and not just twitter. As a rule of thumb when writing code one should always try to reference an interface in type hints, instanceof or is_a() checks. This in theory allows people to replace the implementation if only for unit tests. But more importantly it could also allow someone to switch to an entirely different lib for the given dependency. One practical issue...

PECL/mysqlnd_ms: quality of service filter

PECL/mysqlnd_ms: quality of service filter
What if your PHP application could tell the mysqlnd library what service quality you need when using a MySQL replication cluster? If you wanted read-your-writes, the driver would select replication nodes for you which can offer it. If you can allow replication lag but no more than three seconds, the driver would selecta One function call and you get the service you need. That's what version 1.2 of PECL/mysqlnd_ms is about. The quality of service filter In the world of PECL/mysqlnd_ms, the free and...

Behat hackday

Behat hackday
A few days ago, we held an open hackday on doing Behaviour Driven Development (BDD)A with Behat at Liip Fribourg. It was the opportunity for the handful of participants to get a first grip on Behat and explore some aspects of BDD through it. Introduction BDD is an interesting practice for agile web developers, it ideally allows the formalization of the acceptance criteria of a story through scenarios written in Gherkin, a domain specific language that is human writable and machine readable. An archetypal...

A Stitch in Time Saves Nine

A Stitch in Time Saves Nine
The N+1 Problem It is easiest to describe the N+1 problem by example. Take a look at the following bit of PHP in a hypothetical blog app:fetchAll($stmt); // 10 queries (1 per blog post) to get // the comments for each post foreach ($posts as &$post) { $stmt = 'SELECT * FROM comments WHERE post_id = :post_id';$bind = array('post_id' = $post['id'],); $post['comments'] = $sql-fetchAll($stmt, $bind); } We have a master set of rows (the blog posts), but we need to additionally fetch many rows of comments...