Lorna Mitchell has a new post showing nine of the magic methods that are included in PHP by default (like __construct, __get and __set) including a few you may not have used before.The "magic" methods are ones with special names, starting with two underscores, which denote methods which will be triggered in response to particular PHP events. That might sound slightly automagical but actually it's pretty straightforward, we already saw an example of this in the last post, where we used a constructor - so...
In this latest post to his site Anthony Ferrara take a look at templating in web applications - more specifically as it deals with his experience with the Mustache templating engine.I've been playing around with tempting engines a lot lately. For a recent project, I needed the ability to re-use the same template set in both JS and PHP (coupled with the History API, providing seamless dynamic behavior, yet still having raw content pages). Realistically today, there's only one choice for that sort of...
Brandon Savage has recently posted two blog posts portraying his opinion that using private visibility on class methods can be considered harmful in a lot of situations. While I understand the point he is trying to make, I can't say that I agree with it. I do like private visibility and think that it's actually under-used in a lot of software. But it's not because I think Brandon is wrong...Read more A»
Derick Rethans has a new post that the developers out there using MongoDB in their applications will find useful - a look at debugging your connections with the PHP driver (and what kind of information it can provide).In a previous article I already mentioned that the 1.3 version of the MongoDB driver has improved logging functionality to aid with debugging connection issues. I've already briefly introduced MongoClient::getConnections(), but it provides a bit more information than I have already shown....
There's been a few articles posted on various blogs in the PHP community recently about the "most correct" usage of the "private" scope in your PHP applications. As with any feature of just about any language out there, there's people on both sides of the fence. Here's the ones that have weighed in so far:
Brandon Savage's initial post (an excerpt from his upcoming "Do This, Not That" book)
A response to this from Anthony Ferrara
Brandon's own response to comments on his previous article
This new post...
I do not wholeheartedly believe that private methods are evil, or that they were mistakenly included in the PHP language by the core development team. Nor do I believe that there are only two true options when it comes to devising visibility requirements: public and protected. There is a place for private methods, in PHP [...]
For the MySQL users out there, PHPMaster.com has a new tutorial showing you how to use triggers in your database to perform automatic actions on things like "before update" or "after insert".By making MySQL do more work through triggers, the PHP side of my project was greatly simplified. So, it is the intention of this article to give you some insight into the creation and usage of MySQL triggers, so that by the end of this reading you can make use of them in your own projects.They start by explaining...
The guys at PHPMagazin have posted a followup question about the Aura Project for PHP. Here is our original English conversation. I'd like to follow up on the last point where we talked about other frameworks. I think that the a€¦ Continue reading a†'
Recent releases from the Packagist:campaignmonitor/createsend-php (v2.5.0)
bradstinson/assets (0.0.3, 0.0.2)
uam/tcpdf (2.0.2, 1.0.0)
Latest PECL Releases:
This post forms part of a series of articles about using PHP to do objected oriented programming, or OOP. They were originally published elsewhere but are no longer available at that location, so I'm reposting them here. Previously in the series was an introduction to OOP in PHP, in two parts
The title is a bit of a red herring as PHP has more than 9 magic methods, but these will get you off to a good start using PHP's magic methods. It might be magic, but no wands are required!
The "magic" methods are...
About a year ago, I wrote out some principles for web programming in PHP. I called it the MicroPHP Manifesto. The thing is, what I talked about wasn't really specific to PHP. So, I've decided to explore the concepts again in the context of the other languages I work with.
Debugging Connections with the MongoDB PHP driver
Tuesday, December 11th 2012, 10:13 JST
In a previous article I already mentioned that the 1.3 version of the MongoDB driver has improved logging functionality to aid with debugging connection issues. I've already briefly introduced MongoClient::getConnections(), but it provides a bit more information than I have already shown. The other improvement are changes to the MongoLog class.
I've been playing around withA temptingA engines a lot lately. For a recent project, I needed the ability to re-use the same template set in both JS and PHP (coupled with the History API, providing seamless dynamic behavior, yet still having raw content pages). Realistically today, there's only one choice for that sort of requirement: Mustache. I've learned a lot while playing with Mustache, and it's really changed my entire viewpoint on presentation layer construction.Read more A»
On 7PHP.com today they've posted their latest PHP community interview - the answers to their questions with Adam Culp, the organizer of the South Florida PHP User Group and Sunshine PHP Conference.In this edition I talked with Geeky Boy, [Adam Culp @adamculp], who is The Leader and Organizer of The South Florida PHP User Group (aka @SoFloPHP) and the organizer of the hot and buzz-ling SunShinePHP Conference for developers. @SunShinePHP will be held in Miami / Florida in feb 2013 and is promising a...
In his latest post David MÃ¼ller covers some of the things to consider when working with cross-domain ajax requests including CORS and iframes.As it is widely known, AJAX Requests are only possible if port, protocol and domain of sender and receiver are equal. [...] Having this cleared out, we will cover ways around this restriction.He covers three main approaches to allowing these cross-domain requests (and some of the security implications that can come with them):
CORS (Cross Origin Resource Sharing)...
A while back Brandon Savage mentioned a book he was writing ("Do This, Not That") to help PHP developers learn some of the best practices associated with the language. Today he's posted an excerpt from the book for your enjoyment.This great series of highly focused e-books will offer tips, tricks and best practices focused on core areas of PHP development, including databases, security, filtering, regular expressions, configuration and more. Since it will be a series of tightly targeted solutions,...
On the PHPClasses.org site they've posted the latest episode of their "Lately in PHP" podcast series - Episode #30, "Will PHP6 Feature a JIT compiler?"Now that Facebook made some progress with their PHP HipHop VM JIT compiler engine, some PHP core developers are considering having also a JIT compiler implementation of the official implementation based on LLVM, eventually in PHP 6. [...] They also commented on the first alpha release of PHP 5.5.0, proposals for having pure interfaces in the PHP core, the...
In this new tutorial on PHPMaster.com, Alejandro Gervasio looks at the Inversion of Control methodology and how it's more than just an abstract reference to dependency injection.Traditionally, application components have been designed to operate on and control the execution environment, an approach that delivers well to some extent. [...] Instead of making the module completely responsible for logging data to multiple endpoints, we can transfer the responsibility straight to the external environment....
Recent releases from the Packagist:guzzle/guzzle (v3.0.6)
ladela/personal-translations-widget-bundle (v0.2.2, v0.2.1, v0.2)
Latest PHP Tweets