|
Sponsored Link
|
On the Refulz blog today there's a new post about traits in PHP (recently introduced in PHP 5.,4) and why we need them in our development.Traits is one major addition to PHP. We read an introductory article about Traits in PHP 5.4. In the post, we saw an example code which only resembles single inheritance. So, what is the actual purpose of Traits and why do we need to use Traits in our code.They give a sample use case involving two types of clients, Business and Individual, and how you can use a single...
Lee Davis has a recent post to his blog showing how you can combine the Zend_Form component of the Zend Framework with Doctrine to help directly "drive" your forms.On a few of my previous projects I found myself creating more form classes than I'd like. And after the 30th one I figured there had to be a better way. I quickly realised that most of the elements within these forms shared similarities to the data type I would use on my database definitions. As I was using Doctrine at the time I figured I...
On DZone.com there's a new article from Daniel Ackerson showing how to set up a WordPress instance on an Amazon EC2 instance with the help of Puppet and git.Having started out on a Joyent appliance, migrating to Linode, and finally, to Amazon with a Bitnami stack, we noticed the common pain of manually configuring each of these environments. Bitnami caused us an even bigger headache by being very difficult to update (apt-get doesn't update the bitnami wrapped AMP stack). We decided to get full control of...
In a previous post Rob Allen showed how to return JSON data from a controller in a Zend Framework 2 application. In this new post he shows how to use the "Accepts" header from the client to do the same thing.Following yesterday's article on returning JSON from a ZF2 controller action, Lukas suggested that I should also demonstrate how to use the Accept header to get JSON. So this is how you do it!You'll need to create the JsonStrategy first, then you can return the ViewModel from the controller. If all...
Popular posts from PHPDeveloper.org for the past week:InfoWorld: Review: 2 PHP tools rise above the rest
Monitor.us Blog: Website Performance: PHP
Chris Morrell's Blog: Introducing Zit, an object-oriented dependency injection container
James Fuller's Blog: Enforcing contracts in your PHP functions and methods
Freek Lijten's Blog: SOLID - The S is for Single responsibility
Alex Hudson's Blog: A (fond) farewell to Zend Framework
PHPMaster.com: Continuous Integration (with Jenkins), Part 1
Site News:...
Recently I was a guest on a panel podcast hosted by Cal Evans that included Laura Thomson, Beth Tucker, and Anna Filina. It was entitled a€oSexism in Techa€¯ and was a response to some of the recent goings-on in the tech community. It was a very fun podcast, and I encourage you to give it a listen. Even if you're tired of hearing about the issue, I promise there will be something there you can take away, because we didn't just rehash the same old conversations. While we talked about many things related...
Lorna Mitchell has a new post to her blog today showing how to use the functionality provided by the pecl_http extension to make an OAuth2 connection to Google.I've written about Google and OAuth before, but that was OAuth v1.0, and they are introducing OAuth2 for their newer APIs; in this example I was identifying myself in order to use the Google Plus API. [...] OAuth 2 doesn't need an extension or any particular library as it doesn't have the signing component that OAuth 1 had, and OAuth 2 also has...
Phil Sturgeon shows how you can hijack headers in his latest post to force a download to the client (even on a hosted service like PagodaBox).The question [I posed on Twitter] was: "How to force a download of any file of any type, not on your server, without Apache tweaking? Images are displaying and need em to download." Essentially, I wanted to be able to link to a file that was not on the server in question and anywhere in the world, which could be of any size, any media type and could be potentially...
The jsDay/phpDay organizers have announced a contest to win a free ticket to this year's event(s), one for each conference:GrUSP is organising a tweet contest and its prizes will be two tickets, one for each conference. The contest will start today (March 29th) at 1pm CEST and will end April 1st at 7pm CEST.Anyone can enter - all you have to do is tweet a post with a few things: the "#grsup" hashtag, a mention of the twitter accounts for the events, a link to the conference site and something about the...
Nikita Popov has posted the fourth part of the "PHP's Source Code for PHP Developers" series he and Anthony Ferrara have been posting. In this latest article in the series, Nikita looks specifically at PHP's array implementation and how it's handed "behind the scenes".Welcome back to the fourth part of the "PHP's Source Code for PHP Developers" series, in which we'll cover how PHP arrays are internally represented and used throughout the code base.He starts with an obvious foundation: "everything's a...
In a new post to his blog Rob Allen shows how you can return JSON data directly back from a controller in a Zend Framework 2 application.The new view layer in Zend Framework 2 can be set up to return JSON rather than rendered HTML relatively easily. [...] Firstly we need to set up the view's JsonStrategy to check to a situation when returning JSON is required and then to render out JSON for us.This "JsonStrategy" does some of the hard work for you - detecting when the client is requesting a JSON response...
Here's what was popular in the PHP community one year ago today:PHPBuilder.com: PHP Framework Review: DooPHP
LearnComputer.com: Best PHP Books: My Top 5 Choices
DZone.com: The PHP frameworks poll results
Matthew Weier O'Phinney's Blog: Code Generation with ZendCodeGenerator
David Müller's Blog: Parallel processing in PHP
Eran Galperin's Blog: Database Optimization Techniques You Can Actually Use
php|architect: Looking for a simpler MySQL library? Try MeekroDB
Zend Developer Zone: Using the Plurk API...
If you've been following my recent posts, you know I've been working more lately with Behat for resting some REST services. In this post I showed you how to get things set up for some testing. In this post, I'll show you how to use a custom class that I've put together to make a reusable system for testing REST.
For those that want to cut to the chase, I've posted some example code to github showing the code for the two different sides of the equation - the Behat testing and the PHP framework side (I...
I've been working on something recently where I'm pulling information from lots of places onto a dashboard. Each API has its own little quirks so I'm trying to write up the ones that weren't idiot-proof, mostly so I can refer back to them later when I need to maintain my system!
I've written about Google and OAuth before, but that was OAuth v1.0, and they are introducing OAuth2 for their newer APIs; in this example I was identifying myself in order to use the Google Plus API (which turns out not to do...
On the "A Cloudy Place" blog there's a recent post about the steps the author (Shameer) to to get PHP and Git set up on the Elastic Beanstalk service from Amazon.When Amazon announced Beanstalk's support for PHP I was curious to know what it would look like. So I decided to give it a try. I hadn't used my AWS account for a while, so I had to do some account setup tasks, configuring command line tools, etc. In this article I will explain how to set up a PHP application in Beanstalk from scratch.He walks...
Anna Filina has a new post to her blog about her participation in the "Sexism in Tech" podcast that was recently released on the "Voices of the ElePHPant" podcast.I had the pleasure of discussing with fellow members of the PHP community a very sensitive topic: sexism in tech. I have been invited to a special episode of Voices of the ElePHPant with Elizabeth (Beth) Tucker Long, Elizabeth (Liz) Naramore and Laura Thomson. Cal Evans was the host. The podcast's page features links for some of the topics...
In part two of his series (part one is here) on building RESTful interfaces, Satish Gopal talks about things like hypermedia and HATEOAS.This is part 2 of "Building RESTful services". In Part 1 we talked about Level 1 and Level 2 of the Richardson Maturity Model. [...] Now imagine if you had to [find the URI] for every single website, each having a different kind of document in a different custom format. The internet would certainly not be what it is today. Yet a majority of the APIs built today make us...
In this recent post to her blog, Lorna Mitchell shows how to use the Jira REST API (provided as a part of some of the newer versions of the tool) to create a "dashboard" of the latest items added to the tracker.Today what you get is an example of integrating with JIRA's REST API, because their recent "upgrade" locked me out of the issue listings pages completely and I really do need to be able to see a list of bugs! Their bug editing screen is quite usable, so it's just the list that I need here, but you...
Part 4 of the PHP's Source Code for PHP Developers series is up over onA Nikic's Blog. A In it, he discusses how arrays are handled in PHP internals. A He talks a lot about hash tables and symbol tables, and how they work together to make PHP a working language. A Part 5 will be back over here, and we'll talk about objects and classes! A Enjoy!
On the Liip blog there's a recent post looking at table inheritance with Doctrine, the popular PHP ORM tool. In the post, Daniel Barsotti talks about a database model that needed some updating due to their searching needs.Our first idea, and it was not that bad, Drupal does just the same, was to have a database table with the common fields, a field containing the type of item (it's either an event or a blog post) and a data field where we serialized the corresponding PHP object. This approach was ok...
|
|