2012年12月31日星期一

Community News: Latest PEAR Releases for 12.31.2012

Latest PEAR Releases:

Community News: Packagist Latest Releases for 12.31.2012

Recent releases from the Packagist:

PHPMaster.com: Adding Text Watermarks with Imagick


On PHPMaster.com there's a recent tutorial from Martin Psinas about how you can add text to an image with the help of Imagick, the image editing software that's available to PHP via an extension.



In a previous article, Timothy Boronczyk wrote about how to create watermarks with Imagick using an overlay image. In this article, I'll show you how to achieve a similar effect using plain text.


He takes a sample image (a headshot) and offers two versions of the same functionality - both the shell command (using "convert") and the PHP code that sets up the font to use, adds placement and pushes the result back out as a PNG. He also includes two other types of overlay - a font mask for a more see-through look and a tiled version, overlaying the text all over the image.

Stuart Herbert: Personal Thoughts On The PSR-3 Log Proposal


In his latest post, Stuart Herbert has shared some thoughts about the recently proposed PSR-3 proposal for a unified logging interface for PHP projects.



PSR-3 is a proposed standard (voting has finished, it should appear as an accepted standard when the PSR folks recover from too much Christmas turkey) describing a common logging interface for PHP frameworks. It's based on a small subsection of RFC 5424, which describes the Syslog standard, which is a very sensible choice. Sysadmins think in terms of Syslog levels, and they utterly hate dealing with loggers that don't map cleanly onto Syslog.


He briefly introduces the PSR and the format of the logger with some of the main methods it should implement and what they do. He talk gets into some of his critiques about the proposal, namely the method naming, the exception handling parameter and the proposed LogLevel constants.

2012年12月28日星期五

Site News: Popular Posts for the Week of 12.28.2012

Popular posts from PHPDeveloper.org for the past week:

Community News: Packagist Latest Releases for 12.28.2012

Recent releases from the Packagist:

EngineYard.com: Cloud Out Loud - Future of PHP (ZF2 & CakePHP)


Engine Yard has recently posted two podcasts looking at the "Future of PHP" as it relates to two of the popular PHP frameworks out there - CakePHP and Zend Framework 2, as interviewed by Davey Shafik.



The first episode is an interview with some of the core ZF2 contributors about the framework and where they think it's headed. They cover the planned roadmap, targets for next year involving PHP 5.4 and 5.5 as well as how it compares to other frameworks out there today.



In the second episode Davey talks with some of the core contributors (and big fans) of the CakePHP framework. They talk about the current state of the framework, changes in the upcoming version and what it's like working with the PHP-FIG (framework interoperability group).



You can listen to each of these via their in-page players or drop their RSS feed into your reader and get these and the latest episodes of the "Cloud Out Loud" podcast as soon as they're released.

Phil Sturgeon: Arguing on the Internet


In his latest post Phil Sturgeon shares some thoughts in response to this article from Shawn McCool about the "death of CodeIgniter", citing a few specific points.



I have referenced Shawn McCool's blog a few times, "Why CodeIgniter is Dead" and people are wondering why I argued so hard against it back in May but then gave CodeIgniter such a hard time in my last article. For the record I'm not team CodeIgniter or team Laravel, I'm a PHP user who has some opinions, and some of those opinions change over time - which is fair enough.

He goes through several of Shawn's points including:



  • Comments about best practices in CI (or lack of)
  • Modularity/design pattern use
  • The implementation of modules/sparks
  • The community contributions to the Reactor project
  • Dropping PHP4 support


Phil also notes that, just because something isn't making significant progress, it doesn't mean it's dead in the water:



Dead insinuates being closed right down. Repo removed, or just nothing is ever tagged again. Where CodeIgniter sits is closer to Smarty. Smarty is still active and has it's last stable release 2 months ago. It just hasn't changed much in years and probably never will.

2012年12月27日星期四

Site News: Blast from the Past - One Year Ago in PHP

Here's what was popular in the PHP community one year ago today:

Community News: Packagist Latest Releases for 12.27.2012

Recent releases from the Packagist:

John Cleary: 12 TDDs of Christmas


In an effort to spread the good practices that TDD (test-driven development) can bring to your development, John Cleary has proposed what he's calling this "12 TDDs of Christmas" for the end of the year. The goal is to get you doing TDD, one piece at a time, and seeing the benefits.



So here is the challenge. Starting Wednesday 26th Dec and for the following 12 days I'm going to do just one kata per day. I'm calling it the 12 TDDs of Christmas and it would be pretty cool if a few other people out there took up the challenge with me 0 fancy it?


The 12 days started on December 26th, so there's a little catch up work to do, but you're not too far behind. The "katas" are short problems to solve that only require a bit of code to get working. The idea, though, is that you practice with the test-first methods and use these examples as the assertions.

PHP.net: PHP 5.5.0 Alpha2 released


If you'd like to help with testing for the upcoming PHP 5.5.0 version, they've announced the release of the latest alpha on the PHP.net site, ready for download and test execution.



The PHP development team announces the immediate availability of PHP 5.5.0alpha2. This release adds new features and fix some bugs from alpha1. All users of PHP are encouraged to test this version carefully, and report any bugs in the bug tracking system.


You can see the full list of the changes in 5.5.0 (so far) in the NEWS file including things like using empty on return values, enabling systemtap by default for dtrace probes and optimized variable accessing. They need your help to make this upcoming release even better, so if you'd like to help out and test, go grab the download (Windows builds).

2012年12月26日星期三

PHPMaster.com: What's New in Zend Framework 2


On PHPMaster.com there's a new tutorial introducing you to Zend Framework v2:



When I started writing for PHPMaster, my first article was about Zend Framework. Since then, the framework has released version 2 stable. Apart from the name, version 2 is really a new project compared to the older version; ZF has been totally rewritten. In this article I'll give you an overview of the new features and the changes that have been introduced.


The article talks about introductory things like getting the framework installed (via a few methods, like Composer) and how the autoloader works with the file/namespace structure. They also talk about the dependencies that come with the framework and the event manager, one of the most powerful parts of the framework.

Community News: Latest Releases from PHPClasses.org

Community News: Packagist Latest Releases for 12.26.2012

Recent releases from the Packagist:

Paul Reinheimer: XHGui and MongoDB


Paul Reinhemier has written up post sharing his creation of the code to get XHGui working with MongoDB.



Mark Story & I are pleased as punch to introduce XHGui on MongoDB. Our goal was to get as close to the original feature set of the tool I worked on a few years ago (which leveraged the starting point provided by Facebook) and then to release what we had. What we've got now works; there's still a good distance to go, but we think it's far enough that we can ask for help form the community at large.


The tool collects XHProf data and stores it into a MongoDB database and allows you to view recent activity. There's a few warnings that he includes with the post, so be sure to read those through if you plan on using the tool.

2012年12月24日星期一

Community News: Latest PEAR Releases for 12.24.2012

Latest PEAR Releases:

Community News: Packagist Latest Releases for 12.24.2012

Recent releases from the Packagist:

Nikita Popov: Cooperative multitasking using coroutines (in PHP!)


Nikita Popov has a new post to his blog about a new feature that will be coming in PHP 5.5 and how to use them, coroutines and generators, in an example application.



Coroutines on the other hand have received relatively little attention. The reason is that coroutines are both a lot more powerful and a lot harder to understand and explain. In this article I'd like to guide you through an implementation of a task scheduler using coroutines, so you can get a feeling for the stuff that they allow you to do. I'll start off with a few introductory sections. If you feel like you already got a good grasp of the basics behind generators and coroutines, then you can jump straight to the "Cooperative multitasking" section.


He starts with a look at generators, a piece of functionality that will allow PHP to, for example, more easily create iterators "on the fly." He then moves on to coroutines, added functions that you have two-way communication with generators instead of just pulling data from them. With the basics out of the way, he gets into the "cooperative multitasking" and a sample socket-based server he implements using some of the concepts.

Joshua Thijssen: Debugging remote CLI with phpstorm


Joshua Thijssen has a recent post for all the PHPStorm users out there (or maybe investigating a new IDE) and are looking for a way to debug your PHP apps easily with XDebug. Well, he's come up with a step-by-step guide to help you get it all set up and working, complete with screenshots. He helps you debug command-line applications, but the setup will work for your web apps too.



Even in these days, with full-featured PHP IDEs around, I still see PHP developers using var_dump() and die() to debug their code. Not only is this a very bad way of "debugging", it has other dangers as well [...]. We've probably all been there,.. But we don't have to. Debugging your code properly through an IDE is quite easy, but one of the major problems is debugging CLI code. Since many frameworks like Zend, Symfony and micro-frameworks like Cilex can be used to create command-line apps, cronjobs and even "deamons", so how do we easily debug this kind of code?


He starts with the setup of a development instance (he recommends a clone-able virtual machine environment) and shows how o configure both XDebug and PHPStorm to work together happily. He shows what configuration options and steps you'll need to take to be able to debug the CLI apps too, including a command-line option to specify the IP to report the debugging into back into.

2012年12月21日星期五

PHP.net: PHP 5.4.10 and PHP 5.3.20 released!


The PHP project has officially released versions 5.4.10 and 5.3.20 if the language:



The PHP development team announces the immediate availability of PHP 5.4.10 and PHP 5.3.20. These releases fix about 15 bugs. Please note that the PHP 5.3 series will enter an end of life cycle and receive only critical fixes as of March 2013. All users of PHP are encouraged to upgrade to PHP 5.4.


Downloads are available here (source) or here for Windows installations. The Changelog has the full list of bugs fixed these two releases. If you're interested in the migration from PHP 5.3 to 5.4 and are wondering what changes you can expect, check out this migration guide with a list of the new features and changes.

Site News: Popular Posts for the Week of 12.21.2012

Popular posts from PHPDeveloper.org for the past week:

Community News: Packagist Latest Releases for 12.21.2012

Recent releases from the Packagist:

Rafael Dohms: Being an Enabler


In this recent post to his site, Rafael Dohms presents an interesting idea for leaders of groups to consider as a role for themselves (or people maybe wanting to move into something like that) - being an "enabler" instead of just a "leader".



This was discussed in our PHPSP UG and we tried to think of different structures to get past these issues, some ideas came and went but I also left and moved to Amsterdam. As it happens my community-drive did not stop and I started to feel that old itch, and ended up causing the start of AmsterdamPHP. [...] So we do not have leaders, we just have a group of enablers, people who want to help, or do, or have great ideas or contacts, and that seems to be a great title and description for what we are doing. It removes those misconceptions and it opens space for anyone to be an enabler, all the time, some of the time, whenever they want. It still gives credit where credit is due and it allows the people who deserve to help the group find a direction do exactly that.


He notes that by not trying to fill the traditional conceptions of a "leader" role and being more of the "guiding people" kind of person, you can sometimes do more to help others find their passion.



I have really come to love the title and all the "meaning" it holds, maybe it even takes the pressure off the usual labels and let's us focus on breaking down barriers.

Vance Lucas: Introducing Bullet: The Functional PHP Micro-Framework


Vance Lucas has a new post to his site sharing at a project he's been working on, a micro-framework for PHP that takes a functional approach to its structure (and the structure of the apps you can make with it), Bullet.



Bullet is a new PHP micro-framework with a unique functional approach to URL routing that allows for more flexibility and requires less verbosity than the more typical full route+callback approach found in other micro-frameworks. The main problem with most micro-frameworks and even full-stack MVC frameworks that leads to code duplication is that the callback or method executed to perform the action and respond to the URL route lives fully within its own scope. This means that you are forced to repeat a lot of setup code across URL route handlers that load the same resource, authorize it, etc.


He illustrates with an example of a GET/DELETE to the same routes and having to create multiple handlers for each. He restructures this with Bullet and shows how it can nest callbacks inside of handlers to make for simpler routing. It also scopes down requests and gets more fine grained as you nest, making it easier to create reusable handlers (like in other files). If you're interested in finding out more about Bullet and its structure, you can find it in the project's main site.

Matt Frost: Mocking SoapClient


Matt Frost has shared some of his work he's done with the SoapClient in PHP and how he mocked it out for his unit tests (since it's an external resource).



The concept of mocking web services for testability took a little while to sink in for me. A big part of it was that my job doesn't see me consuming web services all that often, but I had an opportunity to give it a shot with SOAP. I found that I learned a lot more about testing in general having worked through this. I used SoapClient and wrapped it, so here's a little bit about some of things I learned. Hopefully you don't have to work with SOAP, but if you do you can test it pretty easily.


He walks through the mocking of the client itself and how he handled it's ability to translate function calls into SOAP method calls (using "__call") and how he mocked that. He also makes the suggestion that you actually wrap the SoapClient inside of another class rather than trying to mock the actual SoapClient. He also touches on the testing of exceptions that might be thrown by the service and how he tested those using his wrapper class.

2012年12月20日星期四

Site News: Blast from the Past - One Year Ago in PHP

Here's what was popular in the PHP community one year ago today:

Community News: Packagist Latest Releases for 12.20.2012

Recent releases from the Packagist:

Community News: Atlanta PHP Jan 2013 Meeting - Current Trends of the PHP & Open Source Job Market


The Atlanta PHP User Group has announced their January 2013 meeting, a loo at the "Current Trends of the PHP and Open Source Job Market" (from Ari Waller):



The presentation will be an overview of the current employment market and outlook specifically for PHP developers (as well as other Open Source related Open Source trends), based on the current supply and demands in the market place, as well as career oriented topics via Q&A (Resumes, Interviews, and overall job hunting tips and strategies). Ari will cover a year by year comparison from his previous talk and discuss changes and new trends going into 2013. He will also discuss how to work with recruiters as effectively as possible (if at all), as well as questions you have always wanted to ask regarding the the inner workings of IT Staffing.


Despite it being presented by a recruitment company, they have promised an open and honest conversation about the topic, not a sales pitch. If you'd like to attend, check out this page on the Atlanta PHP site for more information - including a new meeting location.



Have a user group meeting or event you'd like announced? let us know!

Brandon Savage: "Do This, Not That" Now Available!


Brandon Savage has officially released his book, "Do This, Not That" - a book targeted at beginners to the PHP language, trying to teach them best practices for some of the most common situations they might come across.



Too many books on best practices read like a manual. They are dry, boring and cover topics that you don't care about. "Do This, Not That" is different. A collection of essays, it highlights those areas for which best practices are either not well known or not well defined. It offers clear solutions that will be easy to implement. I've taken the time to research and identify what I feel are the best practices, and condensed it into a two hour read that will leave you feeling empowered, not exhausted.


If this sounds interesting to you, you can pick up a copy on the official site for about $30 USD and, if you're more of a try-before-you-buy sort, you can read a sample chapter covering type hinting.

2012年12月19日星期三

Community News: Latest Releases from PHPClasses.org

Community News: Packagist Latest Releases for 12.19.2012

Recent releases from the Packagist:

Chris Hartjes: So You Want to Write Tests


Chris Hartjes has written up a new post for his site, So you want to write tests, giving a good overview of some of the things you'll need to consider when wanting to move into a more test-friendly development world.



I often get asked for some advice on how to get started with writing tests for your PHP code. It's a fair question, since I am presenting myself as an expert-ninja-rockstar-sensei-opinionated-egomaniac on the topic. I often struggle with coming up with an answer that can fit into the 140 characters available via Twitter, but clearly this is not a good strategy. As an early Christmas 2012 present to all my loyal followers, who put up with my never-ending stream of nonsense and provide a slowly-increasing portion of my income, here are my thoughts on how to get started with testing your PHP code.

He offers a list of suggestions, each with a bit of explanation:



  • Learn how to recognize untestable code
  • Keep learning the language
  • Chain units of code together for greatness
  • Start asking "how am I going to test this?"
  • Stop people from pushing code without proof it's fixed
  • Stop people from doing things manually
  • Stop using tools without test suites
  • Always wonder if you're doing it right

Community News: php|tek 2013 Announced (with Open Call for Papers)


php|architect has officially announced their php|tek conference for next year (2013) happening in Chicago, Illinois May 14th through 17th. Additionally, they've also opened their Call for Papers!



So we've been hearing rumors that tek13 wasn't even going to happen this year. Nonsense! We've been extremely busy behind the scenes getting organized as we've been working on the transition of the PHP|architect brand from Blue Parabola to Musketeers.me. Eli, Sandy, Oscar, and Kevin are planning on carrying on the great tek tradition of quality content and community that we're all used to from the BP crew!


The conference will be happening at the usual location just outside of Chicago, near the airport. Registration isn't open quite yet, but the pricing for this year's event has already been posted (including Blind Bird and Early Bird prices). Additionally, if you our your organization are interested in sponsoring the event, you can find out more here.



The Call for Papers will close on January 15th, so be sure and get those submissions in soon!

Eric Holk: How Do We Read Code?


There's an interesting post on Eric Holk's blog talking about how we read code - a look at the results from a psychology experiment that tracked the viewer's eye movement as they scanned through code (complete with video).



The goal is to figure out some way of measuring what features in programming systems help programmers understand wht they are doing, and how this can be used to make systems that lead to higher quality software. Mike is currently running an experiment where he shows people several short Python programs and asks them to tell the output of the program. The test subject is sitting in front of an eye tracker, so afterwards Mike can see where you were looking at various times during the experiment.


The results are pretty interesting and Eric likens it to a sort of "just-in-time compilation" that the mind is doing as it reads through the code, not a straight forward read through. The timing of the read is interesting too, noting that once something is figured out, it's run through faster the following times.



One aspect he's interested in is how the approach of inexperienced programmers differs from that of experienced programmers. For example, there seems to be some evidence that following variable naming conventions helps experienced programmers understand the code much quicker, while breaking these conventions leads to a severe penalty. On the other hand, inexperienced programmers seem to take about as long regardless of how the variables are named.


This study is still going on and, if you're in the Bloomington, Indiana area and would like to lend your eyes to the cause, send an email over to Mike Hansen (more on the subject on his blog here).

2012年12月18日星期二

Community News: php|architect Acquired by Musketeers.me


If you've been around the PHP community for any length of time (or even at all it seems) you've probably heard of or seen something about php|architect - the magazine, their training and even their popular annual conference, php|tek. News came out yesterday that the php|architect group has been acquired by Musktreers.me (several of which happen to be well-known PHP community members).




Over the course of the last ten years, our focus has always been education-not just of our readers and customers, but also our own. We taught ourselves about publishing, organizing events, training, and dealing with people from all walks of life. Many of the things we learned were fun, and some not so much; all were very interesting. Most of all, we have learned to rely on the PHP community, which we watched grow and evolve alongside our favourite language.



[...] Thus, as the end of our first decade in business approaches and we have decided that we must move on, it's important for us to know that php|architect will remain in good hands. We are happy to announce that, effective January 1st, Musketeers.me LLC will take over the php|architect brand and all activities associated with it, including our magazine, books, training, and events.




You can find some more personal reflections from other members of the php|architect staff on their own blogs - Marco Tabini and Beth Tucker Long - and the official mention on the Musketeers.me blog.

Community News: Latest PECL Releases for 12.18.2012

Latest PECL Releases:

Community News: Packagist Latest Releases for 12.18.2012

Recent releases from the Packagist:

Pro Developer: FuelPHP history and future


On the Pro Developer site today there's a new post looking at the past and future of FuelPHP a framework started by Dan Horigan and Phil Sturgeon (who have both since left the team).



FuelPHP was first framework which used namespaces and was production ready at the same time. Small footprint, flexibility, namespaces, modularity and other gears make this framework great for building web applications. [...] For FuelPHP team 2012 was year with ups and downs. Dan Horigan was not available for his team members few months and no one didn't know where he was. He show up on the twitter and then he was unreachable again. WanWizard (Harro Verton) and Jelmer Schreuder were most active at the building FuelPHP core and they done a great job.


He takes a look at the road ahead (FuelPHP v2) and the work that's already been done on it. He also notes that another of the core team members has left the FuelPHP development group a few days ago and that there were some things about the framework he no longer liked. The post suggests looking into something like Laravel (v4, not yet released) if you're shopping for a new framework. He does note that, while the future of FuelPHP may be rocky, it is a stable framework and is still a solid choice for a platform (especially if it's already in use).

/Dev/Hell Podcast: Episode 24 - Members Only


The /Dev/Hell podcast has released their latest episode - Episode 24 - Members Only (hosted by Chris Hartjes and Ed Finkler):



Special guest Matt Turland joins us for episode 24, and tells us how much of an asshole Chris is in real life. We also talk a lot about team development processes, including ramping up new hires, documenting processes, and workflow tools. Lots of super smart stuff that we're usually too lazy to do.


You can listen to the latest show either using the in-page player or by downloading the mp3. You can also keep up with the latest on the podcast by subscribing to their feed.

2012年12月17日星期一

Community News: Latest PEAR Releases for 12.17.2012

Latest PEAR Releases:

Community News: Packagist Latest Releases for 12.17.2012

Recent releases from the Packagist:

Alex Inführ: PHP non alpha numeric 7 and 6 char code


Following along with the non-alpha PHP code that Gareth Heyes recently posted about, Alex Inführ has created some of his own using only dollar signs, underscores, equals, plus and parentheses.



I used the following charset: $_=+(); As you can see only 7 chars. In the end the function log will be created,because this won't exceed the memory limit. In the beginning I created the php function assert and it was 99 mb large php file, way too big to get executed.


He uses a few tricks to get the language to create strings (counting to infinity), changing the letters in the resulting string, He includes the steps in the process and a large block of the non-alpha PHP code at the end of the post, a 46KByte block that echoes "log(12)".

MaltBlue.com: Zend Framework 2 Core Concepts - Dependency Injection


In this new post Matthew Setter has posted about one of the core concepts behind the structure and use of Zend Framework 2, its use of dependency injection to handy object relationships and access (via Zend/Di).



As Zend Framework 2 is well and truly here, before some of us who are new to it dive right on in, whether you're completely new or, like me, migrating from Zend Framework 1, it's really important to ensure that we understand the core concepts on which it's based. [...] In this, the first part in the series, I'm going to go through what dependency injection (DI) is. However, as there are a number of great posts already available on the topic by some very experienced developers, [...] I'm not going to rehash them.


Instead he extracts out useful tips from posts of a few other sources on ZF2 and dependency injection in general: Matthew Weier O'Phinny, the ZF2 manual, Martin Fowler on dependency injection, Wikipedia and more. He also includes lots of links to more great articles on the subject, both ZF2-specific and for DI iin general.

2012年12月14日星期五

Site News: Popular Posts for the Week of 12.14.2012

Popular posts from PHPDeveloper.org for the past week:

Community News: Sunshine PHP Announces Speakers & Sessions!


The Sunshine PHP conference has officially announced their speaker and session lists for next year's event (happening in Miami, Florida February 8th and 9th, 2013).


The event will have a wide range of topics covered including:



  • Cryptography for the Average Developer
  • Continuous Integration in Real Life
  • Quickly Building and Deploying PHP Applications in the Cloud
  • Symfony2 + EmberJS for fun and profit
  • Introducing Tests in Legacy PHP Applications
  • Dependency Management with Composer
  • From POX to HATEOAS, Our Companies Journey to Build a Hypermedia API


Tickets are already on sale for the event - about $220 USD for the full event, $160 for a student pass.

Community News: Packagist Latest Releases for 12.14.2012

Recent releases from the Packagist:

Stan Lemon: Aura.Micro - Experimental Replacement for Silex


With all of the recent talk about the Aura framework that's been happening lately, Stan Lemon thought it would be interesting to see how a microframework based on the Aura packages would be to create. He's posted about his experiences on his site today.



I was recently working on a small project that used Silex. As I browsed my vendor folder, I realized how much extra "stuff" I had inherited with Silex. There were a bunch of other components required when all I wanted was some quick and easy routing, micro-framework style. When I think about going lean I always find myself coming back to Aura. Micro-frameworks are not a new to idea to Aura, so I wondered if I could take the elegance and ease of Silex by wrapping up Aura.Router and exposing it through a similar API.


The result of his work is Aura.Micro, a simple microframework that really just handles routing (unlike Silex with builds on the Pimple DI as well). He includes an example of it in use, defining several different kinds of actions on the routing like "before", "finish" and a few "get" routes.

Websanova.com: Timezones, the Right Way


On the Websanova.com site there's a recent post about doing timezones the right way when working with them in PHP and storing them in your (MySQL) database.



Timezones are actually a very trivial concept but they seem to be overlooked and over complicated. [...] Rather than storing a timezone with each date it's better to just accept a standard time to store all your dates with, thus doing the conversion to that standard time before storing the value in the database. It doesn't really matter what time we store it as, but it's generally a good idea to just use UTC+00:00.


They talk a little about what the UTC timezone is for those that may not know and show how to set it as the default timezone for your PHP application (with date_default_timezone_set or updating your php.ini). They also include the MySQL configuration option to set its default timezone and and example SELECT statement for extracting the data back out.

2012年12月13日星期四

Site News: Blast from the Past - One Year Ago in PHP

Here's what was popular in the PHP community one year ago today:

Community News: Packagist Latest Releases for 12.13.2012

Recent releases from the Packagist:

Gareth Heyes: Tweetable PHP-Non Alpha


Gareth Heyes has a new post that shares some of his efforts to write "non-alpha PHP", using characters other than the alpha-numeric ones to write executable PHP scripts. In his case, this involves a lot of pluses, underscores and square brackets.



I started to try and break the 10 charset limit of PHP non-alpha after @InsertScript showed me that PHP Dev supports [] syntax for arrays. I wondered if it would be possible to break the limit within production PHP. At first I thought you could but then after some testing I found that there was no way to concat without "." and no way to call a string as a function without $ and =. However since I got into PHP Non-alpha again I thought why not try and improve it and make the code tweetable.


He works through the whole process of his discovery - starting with the creation of a non-alpha version of "0" (zero), moving into letter creation and finally all the way up to a full word..."assert". The result is tweetable code that echoes that string and contains more symbols than letters. If you're interested in more of this non-alpha kind of coding, check out some of the other posts on his blog.

Joshua Thijssen: Introducing the REST cookbook


In an effort to share the REST-related information he's been helping people out with over time, Joshua Thijssen has created a new resource that's less about the basics of REST and more about how to handle specific situations - restcookbook.com.



This is why I decided to setup a simple website, that pretty much tries to answer any question about REST. It's not completed yet.. Actually, it hasn't got many posts to begin with :), but a start has been made and we will fill it with questions and answers about REST and HTTP issues.

As of the time of this post, it only has a few articles, but they're a good start like:


2012年12月12日星期三

Community News: Latest Releases from PHPClasses.org

Community News: Packagist Latest Releases for 12.12.2012

Recent releases from the Packagist:

Community News: Privates - Harmful or Useful? (Discussion)


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:




Various topics come up during these posts including static coupling, using interfaces versus inheritance, wrapper classes and developer intent.

Chris Jones: Excitement! Updated Underground PHP and Oracle Manual is Available for Download


As Chris Jones has posted on his Oracle blog, there's been a recent update to the Underground PHP and Oracle Manual with a complete refresh of content from more recent versions of the powerful database.



The Underground PHP and Oracle Manual is designed to bridge the gap between the many PHP scripting language and the many Oracle Database books available. It contains unique material about PHP's OCI8 extension for Oracle Database, and about other components in the PHP-Oracle ecosystem. It shows PHP developers how to use PHP and Oracle together, efficiently and easily.


Updates include new content related to the Oracle XE 11g release and the latest updates to their OCI8 extension for PHP. Other updates include information about using PHP with Oracle TimesTen, NetBeans and Oracle Tuxedo as well as getting PHP installed on the Oracle Solaris operating system.

2012年12月11日星期二

Community News: Latest PECL Releases for 12.11.2012

Latest PECL Releases:

Community News: Packagist Latest Releases for 12.11.2012

Recent releases from the Packagist:

PHPMaster.com: Action Automation with MySQL Triggers


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 what triggers are and how they're created on the database side (with an example syntax). They apply one to a more practical situation - helping keep data integrity on a revenue table based on the data inserted into an events tracking table. Their trigger ("CostCalc") calculates the time of the event on update and updates the revenue table with the correct cost. Also included is the sample PHP code (an "EventHandler") that updates the event records. The trigger fires transparently in the background with no need for the PHP script to make any additional calls.

Derick Rethans: Debugging Connections with the MongoDB PHP driver


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. The other improvement are changes to the MongoLog class.


He includes details on the information that comes back from the MongoDB "getConnections" call including the hash of the connection, the "last ping" time, connection type and a set of tags. He also shows how to enable the Mongolog logging, the levels of logging it allows and what kind of log messages you can expect it to output.

2012年12月10日星期一

Community News: Latest PEAR Releases for 12.10.2012

Latest PEAR Releases:

Community News: Packagist Latest Releases for 12.10.2012

Recent releases from the Packagist:

PHPMaster.com: Inversion of Control - The Hollywood Principle


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. [...] Not surprisingly, the process of inverting these responsibilities between components and the environment is formally known as Inversion of Control (or in a more relaxed jargon, The Hollywood Principle), and its implementation can be a real boost when it comes to developing extensible, highly-decoupled program modules.


He uses a set of domain objects (Posts and Comments in a typical blog structure) and the Observer pattern to show how mixed up things might get if the application isn't carefully coded. He takes this and updates it to include a "comment notification service" that implements the SplObserver and is attached to the post to be executed on an event (in this case, the setting of a new comment).

PHPClasses.org: Lately in PHP, Episode 30 - Will PHP 6 feature a JIT compiler?


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 Facebook PHP JIT compiler enhancements, and the new system of levels and missions of the PHPClasses and JSClasses sites.


You can listen to this latest episode either through their in-page player, by downloading the mp3 or by subscribing to their feed. You can also watch the video of the recording as well.