news categories
Some of the newsfeeds can be viewed by category; choose one of the subjects below.Tech- & Geek news
News 4 (techs &) geeksTechnology news
Linux
Linux newsLinux Central headlines
Linux software announcements
Linux tips'n'tricks
Other OS'es
BEOS softwareBSD news
Mozilla
Mozilla relatedIT
SECURITYTelephony/VOIP
Networks
Internet Technology News
Webdev
WebdevelopmentWebdev::css
Webdev::javascript
WHO news
WHO newsfeedsDutch news
Dutch newsDutch weblogs
Dutch weblogsMore dutch weblogs
Podcasts
Dutch podcastsradiocast.nl
PHPDeveloper.org
url: http://www.phpdeveloper.org/PHPDeveloper.org aims to be one of the leaders in up-to-the-minute PHP News, views and community. The world of PHP changes fast, and a new release could be just around the corner - get the latest at PHPDeveloper.org!
Sean Coates' Blog: Use `env`
Sean Coates has posted a reminder for PHP developers (and really anyone executing command-line scripts) to use "env" instead of hard-coding the path to the PHP interpreter.
These [support] scripts often run PHP in Gimme Bar land, and we make extensive use of the shebang syntax that uses common Unix practice of putting #!/path/to/interpreter at the beginning of our command-line code. Clearly, this is nothing special -lots of people do exactly this same thing with PHP scripts. One thing I have noticed, though, is that many developers of PHP scripts are not aware of the common Unix(y) environment helper, env.
The "env" alias makes use of your currently defined include path to track down a PHP binary to use to execute the script. Since there's only a "best practices" approach to places to put PHP on a server, the "env" usage makes your script more portable and it's one less thing to remember to change.
If you distribute a PHP application that has command-line scripts and shebang lines, I encourage you to adopt the practice of making your shebang line "#!/usr/bin/env php". Note that this doesn't just apply to PHP of course, but I've seen a definite lack of env in the PHP world.
Gonzalo Ayuso's Blog: Database connection pooling with PHP and React (node.php)
In this latest post Gonzalo Ayuso his recent experiences with <1 href="http://nodephp.org/">React (Node.js in PHP) and an example of how he worked up a script to pool database connections.
Last saturday I meet a new hype: "React" also known as "node.php". Basically it's the same idea than node.js but built with PHP instead of javascript. [...] Basically I want to create a database connection pooling. It's one of the things that I miss in PHP. I wrote a post here some time ago with this idea with one exotic experiment building one connection pooling using gearman. Today the idea is the same but now with React.
He includes the sample script, also including the line to add to your composer.json file to install React and the SQL to create the sample tables. The script makes a PDO connection and assigns it to the pool, an instance of his "CPool" class. If you want to try it out, you can find the code over on github.
Mike Purcell's Blog: PHPUnit - Upgrade - Convert assertType to assertInternalType
In this quick post to his blog, Mike Purcell mentions the deprecation of the "assertType" assertion and includes some code you can add to correct the issue in your tests.
We recently upgraded phpunit from a very old version to the current 3.6.x version (at time of writing). During the upgrade I noticed that assertType is no longer supported in many of our tests which were testing if something was a string, an array, or an object. So I had to write a quick script to update assertType to assertInternalType and figured I would post it for others if they needed to do the same.
The code goes into each of your tests (recursively) and finds the places where the "assertType" assertion is used and replaces it with its newer cousin "assertIntrnalType".
PHPMaster.com: REST - Can You do More than Spell It? Part 4
PHPMaster.com has posted the latest tutorial in their series covering RESTful APIS - part four of "REST - Can you do More than Spell it?" In this latest part of the series, they focus on something very key to RESTful services, the HTTP spec (and headers).
We're getting close to the end now, and the only thing remaining is to discuss a little more about the protocol you'll most likely use in any RESTful application that you write. Because HTTP is so often used with REST, that's the protocol I'd like to focus on.
He goes through the structure of a typical (raw) HTTP header and talks about some of the more common headers and what actions/settings they represent. He includes examples of setting headers (with header, naturally) and a curl example showing how to set the request headers. The tutorial is finished off with a brief mention of custom HTTP headers and the the good and bad that comes with them.
Community News: Latest PEAR Releases for 05.21.2012
Latest PEAR Releases:
- Mail_Mime 1.8.4
- PHP_CodeSniffer 1.3.4
- Text_PathNavigator 0.2.0
- Image_GIS2 0.1.0
- Services_Libravatar 0.2.1
Site News: Job Postings for the week of 05.13.2012
Job postings for the past week:
Reddit.com: Protecting against attack?
In this recent post to Reddit.com, the question of application security is asked - the poster wants recommendations on how he should keep his app safe from would-be attackers:
I can code fairly well in PHP these days, but my security isn't so hot. Is there a tutorial or plugin you guys can recommend as to how I should be protecting my php pages/inputs? I want to avoid common attacks like XSS, inputs with NULL or DROP TABLE etc?
Responses on the post include recommendations related to:
- Using the Chorizo scanner to find common issues in your code
- Using PDO for database connections (with bound parameters)
- Not trusting "$_SERVER"
- Data sanitization
There's also links to a few other resources with more details.
Project: Gitlist - A Git Repository Viewer (based on Silex & Twig)
Klaus Silveira has submitted a project he's been working on to make browsing through git repositories a bit simpler with a local tool - gitlist.
GitList is an elegant and modern web interface for interacting with multiple git repositories. It allows you to browse repositories using your favorite browser, viewing files under different revisions, commit history, diffs. It also generates RSS feeds for each repository, allowing you to stay up-to-date with the latest changes anytime, anywhere. GitList was written in PHP, on top of the Silex microframework and powered by the Twig template engine. This means that GitList is easy to install and easy to customize. Also, the GitList gorgeous interface was made possible due to Bootstrap.
Since it's just a PHP-based application, installing it is as easy as cloning the source to a web-accessible directory and setting up a "config.ini" file with your settings. You can find out more about this project based on the popular Silex microframework on its GitHub page.
Nerdery Blog: Minnesota PHP User Group (May 2012 Meeting) Recordings
On the Nerdery blog today there's a new post about the recent Minnesota PHP User Group's latest meeting where the topics were "When SQL Meets Developers" and "Message Queues & Distributed Job Processing".
In their May meeting, the Minnesota PHP User Group heard two talks on "When SQL Meets Documents" [above] and "Message Queues & Distributed Job Processing" [below]. MNPHP meets once a month at The Nerdery's office in Bloomington.
Both of the presentations were recorded - you can find the videos over on Vimeo: SQL Meets Developers and Message Queues.