News PHPDeveloper.org
2012-02-06 22:39:
Ben Selby has released a Sublime Text 2 plugin for the popular PHP-based documentation generation project DocBlox. It seems that the editor of the moment is Sublime Text 2 and sadly I have to tip my hat to Gary Rockett for showing it off to me one day.. Since that day, I've been a 100% convert. [...] So, I decided to peak into the PHPUnit [plugin from Stuart Herbert] to see if I could create a DocBlox Plugin. It turns out you have to write Plugins in Python, which is interesting, since I know very little python. There seemed to be enough code there to get me going, so I now have a working DocBlox Plugin. The result is a plugin that, once installed gives you a new context menu option to "Generate documentation" for the selected file. The console shows the progress of the build. You can get the plugin from Package Control or by grabbing it from github directly.
Ben Selby's Blog: DocBlox Plugin For Sublime Text 2
Ben Selby has released a Sublime Text 2 plugin for the popular PHP-based documentation generation project DocBlox. It seems that the editor of the moment is Sublime Text 2 and sadly I have to tip my hat to Gary Rockett for showing it off to me one day.. Since that day, I've been a 100% convert. [...] So, I decided to peak into the PHPUnit [plugin from Stuart Herbert] to see if I could create a DocBlox Plugin. It turns out you have to write Plugins in Python, which is interesting, since I know very little python. There seemed to be enough code there to get me going, so I now have a working DocBlox Plugin. The result is a plugin that, once installed gives you a new context menu option to "Generate documentation" for the selected file. The console shows the progress of the build. You can get the plugin from Package Control or by grabbing it from github directly.
2012-02-06 21:16:
On the PHPClasses.org blog there's a new post detailing an issue that came up in the PHP 5.3.9 release that caused a large security issue (PHP 5.3.10 has, however, already been released to correct the issue). PHP 5.3.9 release was mostly meant to fix a security bug, but it introduced a new more serious bug. PHP 5.3.10 was just released to fix this issue. [...] This time it is a bug that allows arbitrary remote code execution. This means that it allows to run arbitrary code on the server, injected by an eventual attacker, so it can be used to cause many types of damage inside a server. The upgrade to PHP 5.3.10 is highly recommended to prevent this issue from effecting your applications. The post also mentions the dropping of Suhosin support (a security plugin for PHP) on the Debian linux distribution's default installation and how the PHP community has reacted to the decision.
PHPClasses.org: Another Serious Security Bug on PHP 5.3.9
On the PHPClasses.org blog there's a new post detailing an issue that came up in the PHP 5.3.9 release that caused a large security issue (PHP 5.3.10 has, however, already been released to correct the issue). PHP 5.3.9 release was mostly meant to fix a security bug, but it introduced a new more serious bug. PHP 5.3.10 was just released to fix this issue. [...] This time it is a bug that allows arbitrary remote code execution. This means that it allows to run arbitrary code on the server, injected by an eventual attacker, so it can be used to cause many types of damage inside a server. The upgrade to PHP 5.3.10 is highly recommended to prevent this issue from effecting your applications. The post also mentions the dropping of Suhosin support (a security plugin for PHP) on the Debian linux distribution's default installation and how the PHP community has reacted to the decision.
2012-02-06 20:58:
In a new tutorial today from PHPMaster.com, they show you how to combine Javascript and a PHP feature to track the progress of an upload to your web application. A problem that has plagued web developers for years is how to add real-time information to their applications, such as a progress bar for file uploads. [...] JavaScript can access a file's name, type, and even the width and height of a local image, but it wasn't until HTML5 that it could access a file's size. [...] In this article I'll show you how [the session.upload_progress] feature can be used to create a simple upload progress bar without any external libraries or browser dependencies. The tutorial provides all the steps you'll need to get it working - defining the form with the extra required field, styling it and plugging the Javascript in to call a small script to get the progress of the upload. It returns the difference between the content-length of the file and the current size (as a percentage of 100).
PHPMaster.com: Tracking Upload Progress with PHP and JavaScript
In a new tutorial today from PHPMaster.com, they show you how to combine Javascript and a PHP feature to track the progress of an upload to your web application. A problem that has plagued web developers for years is how to add real-time information to their applications, such as a progress bar for file uploads. [...] JavaScript can access a file's name, type, and even the width and height of a local image, but it wasn't until HTML5 that it could access a file's size. [...] In this article I'll show you how [the session.upload_progress] feature can be used to create a simple upload progress bar without any external libraries or browser dependencies. The tutorial provides all the steps you'll need to get it working - defining the form with the extra required field, styling it and plugging the Javascript in to call a small script to get the progress of the upload. It returns the difference between the content-length of the file and the current size (as a percentage of 100).
2012-02-06 19:03:
The /dev/hell podcast has released their latest episode with special guest Brian Moon (of dealnews). In our fifth episode we speak to our first ever guest Brian Moon, ancient PHP elder of dealnews and someone who has probably forgotten more about PHP than our two hosts will ever know. [...] In this episode we talk about dealnews, how they use PHP (and how they also use it in some interesting ways), and his thoughts on issues like concurrency and evented systems. We also cover features of PHP that allowed for some major changes and approaches they used in the code base for the site. Other technologies discussed include Gearman, Node.js, Squid and Varnish. You can listen to this latest episode either via the in-page player or by downloading the mp3 directly.
/Dev/Hell Podcast: Episode 5 - The Hammer That Is PHP
The /dev/hell podcast has released their latest episode with special guest Brian Moon (of dealnews). In our fifth episode we speak to our first ever guest Brian Moon, ancient PHP elder of dealnews and someone who has probably forgotten more about PHP than our two hosts will ever know. [...] In this episode we talk about dealnews, how they use PHP (and how they also use it in some interesting ways), and his thoughts on issues like concurrency and evented systems. We also cover features of PHP that allowed for some major changes and approaches they used in the code base for the site. Other technologies discussed include Gearman, Node.js, Squid and Varnish. You can listen to this latest episode either via the in-page player or by downloading the mp3 directly.
2012-02-06 18:42:
On the Mayflower blog today there's a new post sharing a Zend Framework application.ini "cheat sheet" with links to pages in the ZF manual explaining the details about each of the front controller options. All this is long gone in the past since the introduction of Zend_Application and the bootstrapping resource adapters. Zend introduced a standard bootstrapping mechanism into their framework. Many of the options from different framework components can now be configured in the applications configuration file application.ini. One problem persists although: the documentation. All the parameters for components like View, Session, Database etc. are documented either with the bootstrap resource, the component itself or both. They've posted it to github complete with sections detailing: CacheManager Db FrontController Layout Navigation Router Translate ...and quite a few more. This is a great reference for anyone using the Zend Framework, no matter your experience level.
Mayflower Blog: Zend Framework Application.ini Cheat Sheet
On the Mayflower blog today there's a new post sharing a Zend Framework application.ini "cheat sheet" with links to pages in the ZF manual explaining the details about each of the front controller options. All this is long gone in the past since the introduction of Zend_Application and the bootstrapping resource adapters. Zend introduced a standard bootstrapping mechanism into their framework. Many of the options from different framework components can now be configured in the applications configuration file application.ini. One problem persists although: the documentation. All the parameters for components like View, Session, Database etc. are documented either with the bootstrap resource, the component itself or both. They've posted it to github complete with sections detailing: CacheManager Db FrontController Layout Navigation Router Translate ...and quite a few more. This is a great reference for anyone using the Zend Framework, no matter your experience level.
2012-02-06 17:05:
Stuart Herbert has officially released a plugin for the popular text editor Sublime Text 2 to integrate PHPUnit support directly into the editing environment. Sublime Text 2 is a new cross-platform text editor that I've recently switched to. It's still in public beta, but already offers better performance (and battery life!) and a better look (fonts that render properly!) than Java-based IDEs such as Netbeans. One thing it didn't have was support for PHPUnit, so I've made a plugin. It's available to install via Package Control. The plugin allows you to directly create tests for a class using a context menu's "Test This Class" option. You can also run the tests directly from the editor and use either the menu or direct text commands to control it. He's also gathering some other well-used PHP snippets into another related plugin, the Additional PHP Snippets plugin.
Stuart Herbert's Blog: PHPUnit Plugin For Sublime Text 2
Stuart Herbert has officially released a plugin for the popular text editor Sublime Text 2 to integrate PHPUnit support directly into the editing environment. Sublime Text 2 is a new cross-platform text editor that I've recently switched to. It's still in public beta, but already offers better performance (and battery life!) and a better look (fonts that render properly!) than Java-based IDEs such as Netbeans. One thing it didn't have was support for PHPUnit, so I've made a plugin. It's available to install via Package Control. The plugin allows you to directly create tests for a class using a context menu's "Test This Class" option. You can also run the tests directly from the editor and use either the menu or direct text commands to control it. He's also gathering some other well-used PHP snippets into another related plugin, the Additional PHP Snippets plugin.
2012-02-06 16:27:
In a new post to his blog Joshua Thijssen gives a guide to how he usually sets up his development environments when working in PHP. It includes working with virtual machines, configuring DNS and setting up his tools to work with it all. Doing development on multiple projects can be a burden from time to time. One project would be running on PHP 5.3, while another still needs 5.1. Sometimes you need a MySQL server, while on other occasions, you need a NoSQL solution like couchDB or MongoDB together with all kind of gearman functionality. This article shows you how I've setup such a development platform that allows you to quickly create new projects, and still maintain flexibility when you need it. He uses VirtualBox with either a Debian or CentOS installation as a base platform. He uses Vagrant to set up and configure the machines to make setup almost automatic. He still has to go in and configure a few things like the VirtualHost and DNS settings for the site/application he's working on. Next up is setting up the tools he uses, specifically XDebug and setting up his editor of choice (PHPStorm) for remote debugging.
Joshua Thijssen's Blog: Setting up a development environment
In a new post to his blog Joshua Thijssen gives a guide to how he usually sets up his development environments when working in PHP. It includes working with virtual machines, configuring DNS and setting up his tools to work with it all. Doing development on multiple projects can be a burden from time to time. One project would be running on PHP 5.3, while another still needs 5.1. Sometimes you need a MySQL server, while on other occasions, you need a NoSQL solution like couchDB or MongoDB together with all kind of gearman functionality. This article shows you how I've setup such a development platform that allows you to quickly create new projects, and still maintain flexibility when you need it. He uses VirtualBox with either a Debian or CentOS installation as a base platform. He uses Vagrant to set up and configure the machines to make setup almost automatic. He still has to go in and configure a few things like the VirtualHost and DNS settings for the site/application he's working on. Next up is setting up the tools he uses, specifically XDebug and setting up his editor of choice (PHPStorm) for remote debugging.
2012-02-06 15:47:
7php.com has posted a new interview with a PHP community member today - this time it's Ivo Jancsh (formerly of Ibuildings) now CEO at Eginiq, a mobile development company. In this edition I talked with Ivo Jansch (@ijansch) ex-CTO of Ibuildings which is one of the biggest PHP service companies in Europe. Ivo is known for his involvement in evangelising the use of PHP technology in enterprise environments. He is also the PHP 5.x Certification Advisory Board Member at Zend Technologies. You can read more about Jansch on his blog. The questions asked include the usual with a few extras thrown in: How did you start with PHP? To someone who wants to become a better PHP developer, what is your advice? How do you debug your PHP code, do you use something like xdebug or krumo..etc? In the next 5 years, how do you foresee the PHP ecosystem If you had to go back in time, would you still choose PHP?
7php.com: PHP Interview With Ivo Jansch Founder & CEO of Mobile Technology Egeniq
7php.com has posted a new interview with a PHP community member today - this time it's Ivo Jancsh (formerly of Ibuildings) now CEO at Eginiq, a mobile development company. In this edition I talked with Ivo Jansch (@ijansch) ex-CTO of Ibuildings which is one of the biggest PHP service companies in Europe. Ivo is known for his involvement in evangelising the use of PHP technology in enterprise environments. He is also the PHP 5.x Certification Advisory Board Member at Zend Technologies. You can read more about Jansch on his blog. The questions asked include the usual with a few extras thrown in: How did you start with PHP? To someone who wants to become a better PHP developer, what is your advice? How do you debug your PHP code, do you use something like xdebug or krumo..etc? In the next 5 years, how do you foresee the PHP ecosystem If you had to go back in time, would you still choose PHP?
2012-02-06 14:02:
Latest PEAR Releases: Services_Mailman 0.1.0
Community News: Latest PEAR Releases for 02.06.2012
Latest PEAR Releases: Services_Mailman 0.1.0
2012-02-03 19:38:
In case you weren't able to make it (or missed the live stream) Rasmus Lerdorf gave a presentation last night at Etsy as a part of their "Code as Craft" series. They recorded the session and you can watch it here. He talks about a few things: the history of the PHP language the state of PHP currently what's coming up in 2012 and touches some on the upcoming PHP 5.4 features. You can find more about their "Code as Craft" series (and other videos) on the Etsy page.
Etsy Code as Craft: Rasmus Lerdorf - PHP in 2012
In case you weren't able to make it (or missed the live stream) Rasmus Lerdorf gave a presentation last night at Etsy as a part of their "Code as Craft" series. They recorded the session and you can watch it here. He talks about a few things: the history of the PHP language the state of PHP currently what's coming up in 2012 and touches some on the upcoming PHP 5.4 features. You can find more about their "Code as Craft" series (and other videos) on the Etsy page.
2012-02-03 18:15:
In this quick new post to his blog Henrik Bjørnskov shows how to use the validators in Symfony2 in a more traditional Symfony 1 style for a form. Two of the more complicated components in Symfony2 is the Form and Validator component. The Validator is created in such a way it "always" need an Domain Object with Constraints associated through metadata. This is explained in detail here. But there is another way. A way that resemble's the symfony1 forms. Where you could specify the validations directly in your form class. Code is included in the post to show how to load in a few of the validators (like NotBlank, Email and Choice) and how to use them in the settings defined in the "getDefaultOptions" method.
Henrik Bjørnskov's Blog: Symfony2: Using the validator symfony1 style
In this quick new post to his blog Henrik Bjørnskov shows how to use the validators in Symfony2 in a more traditional Symfony 1 style for a form. Two of the more complicated components in Symfony2 is the Form and Validator component. The Validator is created in such a way it "always" need an Domain Object with Constraints associated through metadata. This is explained in detail here. But there is another way. A way that resemble's the symfony1 forms. Where you could specify the validations directly in your form class. Code is included in the post to show how to load in a few of the validators (like NotBlank, Email and Choice) and how to use them in the settings defined in the "getDefaultOptions" method.
2012-02-03 17:35:
Artur Ejsmont has a recent post to his blog showing how to get a MongoDB PECL extension to compile in a 32bit OSX environment (Snow Leopard). Here is a quick step by step guide on how to get mongodb and PHP5.2 mongo pecl extension going on your MacOSX in 32bit mode! NOTE: 32 bit mongodb binaries have 2GB address space limit so you wont be able to process too much on your laptop. You will still be able to code and connect to remote instances just fine. His process includes five steps - well, eight if you count the optional "install MongoDB" ones too - complete with the commands you'll need to get things compiled, ready for copy and paste. You can find the MongoDB PECL package here.
Artur Ejsmont's Blog: How to build mongodb pecl extension in 32bit for PHP 5.2 on OSX Snow Leaopard
Artur Ejsmont has a recent post to his blog showing how to get a MongoDB PECL extension to compile in a 32bit OSX environment (Snow Leopard). Here is a quick step by step guide on how to get mongodb and PHP5.2 mongo pecl extension going on your MacOSX in 32bit mode! NOTE: 32 bit mongodb binaries have 2GB address space limit so you wont be able to process too much on your laptop. You will still be able to code and connect to remote instances just fine. His process includes five steps - well, eight if you count the optional "install MongoDB" ones too - complete with the commands you'll need to get things compiled, ready for copy and paste. You can find the MongoDB PECL package here.
2012-02-03 16:39:
Freek Lijten has posted another "Currently on PHP's internals..." post to his blog today (here's the previous one) with a look at the discussions around the idea of having "property accessors" in PHP - a standardized way of defining getters/setters in objects. Today I will be discussing a feature that at this moment is called "Property Accessor". It is a method of defining getters and setters. Originally an RFC was defined as early as september 2009, but recently new discussion took place and an actual patch was created. There is no certainty this feature will ever make a PHP version but discussion seems to target implementation details and not the feature itself, so things are looking bright for this feature. There's two RFCs posted about the topic - the original proposal (from Dennis Robinson) and a patch for implementing them (from Clint Priest). The proposal replaces the common magic getters/setters (__get & __set) with the optional "get" and "set" keywords inside of custom-defined properties.
Freek Lijten's Blog: Currently on PHP's internals - Property Accessors
Freek Lijten has posted another "Currently on PHP's internals..." post to his blog today (here's the previous one) with a look at the discussions around the idea of having "property accessors" in PHP - a standardized way of defining getters/setters in objects. Today I will be discussing a feature that at this moment is called "Property Accessor". It is a method of defining getters and setters. Originally an RFC was defined as early as september 2009, but recently new discussion took place and an actual patch was created. There is no certainty this feature will ever make a PHP version but discussion seems to target implementation details and not the feature itself, so things are looking bright for this feature. There's two RFCs posted about the topic - the original proposal (from Dennis Robinson) and a patch for implementing them (from Clint Priest). The proposal replaces the common magic getters/setters (__get & __set) with the optional "get" and "set" keywords inside of custom-defined properties.
2012-02-03 15:01:
The PHP development team has officially announced the release of the latest version of PHP in the 5.3.x series - PHP 5.3.10: The PHP development team would like to announce the immediate availability of PHP 5.3.10. This release delivers a critical security fix. [...] Fixed arbitrary remote code execution vulnerability reported by Stefan Esser, CVE-2012-0830. It is highly recommended that users upgrade to this latest version to avoid falling victim to this recently introduced bug relating to the new "max_input_vars" setting added to protect from the overflow issue recently brought up in the PHP community.
PHP.net: PHP 5.3.10 Released (Security Fix - Recommended Upgrade)
The PHP development team has officially announced the release of the latest version of PHP in the 5.3.x series - PHP 5.3.10: The PHP development team would like to announce the immediate availability of PHP 5.3.10. This release delivers a critical security fix. [...] Fixed arbitrary remote code execution vulnerability reported by Stefan Esser, CVE-2012-0830. It is highly recommended that users upgrade to this latest version to avoid falling victim to this recently introduced bug relating to the new "max_input_vars" setting added to protect from the overflow issue recently brought up in the PHP community.
2012-02-03 14:05:
Popular posts from PHPDeveloper.org for the past week:/Dev/Hell Podcast: Episode 4: The Cool Kids Club Project: Patchwork-UTF8 - UTF8 Support for PHP Anson Cheung's Blog: Top 10 PHP Best Security Practices for Sys Admins Charles Sprayberry's Blog: Why you should use DI Alessandro Nadalin's Blog: Managing PHP dependencies with composer Mike Wallner's Blog: Dropping server load with HTTP caching DevShed: PHP Closures as View Helpers: Lazy-Loading File Data AndroidHive: Android Login and Registration with PHP, MySQL and SQLite Lorna Mitchell's Blog: PHP 5.4 Built In Webserver PHPMaster.com: Under the Hood of Yii's Component Architecture, Part 1
Site News: Popular Posts for the Week of 02.03.2012
Popular posts from PHPDeveloper.org for the past week:/Dev/Hell Podcast: Episode 4: The Cool Kids Club Project: Patchwork-UTF8 - UTF8 Support for PHP Anson Cheung's Blog: Top 10 PHP Best Security Practices for Sys Admins Charles Sprayberry's Blog: Why you should use DI Alessandro Nadalin's Blog: Managing PHP dependencies with composer Mike Wallner's Blog: Dropping server load with HTTP caching DevShed: PHP Closures as View Helpers: Lazy-Loading File Data AndroidHive: Android Login and Registration with PHP, MySQL and SQLite Lorna Mitchell's Blog: PHP 5.4 Built In Webserver PHPMaster.com: Under the Hood of Yii's Component Architecture, Part 1
2012-02-02 20:56:
Jeremy Cook is back with the next part of his series looking at the handy features PHP's SPL provides. In this new post he looks at the ArrayAccess interface and how it can make your data more accessible to PHP's own array handing functions. ArrayAccess allows you to treat an object that implements it as if it is an array for the purposes of setting, unsetting and retrieving data from it. Please note the emphasis in the last sentence! ArrayAccess does not make an object behave like an array in any other way. If you pass an object that implements ArrayAccess to a PHP array function such as in_array() you'll still get an error. This will become a little clearer with some of the examples below. He shows what you'll need to use this interface in your class - implementing the interface and defining a set of four methods to get/set and check for the value in your array. He includes a practical example of pulling data back from an API and wrapping it in a class to make accessing it simpler (also implementing the Countable interface as well, see the previous post for more on that). Code is include to illustrate how it can be used.
Jeremy Cook's Blog: Implementing the ArrayAccess Interface
Jeremy Cook is back with the next part of his series looking at the handy features PHP's SPL provides. In this new post he looks at the ArrayAccess interface and how it can make your data more accessible to PHP's own array handing functions. ArrayAccess allows you to treat an object that implements it as if it is an array for the purposes of setting, unsetting and retrieving data from it. Please note the emphasis in the last sentence! ArrayAccess does not make an object behave like an array in any other way. If you pass an object that implements ArrayAccess to a PHP array function such as in_array() you'll still get an error. This will become a little clearer with some of the examples below. He shows what you'll need to use this interface in your class - implementing the interface and defining a set of four methods to get/set and check for the value in your array. He includes a practical example of pulling data back from an API and wrapping it in a class to make accessing it simpler (also implementing the Countable interface as well, see the previous post for more on that). Code is include to illustrate how it can be used.
2012-02-02 19:10:
On the Leaseweb Labs blog there's a recent post looking at using the POC framework to work with flexible output caching. The tool makes it easy to create a new object and push cache content into it, automatically caching the data to sources like the file system, a Redis instance or a MongoDB database. Last year at the Symfony conference in Paris I have heard a really good quote: "There are only two hard things in Computer Science: cache invalidation and naming things" - Phil Karlton. I agree with it and it gave me a boost to keep evolving the concept. He includes an introduction to the caching features of the framework complete with sample code showing first how to cache to the default file system and a more complex example that uses unique caches and page blacklists. Other features planned for the caching tool include edge-side includes, using Twig for templating and statistics recorded to a database.
Leaseweb Labs Blog: POC: Flexible PHP Output Caching
On the Leaseweb Labs blog there's a recent post looking at using the POC framework to work with flexible output caching. The tool makes it easy to create a new object and push cache content into it, automatically caching the data to sources like the file system, a Redis instance or a MongoDB database. Last year at the Symfony conference in Paris I have heard a really good quote: "There are only two hard things in Computer Science: cache invalidation and naming things" - Phil Karlton. I agree with it and it gave me a boost to keep evolving the concept. He includes an introduction to the caching features of the framework complete with sample code showing first how to cache to the default file system and a more complex example that uses unique caches and page blacklists. Other features planned for the caching tool include edge-side includes, using Twig for templating and statistics recorded to a database.
2012-02-02 18:22:
On the LearnComputer.com site there's a new post comparing the benefits/downfalls of online versus classroom learning of PHP development. They list a few advantages and disadvantages of each. There can be many factors in the decision to learn PHP online or to take a class in-person, and for some, this can be a difficult decision to make. This article discusses the pros and cons of each method of PHP training to help you find the learning method that is going to suit your needs best. PHP isn't a new programming language, and there is a wealth of information on it on the web for every level of proficiency. The question is whether these resources alone are sufficient to get you up-and-running with PHP quickly. For the "online" section advantages include flexible schedules and more up to date content. The disadvantages are things like a prerequisite knowledge of using computers/the training software and that the instructor might only have "set hours" to answer questions and offer help. The "classroom" option advantages include the motivation of a regular meeting time and fewer technology hurdles to overcome. Disadvantages include the need for a time/in-person commitment and that the focus might be higher level than needed to appeal to a more mass audience.
LearnComputer.com: PHP Training: Online vs. Classroom
On the LearnComputer.com site there's a new post comparing the benefits/downfalls of online versus classroom learning of PHP development. They list a few advantages and disadvantages of each. There can be many factors in the decision to learn PHP online or to take a class in-person, and for some, this can be a difficult decision to make. This article discusses the pros and cons of each method of PHP training to help you find the learning method that is going to suit your needs best. PHP isn't a new programming language, and there is a wealth of information on it on the web for every level of proficiency. The question is whether these resources alone are sufficient to get you up-and-running with PHP quickly. For the "online" section advantages include flexible schedules and more up to date content. The disadvantages are things like a prerequisite knowledge of using computers/the training software and that the instructor might only have "set hours" to answer questions and offer help. The "classroom" option advantages include the motivation of a regular meeting time and fewer technology hurdles to overcome. Disadvantages include the need for a time/in-person commitment and that the focus might be higher level than needed to appeal to a more mass audience.
2012-02-02 17:41:
On the AndroidHive site there's a recent tutorial (plus screencast) about combining PHP, MySQL and SQLite to act as the backend authorization for your Android application. In my previous article Android Login and Registration Screen Design i explained designing the login and registration interfaces, but it has no functionality. In this tutorial i am explaining how to build complete login and registration system in android using PHP, MySQL and SQLite. Also this tutorial covers how to build simple API using PHP and MySQL. The tutorial walks you through each step of the process: Creating MySQL Database and Tables Building PHP API Classes Starting Android Project Making the JSON Parser, SQLite Database Handler and User Functions Classes Designing the Screens Switching between Activities Finally Updating AndroidManifest.xml If you want to get started quickly, you can just download the final result and go.
AndroidHive: Android Login and Registration with PHP, MySQL and SQLite
On the AndroidHive site there's a recent tutorial (plus screencast) about combining PHP, MySQL and SQLite to act as the backend authorization for your Android application. In my previous article Android Login and Registration Screen Design i explained designing the login and registration interfaces, but it has no functionality. In this tutorial i am explaining how to build complete login and registration system in android using PHP, MySQL and SQLite. Also this tutorial covers how to build simple API using PHP and MySQL. The tutorial walks you through each step of the process: Creating MySQL Database and Tables Building PHP API Classes Starting Android Project Making the JSON Parser, SQLite Database Handler and User Functions Classes Designing the Screens Switching between Activities Finally Updating AndroidManifest.xml If you want to get started quickly, you can just download the final result and go.
2012-02-02 16:07:
On the Script-Tutorials.com site today there's a new tutorial about form validation using a combination of jQuery on the frontend and PHP on the backend. In this tutorial, I will show you how to create an attractive, pleasant to look form for your website and then I will explain you how to dynamically validate them using Javascript. We'll also cover server-side validation with PHP to make everything 100% safe. This tutorial will help you to add more functionality to your forms which leads to better user experience and better quality of your website. His sample form (name, password, email and gender) is made from some pretty simple HTML markup. The real trick comes with the jQuery validation on each field handled in an onKeyUp. Included are both a "password strength" method and an email validation method to check the format of the address. Errored fields have their background color changed to indicate that they've failed and some basic validation (length, password match, etc.) are also included. The PHP does much of the same validation once the form is posted and returns any error messages that might have come up. You can download the code or try out a live demo to see the scripts together in action.
Script-Tutorials.com: Form Validation with Javascript and PHP
On the Script-Tutorials.com site today there's a new tutorial about form validation using a combination of jQuery on the frontend and PHP on the backend. In this tutorial, I will show you how to create an attractive, pleasant to look form for your website and then I will explain you how to dynamically validate them using Javascript. We'll also cover server-side validation with PHP to make everything 100% safe. This tutorial will help you to add more functionality to your forms which leads to better user experience and better quality of your website. His sample form (name, password, email and gender) is made from some pretty simple HTML markup. The real trick comes with the jQuery validation on each field handled in an onKeyUp. Included are both a "password strength" method and an email validation method to check the format of the address. Errored fields have their background color changed to indicate that they've failed and some basic validation (length, password match, etc.) are also included. The PHP does much of the same validation once the form is posted and returns any error messages that might have come up. You can download the code or try out a live demo to see the scripts together in action.
2012-02-02 15:52:
In PHPMaster.com's latest tutorial Lukas White introduces you to using the Yahoo "Placemaker" web service to geographically locate a place from a free-form text string. The results include "place details" like the type of the location, latitude, longitude and how confident they are in their match. The challenge then is to do two things: work out what place you could be talking about, disambiguate if necessary, and then identify exactly where on Earth that is. That's what I'll show you how to do in this article; by using a freely available web service, we'll write a simple program to ask users where they are (and ask them to clarify if necessary) before identifying their responses in concrete terms. He shows how to make a request to the Placemaker web service, passing it a string coming from the user, to be located. The POST request contains a few pieces of data including an application ID , your desired output type and the language you're using for the input. His example code uses curl to make the request and handles it (the XML response at least) with a call to simplexml_load_string.
PHPMaster.com: Where on Earth are You?
In PHPMaster.com's latest tutorial Lukas White introduces you to using the Yahoo "Placemaker" web service to geographically locate a place from a free-form text string. The results include "place details" like the type of the location, latitude, longitude and how confident they are in their match. The challenge then is to do two things: work out what place you could be talking about, disambiguate if necessary, and then identify exactly where on Earth that is. That's what I'll show you how to do in this article; by using a freely available web service, we'll write a simple program to ask users where they are (and ask them to clarify if necessary) before identifying their responses in concrete terms. He shows how to make a request to the Placemaker web service, passing it a string coming from the user, to be located. The POST request contains a few pieces of data including an application ID , your desired output type and the language you're using for the input. His example code uses curl to make the request and handles it (the XML response at least) with a call to simplexml_load_string.
2012-02-01 21:56:
The Server-Side Magazine site has posted an interview (10 questions) with Andrei Alexandrescu, a research engineer currently working at Facebook. Today we caught up with Andrei Alexandrescu for a "10 Question" interview. He is a Romanian born research engineer at Facebook living in the US, you can contact him on his website erdani.com or @incomputable. We will talk about some of the juicy stuff that going on at Facebook, so let's get started. Their questions include: What's your development setup? What do you think of PHP as a language from your perspective, regarding that Facebook was initially written in PHP then transformed to C++ using HipHop for PHP. What are the pros and cons of using C++ over PHP at Facebook? Currently, what kind of research do you conduct at Facebook? (or is this confidential?) Tell us a little bit about the D programming language, in contrast to C, PHP, Ruby and others. In what fields can someone apply D? Also, what kind of advice can you give for developers who are considering to apply to Facebook? What kind of skills is Facebook looking for in a potential candidate. Is it really important to be a graduate CS? What kind of skills do the majority of Facebook employees possess? Read the full interview for his answers to these and other interesting questions.
Server-Side Magazine: 10 Questions with Facebook Research Engineer - Andrei Alexandrescu
The Server-Side Magazine site has posted an interview (10 questions) with Andrei Alexandrescu, a research engineer currently working at Facebook. Today we caught up with Andrei Alexandrescu for a "10 Question" interview. He is a Romanian born research engineer at Facebook living in the US, you can contact him on his website erdani.com or @incomputable. We will talk about some of the juicy stuff that going on at Facebook, so let's get started. Their questions include: What's your development setup? What do you think of PHP as a language from your perspective, regarding that Facebook was initially written in PHP then transformed to C++ using HipHop for PHP. What are the pros and cons of using C++ over PHP at Facebook? Currently, what kind of research do you conduct at Facebook? (or is this confidential?) Tell us a little bit about the D programming language, in contrast to C, PHP, Ruby and others. In what fields can someone apply D? Also, what kind of advice can you give for developers who are considering to apply to Facebook? What kind of skills is Facebook looking for in a potential candidate. Is it really important to be a graduate CS? What kind of skills do the majority of Facebook employees possess? Read the full interview for his answers to these and other interesting questions.
2012-02-01 20:32:
Rafael Dohms has a new post to his blog about some of the lessons he learned attending this year's PHP Benelux conference both from the perspective of attending the conference and having been at several conferences around the world. After hearing about how great PHP Benelux Conferences were I finally made it over to Belgium to check it out, and i was impressed. To catch you up on the new, I moved to Amsterdam last december and thus had the chance of attending the conference which is now 2 hours away on a train ride. I could not expect less of a wonderful conference when names like Michelangelo van Dam are involved and this was no exception. Among his suggestions, there's things like: Value your sponsors Value your attendees Make your attendees pay Value the organizers and your volunteers ...and one of the most important ones: "Have Fun!" If you're not following this piece of advice, you're probably doing it wrong.
Rafael Dohms' Blog: PHP Benelux 2012 - Learning lessons
Rafael Dohms has a new post to his blog about some of the lessons he learned attending this year's PHP Benelux conference both from the perspective of attending the conference and having been at several conferences around the world. After hearing about how great PHP Benelux Conferences were I finally made it over to Belgium to check it out, and i was impressed. To catch you up on the new, I moved to Amsterdam last december and thus had the chance of attending the conference which is now 2 hours away on a train ride. I could not expect less of a wonderful conference when names like Michelangelo van Dam are involved and this was no exception. Among his suggestions, there's things like: Value your sponsors Value your attendees Make your attendees pay Value the organizers and your volunteers ...and one of the most important ones: "Have Fun!" If you're not following this piece of advice, you're probably doing it wrong.
2012-02-01 19:41:
php|architect, the group behind the yearly php|tek conference has posted this year's official schedule. Sessions in this year's event include: Developer Testing 201, When to Mock and When to Integrate (Laura Beth Denker) API Development (Rob Richards) The MicroPHP Manifesto (Ed Finkler) Web Security and You (Elliot White) Decoupled Library Packages for PHP 5.4 Clojure for PHP Developers (Ian Barber) Tickets are now on sale - you can find out more on the sales page for the event.
Community News: php|tek 2012 Schedule Announced!
php|architect, the group behind the yearly php|tek conference has posted this year's official schedule. Sessions in this year's event include: Developer Testing 201, When to Mock and When to Integrate (Laura Beth Denker) API Development (Rob Richards) The MicroPHP Manifesto (Ed Finkler) Web Security and You (Elliot White) Decoupled Library Packages for PHP 5.4 Clojure for PHP Developers (Ian Barber) Tickets are now on sale - you can find out more on the sales page for the event.
2012-02-01 19:18:
The PHPClasses.org site has posted the latest episode of their "Lately in PHP" podcast - episode 20: "MicroPHP vs Complicated PHP". Earlier in January Ed Finkler announced the MicroPHP manifesto. It seems to be a rant about against the practices of developers that make PHP development more complicated than it should be. This is one of the main topics discussed by Manuel Lemos and Ernani Joppert in the episode 20 of the Lately in PHP podcast. They also discuss the final release of PHP 5.4.0 and whether you should upgrade it or not, the repercussion of the PHP Hash Collision Vulnerability, as well the trends of PHP world based on the analysis of the PHP Zeitgeist 2011 initiative. You can listen to this latest episode either by using the in-page player or by downloading the mp3.
PHPClasses.org: Lately in PHP podcast episode 20 - MicroPHP vs Complicated PHP
The PHPClasses.org site has posted the latest episode of their "Lately in PHP" podcast - episode 20: "MicroPHP vs Complicated PHP". Earlier in January Ed Finkler announced the MicroPHP manifesto. It seems to be a rant about against the practices of developers that make PHP development more complicated than it should be. This is one of the main topics discussed by Manuel Lemos and Ernani Joppert in the episode 20 of the Lately in PHP podcast. They also discuss the final release of PHP 5.4.0 and whether you should upgrade it or not, the repercussion of the PHP Hash Collision Vulnerability, as well the trends of PHP world based on the analysis of the PHP Zeitgeist 2011 initiative. You can listen to this latest episode either by using the in-page player or by downloading the mp3.
2012-02-01 18:05:
Sebastian Bergmann has shared a presentation he originally gave at an Etsy event covering some of the history behind the popular PHPUnit tool and the development it's been through. When Noah Sussman asked me to give a Code as Craft Technology Talk last week when I was consulting for Etsy I immediately said yes. [...] Just like with a talk that I gave last year, I suddenly had a chain of associations in my head that I just had to follow. And down the rabbit hole I went once more ... He talks about the origins of PHPUnit (and mentions a few other tools), the move from PHP4 to PHP5, a change in version control from SVN to Git and features of the tool including mock objects and data providers. He also notes that not all tests are "good tests" and how, sometimes, backwards compatibility breaks are a good thing.
Sebastian Bergmann's Blog: A Tool's Tale
Sebastian Bergmann has shared a presentation he originally gave at an Etsy event covering some of the history behind the popular PHPUnit tool and the development it's been through. When Noah Sussman asked me to give a Code as Craft Technology Talk last week when I was consulting for Etsy I immediately said yes. [...] Just like with a talk that I gave last year, I suddenly had a chain of associations in my head that I just had to follow. And down the rabbit hole I went once more ... He talks about the origins of PHPUnit (and mentions a few other tools), the move from PHP4 to PHP5, a change in version control from SVN to Git and features of the tool including mock objects and data providers. He also notes that not all tests are "good tests" and how, sometimes, backwards compatibility breaks are a good thing.
2012-02-01 17:25:
Lorna Mitchell is back with another post in her "Building a RESTful PHP Server" series today with this new post showing how to work with output handlers (her focus is on JSON). So far we've covered parsing requests to determine exactly what the user is asking for, and also looked at routing to a controller to obtain the data or perform the action required. This post gives examples of how to return the data to the client in a good way. She advocates using output handlers instead of the usual views you'd think of in a typical MVCish sort of application. The difference here is that there's not a lot of extra overhead to produce the results - it's literally an output directly from a class extending the base view (including the correct headers). She also briefly mentions the inclusion of JSONP functionality, allowing you to specify a local callback to execute when the request is returned. A few other "nice to haves" are also mentioned like the number of results returned and pagination support.
Lorna Mitchell's Blog: Building A RESTful PHP Server: Output Handlers
Lorna Mitchell is back with another post in her "Building a RESTful PHP Server" series today with this new post showing how to work with output handlers (her focus is on JSON). So far we've covered parsing requests to determine exactly what the user is asking for, and also looked at routing to a controller to obtain the data or perform the action required. This post gives examples of how to return the data to the client in a good way. She advocates using output handlers instead of the usual views you'd think of in a typical MVCish sort of application. The difference here is that there's not a lot of extra overhead to produce the results - it's literally an output directly from a class extending the base view (including the correct headers). She also briefly mentions the inclusion of JSONP functionality, allowing you to specify a local callback to execute when the request is returned. A few other "nice to haves" are also mentioned like the number of results returned and pagination support.
2012-02-01 16:52:
In this recent post to his blog Ian Barber offers up some hints on presenting at conferences (or other events really) based on some of his experiences at this year's PHP Benelux Conference that just wrapped up in Belgium. Some of the conversations I had during the weekend were around technical presenting at conferences and usergroups, so I thought I'd collect a handful of the tips that were discussed into a post, and use a few of my favourite speakers at the event to illustrate them. He has it broken up by speaker, first David Zülke, Rowan Merewood and David Coallier, each with their own highlights of what they did well in their presentations. The list includes: Make concepts concrete with examples and demos Care About The Visuals Project Confidence Engage The Audience Ian provides summaries for each of the points, describing what the speaker did to accomplish it and how it could be put into practice by other presenters.
Ian Barber's Blog: Presentation Tips from Benelux
In this recent post to his blog Ian Barber offers up some hints on presenting at conferences (or other events really) based on some of his experiences at this year's PHP Benelux Conference that just wrapped up in Belgium. Some of the conversations I had during the weekend were around technical presenting at conferences and usergroups, so I thought I'd collect a handful of the tips that were discussed into a post, and use a few of my favourite speakers at the event to illustrate them. He has it broken up by speaker, first David Zülke, Rowan Merewood and David Coallier, each with their own highlights of what they did well in their presentations. The list includes: Make concepts concrete with examples and demos Care About The Visuals Project Confidence Engage The Audience Ian provides summaries for each of the points, describing what the speaker did to accomplish it and how it could be put into practice by other presenters.
2012-02-01 15:37:
Mike Purcell has a quick new post to his blog showing how you can run PHPUnit on one specific test using handy grouping functionality already built into the tool. The other day I was debugging an error in one of my unit tests, and found it hard to track down because when I ran PHPUnit, it ran all the tests contained in the file where my problem unit test was located. After some Googling and reading the PHPUnit Api Docs, I found that you can specify a test, among other tests, by adding a comment with the @group annotation. Using this "@group" annotation tells PHPUnit to combine these tests and allows you you specify a "--group" setting on the command line to only run those. He includes some sample code showing how it can be used. This can be very useful for combining results for certain kinds of tests (say, all related to bugfixes) without having to run everything all over again.
Mike Purcell's Blog: PHPUnit - How to Run PHPUnit Against a Specific Test
Mike Purcell has a quick new post to his blog showing how you can run PHPUnit on one specific test using handy grouping functionality already built into the tool. The other day I was debugging an error in one of my unit tests, and found it hard to track down because when I ran PHPUnit, it ran all the tests contained in the file where my problem unit test was located. After some Googling and reading the PHPUnit Api Docs, I found that you can specify a test, among other tests, by adding a comment with the @group annotation. Using this "@group" annotation tells PHPUnit to combine these tests and allows you you specify a "--group" setting on the command line to only run those. He includes some sample code showing how it can be used. This can be very useful for combining results for certain kinds of tests (say, all related to bugfixes) without having to run everything all over again.
2012-01-31 20:11:
Alessandro Nadalin has a new post to his blog looking at the Composer project and using it to manage packages and dependencies in PHP applications. Managing dependencies between pieces of software, in PHP, hasn't always been a relief: we had PEAR and PECL with their workflows and problems while, in other ecosystems, the solution to this problem has been solved in better ways, like NodeJS's NPM. He takes a first look at the tool, describing how to get it set up, create a sample configuration (describing each section inside it) and an example of the tool's output. He also briefly touches on the Packagist website/repository and links to the instructions on how to create your own.
Alessandro Nadalin's Blog: Managing PHP dependencies with composer
Alessandro Nadalin has a new post to his blog looking at the Composer project and using it to manage packages and dependencies in PHP applications. Managing dependencies between pieces of software, in PHP, hasn't always been a relief: we had PEAR and PECL with their workflows and problems while, in other ecosystems, the solution to this problem has been solved in better ways, like NodeJS's NPM. He takes a first look at the tool, describing how to get it set up, create a sample configuration (describing each section inside it) and an example of the tool's output. He also briefly touches on the Packagist website/repository and links to the instructions on how to create your own.
2012-01-31 19:40:
In this latest post to his blog Justin Carmony looks at a system he created to hook his Nagios notifications into the Twilio web service and have it notify him via SMS with something was wrong. In the past I would just use my iPhone's email-to-txt email address. However, when I received the txt message, it wasn't formated very pretty, and it would have a different "From Number." So if we had a crazy day, I would have 20-30 message threads in my iPhone all about Nagios. [...] What I like out this setup is with Twilio, I can buy a phone number for $1 a month. So all my notifications come through the same number. He's included the PHP code he uses to send the notifications (using the Twillo library) and the Nagios commands he configured to send the notifications to that script via the command line.
Justin Carmony's Blog: SMS Nagios Notifications with PHP & Twilio
In this latest post to his blog Justin Carmony looks at a system he created to hook his Nagios notifications into the Twilio web service and have it notify him via SMS with something was wrong. In the past I would just use my iPhone's email-to-txt email address. However, when I received the txt message, it wasn't formated very pretty, and it would have a different "From Number." So if we had a crazy day, I would have 20-30 message threads in my iPhone all about Nagios. [...] What I like out this setup is with Twilio, I can buy a phone number for $1 a month. So all my notifications come through the same number. He's included the PHP code he uses to send the notifications (using the Twillo library) and the Nagios commands he configured to send the notifications to that script via the command line.
2012-01-31 18:19:
On PHPMaster.com today Steven O'Brien takes a look at a popular PHP-based framework, Yii - specifically one of the components that makes it up, the CComponent that provides a base for all other components in the framework. There's been a lot of buzz surrounding the use of frameworks for quite a while now and there are many great PHP frameworks to choose from. I was blown away by the simplicity and power of the base CComponent class in the Yii framework. [...] Every class in the framework extends from the CComponent class, which means that all subclasses work as components and can raise and handle events as well as be reusable and configurable. This packs a lot of punch for such a little class! In this first post of the series, he looks at how this base class lets you work with class properties using the magic getters and setters. He includes some code showing how to set them up and how to use it to configure your object by passing in other component and their configuration.
PHPMaster.com: Under the Hood of Yii's Component Architecture, Part 1
On PHPMaster.com today Steven O'Brien takes a look at a popular PHP-based framework, Yii - specifically one of the components that makes it up, the CComponent that provides a base for all other components in the framework. There's been a lot of buzz surrounding the use of frameworks for quite a while now and there are many great PHP frameworks to choose from. I was blown away by the simplicity and power of the base CComponent class in the Yii framework. [...] Every class in the framework extends from the CComponent class, which means that all subclasses work as components and can raise and handle events as well as be reusable and configurable. This packs a lot of punch for such a little class! In this first post of the series, he looks at how this base class lets you work with class properties using the magic getters and setters. He includes some code showing how to set them up and how to use it to configure your object by passing in other component and their configuration.
2012-01-31 17:05:
Over on the PHPClasses.org blog today there's a new post looking at the next major upcoming PHP version (5.4), what it comes with and why you might want to make the upgrade. PHP 5.4.0 is planned to be released on February, 2 2012. By the time you are reading this, it may already been out. It is a result of many months of development. Many features were proposed for this release. Some made into this version, others did not make it at least for now. So, now you may be wondering which interesting features really made it. Let me tell you more about some of the more interesting features present in this release. The article mentions some of the usual major features that can be found in just about every "in PHP 5.4" list - traits, the built-in web server, binary notation for integers - but it also includes some of the features that didn't make the cut this time (like annotations and the inclusion of the APC caching extension). Also included are questions to ask to see if the upgrade is for you like: Do you need the new features? Do you need the updates now? Try it and test it in dev first - does it meet your needs or cause other bugs? The planned release for PHP 5.4 is during the first week of February (2012). Additionally, if you'd like to give the PHP development group some help testing out the latest Release Candidate, you can find instructions here.
PHPClasses.org: PHP 5.4 Features: Shall you Upgrade to the newer PHP Version?
Over on the PHPClasses.org blog today there's a new post looking at the next major upcoming PHP version (5.4), what it comes with and why you might want to make the upgrade. PHP 5.4.0 is planned to be released on February, 2 2012. By the time you are reading this, it may already been out. It is a result of many months of development. Many features were proposed for this release. Some made into this version, others did not make it at least for now. So, now you may be wondering which interesting features really made it. Let me tell you more about some of the more interesting features present in this release. The article mentions some of the usual major features that can be found in just about every "in PHP 5.4" list - traits, the built-in web server, binary notation for integers - but it also includes some of the features that didn't make the cut this time (like annotations and the inclusion of the APC caching extension). Also included are questions to ask to see if the upgrade is for you like: Do you need the new features? Do you need the updates now? Try it and test it in dev first - does it meet your needs or cause other bugs? The planned release for PHP 5.4 is during the first week of February (2012). Additionally, if you'd like to give the PHP development group some help testing out the latest Release Candidate, you can find instructions here.
2012-01-31 16:24:
In response to some of the comments made on his previous post about why you should use dependency injection in your applications, Charles Sprayberry is back with some more concrete examples showing how it all works with some code to back it up. To help better explain each of the three aspects of DI I discussed in the previous article I'll be going over each more thoroughly and with those code examples requested. I'll be going through each point one at a time as the explanations will likely be of some length compared to the original post. He starts with the "villain" of the story - the Singleton design pattern, a difficult to test method that lulls you into thinking you're not in the global scope. He talks about the problem of using this approach and how the Factory design pattern can be used to create an alternative. He changes up the example to create a "DbTableFactory" class that can be used to create the objects needed - in this case a "UserTable" object with the connection injected into it at construct time.
Charles Sprayberry's Blog: DI and global state
In response to some of the comments made on his previous post about why you should use dependency injection in your applications, Charles Sprayberry is back with some more concrete examples showing how it all works with some code to back it up. To help better explain each of the three aspects of DI I discussed in the previous article I'll be going over each more thoroughly and with those code examples requested. I'll be going through each point one at a time as the explanations will likely be of some length compared to the original post. He starts with the "villain" of the story - the Singleton design pattern, a difficult to test method that lulls you into thinking you're not in the global scope. He talks about the problem of using this approach and how the Factory design pattern can be used to create an alternative. He changes up the example to create a "DbTableFactory" class that can be used to create the objects needed - in this case a "UserTable" object with the connection injected into it at construct time.
2012-01-31 15:59:
In a recent post Marcelo Gornstein takes a look at using dependency injection with Doctrine2 using his Ding container. This article will show how we can develop software in php with a nifty design and architecture, and very much like other languages like java, using an ORM and an AOP, DI, Events container. I will assume you've read (or at least took a quick look) at this article that explains the tree layout used throughout the code, and that you have some basic knowledge of Doctrine2 and used it before on your own. He starts with the result - an easy to use, self-contained (and decoupled) system for accessing the Doctrine2 instance. It's event-driven and uses Aspect-oriented programming to mange interactions between components (or as he calls them "beans"). Code is included for the entire process for a logger, the User entity, entity manager, user repository and transactional aspect. You can find the complete source for his example on his github account.
Marcelo Gornstein's Blog: Writing PHP applications with Doctrine2 as ORM and Ding as DI container
In a recent post Marcelo Gornstein takes a look at using dependency injection with Doctrine2 using his Ding container. This article will show how we can develop software in php with a nifty design and architecture, and very much like other languages like java, using an ORM and an AOP, DI, Events container. I will assume you've read (or at least took a quick look) at this article that explains the tree layout used throughout the code, and that you have some basic knowledge of Doctrine2 and used it before on your own. He starts with the result - an easy to use, self-contained (and decoupled) system for accessing the Doctrine2 instance. It's event-driven and uses Aspect-oriented programming to mange interactions between components (or as he calls them "beans"). Code is included for the entire process for a logger, the User entity, entity manager, user repository and transactional aspect. You can find the complete source for his example on his github account.
2012-01-31 14:03:
Latest PECL Releases: xdebug 2.1.3 mysqlnd_ms 1.2.1
Community News: Latest PECL Releases for 01.31.2012
Latest PECL Releases: xdebug 2.1.3 mysqlnd_ms 1.2.1
2012-01-30 21:52:
In this recent post to his blog Anson Cheung provides a set of helpful hints for sysadmins to follow when installing (or just securing) the PHP installations on their systems. PHP is widely used for various of web development. However, misconfigured server-side scripting would create all sorts of problem. And here are php security best practices that you should aware when configuring PHP securely. Nowadays most of the web servers are operated under Linux environment (like: Ubuntu, Debian...etc). Hence, in the following article, I am going to use list top 10 ways to enhance PHP Security Best Practices under Linux environment. His tips include: Reducing the built-in PHP modules Logging all PHP errors Disabling remote code execution Disabling dangerous PHP functions Write protection on Apache, PHP & MySQL configuration files
Anson Cheung's Blog: Top 10 PHP Best Security Practices for Sys Admins
In this recent post to his blog Anson Cheung provides a set of helpful hints for sysadmins to follow when installing (or just securing) the PHP installations on their systems. PHP is widely used for various of web development. However, misconfigured server-side scripting would create all sorts of problem. And here are php security best practices that you should aware when configuring PHP securely. Nowadays most of the web servers are operated under Linux environment (like: Ubuntu, Debian...etc). Hence, in the following article, I am going to use list top 10 ways to enhance PHP Security Best Practices under Linux environment. His tips include: Reducing the built-in PHP modules Logging all PHP errors Disabling remote code execution Disabling dangerous PHP functions Write protection on Apache, PHP & MySQL configuration files
2012-01-30 20:08:
In the second part of their look at using closures in PHP as view helpers, DevShed improves upon their original code by adding some additional classes and using them in the closures. The best way to show you how using anonymous functions can help you to develop more efficient OO applications is with some functional, hands-on examples. With this idea in mind, in the installment that preceded this one, I implemented an extendable template system. This system could spawn view objects and render the template files associated with these objects. In this second part of the (two-part) series they include "Serializer" and "FileHandler" classes and show how to use them inside of the closures to lazy-load in data from an external file and work with it as serialized content.
DevShed: PHP Closures as View Helpers: Lazy-Loading File Data
In the second part of their look at using closures in PHP as view helpers, DevShed improves upon their original code by adding some additional classes and using them in the closures. The best way to show you how using anonymous functions can help you to develop more efficient OO applications is with some functional, hands-on examples. With this idea in mind, in the installment that preceded this one, I implemented an extendable template system. This system could spawn view objects and render the template files associated with these objects. In this second part of the (two-part) series they include "Serializer" and "FileHandler" classes and show how to use them inside of the closures to lazy-load in data from an external file and work with it as serialized content.
2012-01-30 19:15:
On PHPMaster.com today there's a new tutorial showing you how to handle simple pagination in a popular PHP framework, CodeIgniter. Pagination is particularly useful when you are coding an application that interfaces with a database. A large dataset might have hundreds of possible results for one query, and pagination creates a much nicer user experience. In this tutorial, I'll use CodeIgniter's pagination library to show you how you can create a paginated list of results from a MySQL database. Along the way, you'll also see how to fix a problem with the pagination links that the library might produce. He starts on the backend, creating a model to work with Country information and includes a "fetch_countries" method to grab the limited/paged list. Next up is the controller with an "example1" method that looks to the URL to see what page it should be on. The view is simple enough - just outputting the results back without worrying about how many to show.
PHPMaster.com: Pagination with CodeIgniter
On PHPMaster.com today there's a new tutorial showing you how to handle simple pagination in a popular PHP framework, CodeIgniter. Pagination is particularly useful when you are coding an application that interfaces with a database. A large dataset might have hundreds of possible results for one query, and pagination creates a much nicer user experience. In this tutorial, I'll use CodeIgniter's pagination library to show you how you can create a paginated list of results from a MySQL database. Along the way, you'll also see how to fix a problem with the pagination links that the library might produce. He starts on the backend, creating a model to work with Country information and includes a "fetch_countries" method to grab the limited/paged list. Next up is the controller with an "example1" method that looks to the URL to see what page it should be on. The view is simple enough - just outputting the results back without worrying about how many to show.
2012-01-30 18:35:
Lorna Mitchell has posted a quick tutorial about a feature of the upcoming PHP 5.4 release, the built-in web server, and some tips on doing things like routing requests and changing the hostname. One of the big features arriving with PHP 5.4 is the addition of a built-in basic webserver for use in development environments. Quite a few of the other scripting languages have something like this so I'm very pleased to see it in PHP. Using a server like this makes it easy to quickly try out some scripts without needing to configure apache or really do anything much! I had to look up a few things to get started, so I thought I'd write them down for posterity. She includes instructions on how to get the server up and running from the command line, updating the location of the document root with a command line option and using a simple "routing.php" script to act as a front controller. Changing the hostname is as simple as changing "localhost" to something else when starting the server.
Lorna Mitchell's Blog: PHP 5.4 Built In Webserver
Lorna Mitchell has posted a quick tutorial about a feature of the upcoming PHP 5.4 release, the built-in web server, and some tips on doing things like routing requests and changing the hostname. One of the big features arriving with PHP 5.4 is the addition of a built-in basic webserver for use in development environments. Quite a few of the other scripting languages have something like this so I'm very pleased to see it in PHP. Using a server like this makes it easy to quickly try out some scripts without needing to configure apache or really do anything much! I had to look up a few things to get started, so I thought I'd write them down for posterity. She includes instructions on how to get the server up and running from the command line, updating the location of the document root with a command line option and using a simple "routing.php" script to act as a front controller. Changing the hostname is as simple as changing "localhost" to something else when starting the server.
2012-01-30 17:02:
Jason Grimes has posted a new tutorial to his blog about integrating Zend Framework 2 with Doctrine, the powerful (and popular) ORM tool for PHP. In his example, he shows how to use them to store the album information from Rob's tutorial. Zend Framework 2 is getting close to release, and among the changes are new ways to handle dependency injection, and new ways to work with third-party code as modules. Rob "Akrabat" Allen has updated his iconic Getting Started with Zend Framework tutorial for ZF2, and it's a great place to start. After working through that tutorial, the next thing I wanted to do was figure out how to get the Doctrine 2 ORM up and running. This article shows how to set up and use Doctrine 2 in Zend Framework 2, by extending Rob's Getting Started tutorial to use Doctrine instead of Zend_Db. Using Rob's example as a starting point, he shows how to install the Doctrine modules, update the "Album" model and controller to use Doctrine instead of Zend_Db and create the entity for the Albums.
Jason Grimes' Blog: Using Doctrine 2 in Zend Framework 2
Jason Grimes has posted a new tutorial to his blog about integrating Zend Framework 2 with Doctrine, the powerful (and popular) ORM tool for PHP. In his example, he shows how to use them to store the album information from Rob's tutorial. Zend Framework 2 is getting close to release, and among the changes are new ways to handle dependency injection, and new ways to work with third-party code as modules. Rob "Akrabat" Allen has updated his iconic Getting Started with Zend Framework tutorial for ZF2, and it's a great place to start. After working through that tutorial, the next thing I wanted to do was figure out how to get the Doctrine 2 ORM up and running. This article shows how to set up and use Doctrine 2 in Zend Framework 2, by extending Rob's Getting Started tutorial to use Doctrine instead of Zend_Db. Using Rob's example as a starting point, he shows how to install the Doctrine modules, update the "Album" model and controller to use Doctrine instead of Zend_Db and create the entity for the Albums.
2012-01-30 16:55:
In this new post to his blog Nikita Popov looks at an update that might have gotten lost in the shuffle of new features coming in PHP 5.4 - some updates to htmlspecialchars. One set of changes that I think is particularly important was largely overlooked: For PHP 5.4 cataphract (Artefacto on StackOverflow) heroically rewrote large parts of htmlspecialchars thus fixing various quirks and adding some really nice new features. Here a quick summary of the most important changes: UTF-8 as the default charset, improved error handling (ENT_SUBSTITUTE) and Doctype handling (ENT_HTML401,...). He goes into each of these three main features in a bit more detail, providing code to illustrate the improved error handling and the new flags for Doctype handling (covering HTML 4.01, HTML 5, XML 1 and XHTML).
Nikita Popov's Blog: htmlspecialchars() improvements in PHP 5.4
In this new post to his blog Nikita Popov looks at an update that might have gotten lost in the shuffle of new features coming in PHP 5.4 - some updates to htmlspecialchars. One set of changes that I think is particularly important was largely overlooked: For PHP 5.4 cataphract (Artefacto on StackOverflow) heroically rewrote large parts of htmlspecialchars thus fixing various quirks and adding some really nice new features. Here a quick summary of the most important changes: UTF-8 as the default charset, improved error handling (ENT_SUBSTITUTE) and Doctype handling (ENT_HTML401,...). He goes into each of these three main features in a bit more detail, providing code to illustrate the improved error handling and the new flags for Doctype handling (covering HTML 4.01, HTML 5, XML 1 and XHTML).
2012-01-30 15:28:
On 7php.com there's a new interview with Stefan Koopmanschap, the Symfony Community Manager (and well-known PHP speaker and member of the PHPBenelux user group) answering some questions about himself, Symfony and the PHP community. In this edition, I talked with Stefan Koopmanschap (@skoop) the co-founder of the Dutch PHP usergroup PFZ.nl which is merged with the PHPBelgium usergroup to form the PHPBenelux usergroup. He is also an official Sensio training partner for Benelux and Germany. [...] Koopmanschap is much involved in the OpenSource world and is a very highly respected member in the PHP Community; he advocates sensible thoughts and never fails to make his point stand out in the best way he can. You can read more about him on his personal blog - LeftOnTheWeb. Stefan answers a few questions about himself and his experience with PHP: A bit of background on who he is and when he got started with PHP How he got started with the language His opinion of PHP now versus when he first started some of the good and bad things about PHP You can read interviews with other PHP community members here.
7php.com: Interview With Stefan Koopmanschap Symfony Community Manager
On 7php.com there's a new interview with Stefan Koopmanschap, the Symfony Community Manager (and well-known PHP speaker and member of the PHPBenelux user group) answering some questions about himself, Symfony and the PHP community. In this edition, I talked with Stefan Koopmanschap (@skoop) the co-founder of the Dutch PHP usergroup PFZ.nl which is merged with the PHPBelgium usergroup to form the PHPBenelux usergroup. He is also an official Sensio training partner for Benelux and Germany. [...] Koopmanschap is much involved in the OpenSource world and is a very highly respected member in the PHP Community; he advocates sensible thoughts and never fails to make his point stand out in the best way he can. You can read more about him on his personal blog - LeftOnTheWeb. Stefan answers a few questions about himself and his experience with PHP: A bit of background on who he is and when he got started with PHP How he got started with the language His opinion of PHP now versus when he first started some of the good and bad things about PHP You can read interviews with other PHP community members here.
2012-01-30 14:09:
Latest PEAR Releases: Auth_HTTP 2.1.8 Structures_DataGrid 0.9.3 XML_Feed_Parser 1.0.5 Crypt_CBC 1.0.1 SOAP 0.13.0 Net_Nmap 1.0.4 Structures_DataGrid 0.9.2 Auth_HTTP 2.1.7 Net_Server 1.0.3 Structures_BibTex 1.0.0RC6 Image_Canvas 0.3.4 OLE 1.0.0RC2 Spreadsheet_Excel_Writer 0.9.3
Community News: Latest PEAR Releases for 01.30.2012
Latest PEAR Releases: Auth_HTTP 2.1.8 Structures_DataGrid 0.9.3 XML_Feed_Parser 1.0.5 Crypt_CBC 1.0.1 SOAP 0.13.0 Net_Nmap 1.0.4 Structures_DataGrid 0.9.2 Auth_HTTP 2.1.7 Net_Server 1.0.3 Structures_BibTex 1.0.0RC6 Image_Canvas 0.3.4 OLE 1.0.0RC2 Spreadsheet_Excel_Writer 0.9.3
2012-01-27 19:54:
The latest episode of the "/dev/hell" podcast has been released - Episode 4: "The Cool Kids Club". Our fourth episode is all ready for your listening pleasure. In this exciting episode we focus on "The Conference Experience" and discuss why programming conferences are so important to developers. Chris talks about why CodeMash was so awesome and the awesome talks full of awesomeness that he attended. Ed talks about his own experiences with speaking and attending conferences, complete with a total derail by Chris on why a certain conference rubbed him the wrong way. Oh yeah, you also find out our opinions on what constitutes a "well-written PHP application". I'm sure you will be surprised by our answers. You can either listen to this latest episode either via the in-page player or you can download the mp3 directly.
/Dev/Hell Podcast: Episode 4: The Cool Kids Club
The latest episode of the "/dev/hell" podcast has been released - Episode 4: "The Cool Kids Club". Our fourth episode is all ready for your listening pleasure. In this exciting episode we focus on "The Conference Experience" and discuss why programming conferences are so important to developers. Chris talks about why CodeMash was so awesome and the awesome talks full of awesomeness that he attended. Ed talks about his own experiences with speaking and attending conferences, complete with a total derail by Chris on why a certain conference rubbed him the wrong way. Oh yeah, you also find out our opinions on what constitutes a "well-written PHP application". I'm sure you will be surprised by our answers. You can either listen to this latest episode either via the in-page player or you can download the mp3 directly.
2012-01-27 18:38:
Nicolas Grekas has shared another tool that he's pulled out of his "Patchwork" framework to make it a stand-alone tool: the Patchwork-UTF8 helper that provides matching functions to those PHP already has for regular strings, but a little smarter to work with UTF8 correctly. The PatchworkUtf8 class implements the quasi complete set of string functions that need UTF-8 grapheme clusters awareness. These functions are all static methods of the PatchworkUtf8 class. The best way to use them is to add a use PatchworkUtf8 as u; at the beginning of your files, then when UTF-8 awareness is required, prefix by u:: when calling them. In the README for the tool he talks about the functions included in the current release that match PHP's string functions as well as some additional methods like "isUtf8", "bestFit" and "strtocasefold". It relies on the mbstring, iconv and intl extensions being installed, and if they aren't, it falls back to other functionality (list of those methods included).
Project: Patchwork-UTF8 - UTF8 Support for PHP
Nicolas Grekas has shared another tool that he's pulled out of his "Patchwork" framework to make it a stand-alone tool: the Patchwork-UTF8 helper that provides matching functions to those PHP already has for regular strings, but a little smarter to work with UTF8 correctly. The PatchworkUtf8 class implements the quasi complete set of string functions that need UTF-8 grapheme clusters awareness. These functions are all static methods of the PatchworkUtf8 class. The best way to use them is to add a use PatchworkUtf8 as u; at the beginning of your files, then when UTF-8 awareness is required, prefix by u:: when calling them. In the README for the tool he talks about the functions included in the current release that match PHP's string functions as well as some additional methods like "isUtf8", "bestFit" and "strtocasefold". It relies on the mbstring, iconv and intl extensions being installed, and if they aren't, it falls back to other functionality (list of those methods included).
2012-01-27 17:18:
In this recent post from Charles Sprayberry he explains why using dependency injection (DI) in your application is a good idea and can help make things easier in the long run. Dependency Injection is just a fancy term for passing dependencies to the object needing them instead of letting the object create its own. Hopefully, you've watched this great Google Clean Code talk about dependency injection by Misko Hevery where he talks about why you should ask for things instead of looking for them. I'm gonna talk about some reasons to use DI beyond just those presented in the video. He breaks it up into a few different sections: It helps in the battle against global state It helps your design It makes using the single responsibility principle easier
Charles Sprayberry's Blog: Why you should use DI
In this recent post from Charles Sprayberry he explains why using dependency injection (DI) in your application is a good idea and can help make things easier in the long run. Dependency Injection is just a fancy term for passing dependencies to the object needing them instead of letting the object create its own. Hopefully, you've watched this great Google Clean Code talk about dependency injection by Misko Hevery where he talks about why you should ask for things instead of looking for them. I'm gonna talk about some reasons to use DI beyond just those presented in the video. He breaks it up into a few different sections: It helps in the battle against global state It helps your design It makes using the single responsibility principle easier
2012-01-27 16:43:
Mike Wallner has shared a quick and easy HTTP caching technique in a new post to his blog today. The key is in using the PEAR HTTP_Header package. Ever watched youself browsing e.g. a web forum? Noticed that you viewed the same page several times? Well, this means extraordinary and useless load for your server if there's no caching mechanism implemented in the web application. Even if there is some file or db cache you can still improve performance with implementing some http cache. With a few simple lines of code using HTTP_Header, you can tell your scripts how long to set the "expires" header to on your requests. This increment (in seconds) is relayed to the browser to tell it when to next fetch the page and not reload from cache.
Mike Wallner's Blog: Dropping server load with HTTP caching
Mike Wallner has shared a quick and easy HTTP caching technique in a new post to his blog today. The key is in using the PEAR HTTP_Header package. Ever watched youself browsing e.g. a web forum? Noticed that you viewed the same page several times? Well, this means extraordinary and useless load for your server if there's no caching mechanism implemented in the web application. Even if there is some file or db cache you can still improve performance with implementing some http cache. With a few simple lines of code using HTTP_Header, you can tell your scripts how long to set the "expires" header to on your requests. This increment (in seconds) is relayed to the browser to tell it when to next fetch the page and not reload from cache.
2012-01-27 15:17:
On the Ibuildings blog today there's a year in review post (from Ben Longden, Rowan Merewood and Alistair Stead) looking back at 2011 and everything that happened in the world of PHP. 2011 has flown by in a blur as we have been busy helping many new clients with large scale PHP projects - proof that PHP continues to gain traction with enterprise. [...] The ongoing financial climate only adds pressure for IT managers to cut costs and deliver more value from their existing infrastructure and therefore require enterprises to re-consider any prior aversion to open source and PHP. This is allowing our industry to consistently buck the trend of the markets and expand to support the increased demand. They list some of the changes in PHP itself, like the Release Candidates for PHP 5.4 and the 5.3 requirements of some frameworks, as well as some community-related changes: Facebook's Virtual PHP Machine (hhvm) and the number of PHP-related events in Europe and the UK. They mention some projects that become more prominent in 2011 including BDD testing, Platform as a Service products and the EBay acquisition of Magento. Also included in the post are a few predictions for 2012 including a possible merging of frameworks along similar strategies, the increased use of dependency injection containers and a serious look into caching in PHP applications.
Ibuildings Blog: 2011: A Year in PHP
On the Ibuildings blog today there's a year in review post (from Ben Longden, Rowan Merewood and Alistair Stead) looking back at 2011 and everything that happened in the world of PHP. 2011 has flown by in a blur as we have been busy helping many new clients with large scale PHP projects - proof that PHP continues to gain traction with enterprise. [...] The ongoing financial climate only adds pressure for IT managers to cut costs and deliver more value from their existing infrastructure and therefore require enterprises to re-consider any prior aversion to open source and PHP. This is allowing our industry to consistently buck the trend of the markets and expand to support the increased demand. They list some of the changes in PHP itself, like the Release Candidates for PHP 5.4 and the 5.3 requirements of some frameworks, as well as some community-related changes: Facebook's Virtual PHP Machine (hhvm) and the number of PHP-related events in Europe and the UK. They mention some projects that become more prominent in 2011 including BDD testing, Platform as a Service products and the EBay acquisition of Magento. Also included in the post are a few predictions for 2012 including a possible merging of frameworks along similar strategies, the increased use of dependency injection containers and a serious look into caching in PHP applications.
2012-01-27 14:08:
Popular posts from PHPDeveloper.org for the past week:IBM developerWorks: Store datasets directly in shared memory with PHP Reddit.com: PHP.net gets a new design. Opinions divided Jakub Zalas' Blog: Mocking Symfony Container services in Behat scenarios with Mockery KingFoo Blog: PHP 5.4 - What's new? Michael Nitschinger's Blog: Session Encryption with Lithium Jani Hartikainen's Blog: Why does everything need to be integrated into a framework? DZone.com: PHPUnit_Selenium Lorna Mitchell's Blog: Building A RESTful PHP Server: Routing the Request Francois Zaninotto's Blog: Node.js for PHP Programmers #1: Event-Driven Programming... and Pasta WebDevRadio: Episode 95:Jeff Carouth Interview from Zendcon 2011
Site News: Popular Posts for the Week of 01.27.2012
Popular posts from PHPDeveloper.org for the past week:IBM developerWorks: Store datasets directly in shared memory with PHP Reddit.com: PHP.net gets a new design. Opinions divided Jakub Zalas' Blog: Mocking Symfony Container services in Behat scenarios with Mockery KingFoo Blog: PHP 5.4 - What's new? Michael Nitschinger's Blog: Session Encryption with Lithium Jani Hartikainen's Blog: Why does everything need to be integrated into a framework? DZone.com: PHPUnit_Selenium Lorna Mitchell's Blog: Building A RESTful PHP Server: Routing the Request Francois Zaninotto's Blog: Node.js for PHP Programmers #1: Event-Driven Programming... and Pasta WebDevRadio: Episode 95:Jeff Carouth Interview from Zendcon 2011
2012-01-26 18:04:
PHPMaster.com has a new tutorial posted today about "bending XML to your will" - working with XML data using the XML Parser and SimpleXML functionality already included with PHP. If you've ever worked with the Twitter or Facebook APIs, looked at RSS feeds from a website, or made use of some type of RPC calls, you've undoubtedly experienced working with XML. [...] Knowing how to process XML data is a crucial programming skill today, and thankfully, PHP offers multiple ways to read, filter, and even generate XML. In this article I'll explain what exactly XML is, in case you haven't had any experience with it yet, and then dive into a few ways you can use PHP to bend XML to your will. He introduces the concepts and syntax behind XML first for those not accustomed and quickly moves into the tools to parse it. First he looks at the XML Parser, an event-based parser, and SimpleXML, an easy way to access the contents of a well-formed XML document. Snippets of code are provided for each to show you how to put them into practice.
PHPMaster.com: Bending XML to Your Will
PHPMaster.com has a new tutorial posted today about "bending XML to your will" - working with XML data using the XML Parser and SimpleXML functionality already included with PHP. If you've ever worked with the Twitter or Facebook APIs, looked at RSS feeds from a website, or made use of some type of RPC calls, you've undoubtedly experienced working with XML. [...] Knowing how to process XML data is a crucial programming skill today, and thankfully, PHP offers multiple ways to read, filter, and even generate XML. In this article I'll explain what exactly XML is, in case you haven't had any experience with it yet, and then dive into a few ways you can use PHP to bend XML to your will. He introduces the concepts and syntax behind XML first for those not accustomed and quickly moves into the tools to parse it. First he looks at the XML Parser, an event-based parser, and SimpleXML, an easy way to access the contents of a well-formed XML document. Snippets of code are provided for each to show you how to put them into practice.
2012-01-26 17:13:
In response to some criticism about his previous post with some framework benchmarks, Wojciech Sznapka has posted updated results using the latest versions of each framework. In my previous post Modern framework comparison I presented performance tests, which compared Ruby On Rails, Django and Symfony2. After recieving a feedback in comments I decided to run this benchmark one more time on my own laptop (instead of on my hosting). The reason was simple: enviroment was outdated. There were some overall performance increases were seen, but some statistics were higher - the "time per request" for all of them grew, some by quite a bit. He presents these benchmarks with a caveat, though: You should never choose framework based on benchmarks. Those shows them from one point of view, but there are plenty of other aspects, such as support, community, maturity, number of ready to use components.
Wojciech Sznapka's Blog: Always use most latest versions for benchmarks
In response to some criticism about his previous post with some framework benchmarks, Wojciech Sznapka has posted updated results using the latest versions of each framework. In my previous post Modern framework comparison I presented performance tests, which compared Ruby On Rails, Django and Symfony2. After recieving a feedback in comments I decided to run this benchmark one more time on my own laptop (instead of on my hosting). The reason was simple: enviroment was outdated. There were some overall performance increases were seen, but some statistics were higher - the "time per request" for all of them grew, some by quite a bit. He presents these benchmarks with a caveat, though: You should never choose framework based on benchmarks. Those shows them from one point of view, but there are plenty of other aspects, such as support, community, maturity, number of ready to use components.
2012-01-26 16:48:
Mike Purcell has a new post to his blog showing a method he's followed to be able to use the popular PHPUnit unit testing software without having to go through the PEAR installer to get there. PHPUnit is a great tool to protect us developers from introducing new defects when adding new features or re-factoring code. However there is one HUGE downside to PHPUnit; it must be installed using PEAR. Personally, I don't like 'auto-installers', I'd prefer to know what exactly is happening behind the scenes with regards to which libraries are required and how they are being called. [...] After breaking down the PHPUnit source code, I realized it could be installed without going through PEAR, and without too much headache. He walks you through the directories you'll need to set up (test/vendor), the commands you'll need to get the latest version and unpack it, changes to set up some symlinks and updating the PHPUnit source to modify the autoloader, bootstrap and phpunit executable.
Mike Purcell's Blog: Use PHPUnit without PEAR
Mike Purcell has a new post to his blog showing a method he's followed to be able to use the popular PHPUnit unit testing software without having to go through the PEAR installer to get there. PHPUnit is a great tool to protect us developers from introducing new defects when adding new features or re-factoring code. However there is one HUGE downside to PHPUnit; it must be installed using PEAR. Personally, I don't like 'auto-installers', I'd prefer to know what exactly is happening behind the scenes with regards to which libraries are required and how they are being called. [...] After breaking down the PHPUnit source code, I realized it could be installed without going through PEAR, and without too much headache. He walks you through the directories you'll need to set up (test/vendor), the commands you'll need to get the latest version and unpack it, changes to set up some symlinks and updating the PHPUnit source to modify the autoloader, bootstrap and phpunit executable.
2012-01-26 15:35:
On his blog today Francois Zaninotto has a post that aims to introduce those with a PHP background to how Node.js works. In this first part of his series, he tries to explain the idea of event-driven programming - parallel processing of different parts of an application based on some action taken in the code. For a PHP developer, asynchronicity is the most puzzling aspect of the Node.js runtime. It's simply a new way to write programs. And once you pass the first learning steps, event-driven programming opens a world of possibilities PHP programmers would never dream of. I'll try to explain you how it works, but first, let's talk about pasta. In his "pasta" example, he shows how a typical PHP application would make a "Pan" object, call a "warm" action, "add olive oil", etc. All of this happens in sequence, though and takes 29 "minutes" to complete. To help things along, he implements an "EventLoop" class that handles tracking the timing and includes two methods to execute callbacks and delayed methods. He expands on this example with asynchronous objects and method calls to handle multiple things at once. He relates this to what Node.js offers - a built in event handling system, an included EventLoop object and native blocking I/O operations.
Francois Zaninotto's Blog: Node.js for PHP Programmers #1: Event-Driven Programming... and Pasta
On his blog today Francois Zaninotto has a post that aims to introduce those with a PHP background to how Node.js works. In this first part of his series, he tries to explain the idea of event-driven programming - parallel processing of different parts of an application based on some action taken in the code. For a PHP developer, asynchronicity is the most puzzling aspect of the Node.js runtime. It's simply a new way to write programs. And once you pass the first learning steps, event-driven programming opens a world of possibilities PHP programmers would never dream of. I'll try to explain you how it works, but first, let's talk about pasta. In his "pasta" example, he shows how a typical PHP application would make a "Pan" object, call a "warm" action, "add olive oil", etc. All of this happens in sequence, though and takes 29 "minutes" to complete. To help things along, he implements an "EventLoop" class that handles tracking the timing and includes two methods to execute callbacks and delayed methods. He expands on this example with asynchronous objects and method calls to handle multiple things at once. He relates this to what Node.js offers - a built in event handling system, an included EventLoop object and native blocking I/O operations.
2012-01-25 18:08:
In this recent post on Reddit.com, there's some good discussion/feedback about the proposed redesign of PHP.net. Opinions from commentors range widly: "The layout's nice. But those colors are downright disgusting." "To be honest, the new version is 100x better." "It's definitely way better than the old design but still not exactly great is it?.." "Much more profressional. Welcome to the 21st century PHP.net." Have an opinion on the new layout? voice it here!
Reddit.com: PHP.net gets a new design. Opinions divided
In this recent post on Reddit.com, there's some good discussion/feedback about the proposed redesign of PHP.net. Opinions from commentors range widly: "The layout's nice. But those colors are downright disgusting." "To be honest, the new version is 100x better." "It's definitely way better than the old design but still not exactly great is it?.." "Much more profressional. Welcome to the 21st century PHP.net." Have an opinion on the new layout? voice it here!
2012-01-25 17:19:
On the Codeception blog there's an introduction to the Codeception tool, a behavior-driven framework written in PHP (in the spirit of Behat). How often do you see PHP projects with no line of test written? From my experience, this situation happens quite often. We should state the unpleasant fact that tests are not so popular around the PHP world. Surely, the advanced developers with 5+ years of experience in PHP and other programming languages understand importance of testing and PHPUnit usage. But juniors and seniors are just skipping testing and, therefore, produce unstable web applications. A code example of the framework in use is included in the post - a test on a class using methods like "wantTo", "amOnPage", "fillField" and "click". The installation is pretty simple and it gives you a quick way to start working on acceptance, functional and unit tests. In BDD fashion, the tests are written in a more "natural language" than traditional unit tests making them easier for the non-developers (like QA) to write. Their example loads a page, fills in some form fields and submits the form to check the result.
Codeception Blog: Introduction to Codeception
On the Codeception blog there's an introduction to the Codeception tool, a behavior-driven framework written in PHP (in the spirit of Behat). How often do you see PHP projects with no line of test written? From my experience, this situation happens quite often. We should state the unpleasant fact that tests are not so popular around the PHP world. Surely, the advanced developers with 5+ years of experience in PHP and other programming languages understand importance of testing and PHPUnit usage. But juniors and seniors are just skipping testing and, therefore, produce unstable web applications. A code example of the framework in use is included in the post - a test on a class using methods like "wantTo", "amOnPage", "fillField" and "click". The installation is pretty simple and it gives you a quick way to start working on acceptance, functional and unit tests. In BDD fashion, the tests are written in a more "natural language" than traditional unit tests making them easier for the non-developers (like QA) to write. Their example loads a page, fills in some form fields and submits the form to check the result.
2012-01-25 16:50:
New on DevShed today there's a tutorial looking at using one of the newer features of PHP, closures, as view helpers in a basic templating system. In this two-part tutorial I'll be showing you, in a step-by-step fashion, how to use the goodies offered by closures in the implementation of an object-based, easily extendable template system. This system will allow you to embed anonymous functions easily into template files, and call them as typical view helpers, too. He starts the process of creating the templating system by defining two interfaces, the View and DataHandler. Using these as a base, he creates an instance of the ViewInterface (a "View" class) that can set the template file to use, set values to be displayed and render the formatted output. Included is a basic template and how to use the View class to set values into it. The "render" method is called on the view and the HTML markup is produced. The closure comes in when they try to call a value "clientIp" that needs to do something more complicated than just having a string assigned to it.
DevShed: Using Closures as View Helpers
New on DevShed today there's a tutorial looking at using one of the newer features of PHP, closures, as view helpers in a basic templating system. In this two-part tutorial I'll be showing you, in a step-by-step fashion, how to use the goodies offered by closures in the implementation of an object-based, easily extendable template system. This system will allow you to embed anonymous functions easily into template files, and call them as typical view helpers, too. He starts the process of creating the templating system by defining two interfaces, the View and DataHandler. Using these as a base, he creates an instance of the ViewInterface (a "View" class) that can set the template file to use, set values to be displayed and render the formatted output. Included is a basic template and how to use the View class to set values into it. The "render" method is called on the view and the HTML markup is produced. The closure comes in when they try to call a value "clientIp" that needs to do something more complicated than just having a string assigned to it.
2012-01-25 15:36:
In this final post of his series about building a framework on Symfony2 components, Fabien Potencier focuses again on flexibility - allowing you to have more than one front controller with different configurations thanks to dependency injections. Does it means that we have to make a choice between flexibility, customization, ease of testing and not having to copy and paste the same code into each application front controller? As you might expect, there is a solution. We can solve all these issues and some more by using the Symfony2 dependency injection container. The Symfony2 DIC (DependencyInjection) allows you to create a container with the objects and settings that you want and inject that into the main "Framework" class for its use. He registers most of the components he's added over the series like the UrlMatcher, RouterListener, ExceptionListener, EventDispatcher and the Framework class itself. This is all stored in a separate file(s) and can be conditionally included based on your environment. He shows how to register a custom listener, add parameters to the DIC configuration.
Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 12)
In this final post of his series about building a framework on Symfony2 components, Fabien Potencier focuses again on flexibility - allowing you to have more than one front controller with different configurations thanks to dependency injections. Does it means that we have to make a choice between flexibility, customization, ease of testing and not having to copy and paste the same code into each application front controller? As you might expect, there is a solution. We can solve all these issues and some more by using the Symfony2 dependency injection container. The Symfony2 DIC (DependencyInjection) allows you to create a container with the objects and settings that you want and inject that into the main "Framework" class for its use. He registers most of the components he's added over the series like the UrlMatcher, RouterListener, ExceptionListener, EventDispatcher and the Framework class itself. This is all stored in a separate file(s) and can be conditionally included based on your environment. He shows how to register a custom listener, add parameters to the DIC configuration.
2012-01-24 20:40:
On PHPMaster.com today there's a new post from Alejandro Gervasio about a part of the SOLID development methods - the Liskov Substitution Principle - the idea that objects should be replaceable with instances of their subtypes without a change to the architecture of the application. Even when the formal definition of the LSP makes eyes roll back (including mine), at its core it boils down to avoiding brittlely-defined class hierarchies where the descendants expose a behavior radically different from the base abstractions consuming the same contract. He includes an example with a "deleted scene" from the Matrix depicting an attempted override of the PDO functionality with a subclass that, unfortunately, does not match the original's structure/method definitions. The problem was in the difference between the method signature for the "query" method. It help resolve situations like this he recommends creating a "contract" in the form of an interface your code can implement, forcing it to conform to a certain structure. Using this, he provides a rewrite of the "PdoAdapter" class to match the original signature
PHPMaster.com: The Liskov Substitution Principle
On PHPMaster.com today there's a new post from Alejandro Gervasio about a part of the SOLID development methods - the Liskov Substitution Principle - the idea that objects should be replaceable with instances of their subtypes without a change to the architecture of the application. Even when the formal definition of the LSP makes eyes roll back (including mine), at its core it boils down to avoiding brittlely-defined class hierarchies where the descendants expose a behavior radically different from the base abstractions consuming the same contract. He includes an example with a "deleted scene" from the Matrix depicting an attempted override of the PDO functionality with a subclass that, unfortunately, does not match the original's structure/method definitions. The problem was in the difference between the method signature for the "query" method. It help resolve situations like this he recommends creating a "contract" in the form of an interface your code can implement, forcing it to conform to a certain structure. Using this, he provides a rewrite of the "PdoAdapter" class to match the original signature
2012-01-24 19:18:
On the PEAR blog today there's an update about the migration over to github that 5 million lines of code has already made: Since October 2011, 5 million lines of the PEAR codebase has shifted to github. Hand in hand with this shift has been the tireless work of Daniel C - someone who brazenly said "I will fix the failing packages!" in the tail end of last year. As a result of his efforts a list has been created of known good packages to use with PHP 5.4. Other results include: All test infrastructure upgrading to PHP 5.4 release candidates All database driven test suites executing properly, catching a variety of simple bugs Hitting a point of "near zero" patches to be applied to unmaintained packages Increasingly, the PEAR QA team is delivering PHP 5.3+ friendly forks of existing packages
PEAR Blog: What would you do with 5 million lines of code?
On the PEAR blog today there's an update about the migration over to github that 5 million lines of code has already made: Since October 2011, 5 million lines of the PEAR codebase has shifted to github. Hand in hand with this shift has been the tireless work of Daniel C - someone who brazenly said "I will fix the failing packages!" in the tail end of last year. As a result of his efforts a list has been created of known good packages to use with PHP 5.4. Other results include: All test infrastructure upgrading to PHP 5.4 release candidates All database driven test suites executing properly, catching a variety of simple bugs Hitting a point of "near zero" patches to be applied to unmaintained packages Increasingly, the PEAR QA team is delivering PHP 5.3+ friendly forks of existing packages
2012-01-24 18:04:
In part eleven of his "Build a Framework on top of Symfony2", Fabien Potencier improves on his earlier versions of the code by adding in the HttpKernel support for handling events and errors that might come up in the application. If you were to use our framework right now, you would probably have to add support for custom error messages. Right now, we have 404 and 500 error support but the responses are hardcoded in the framework itself. Making them customizable is easy enough though: dispatch a new event and listen to it. Doing it right means that the listener has to call a regular controller. But what if the error controller throws an exception? You will end up in an infinite loop. There should be an easier way, right? Using the "RouterListener" functionality, he sets up an "ExceptionListener" and points that to an error handling controller with its own "exceptionAction". This action takes the exception information and displays a "Something went wrong!" message along with the details. He also includes an update to the Response handling to allow for returning a string back from the controller instead of a Response object.
Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 11)
In part eleven of his "Build a Framework on top of Symfony2", Fabien Potencier improves on his earlier versions of the code by adding in the HttpKernel support for handling events and errors that might come up in the application. If you were to use our framework right now, you would probably have to add support for custom error messages. Right now, we have 404 and 500 error support but the responses are hardcoded in the framework itself. Making them customizable is easy enough though: dispatch a new event and listen to it. Doing it right means that the listener has to call a regular controller. But what if the error controller throws an exception? You will end up in an infinite loop. There should be an easier way, right? Using the "RouterListener" functionality, he sets up an "ExceptionListener" and points that to an error handling controller with its own "exceptionAction". This action takes the exception information and displays a "Something went wrong!" message along with the details. He also includes an update to the Response handling to allow for returning a string back from the controller instead of a Response object.
2012-01-24 17:20:
Michael Nitschinger has a new post to his blog looking at using the popular Composer tool for package management together with Lithium to make dependency management simpler. Composer is a command-line tool that helps you manage your application dependencies. It automatically fetches packages, resolves dependencies and is easy to configure. [...] Currently, Lithium doesn't provide Composer packages out of the box, but it's easy to write one. He starts the post with an introduction to using Composer for those new to the tool, then moves quickly into setting up your "composer.json" file to pull in the Lithium updates from their github account. Additionally, he shows how to add a dependency for twig in the "require" section and pull it down at the same time (with dependencies).
Michael Nitschinger's Blog: Playing with Composer and Lithium
Michael Nitschinger has a new post to his blog looking at using the popular Composer tool for package management together with Lithium to make dependency management simpler. Composer is a command-line tool that helps you manage your application dependencies. It automatically fetches packages, resolves dependencies and is easy to configure. [...] Currently, Lithium doesn't provide Composer packages out of the box, but it's easy to write one. He starts the post with an introduction to using Composer for those new to the tool, then moves quickly into setting up your "composer.json" file to pull in the Lithium updates from their github account. Additionally, he shows how to add a dependency for twig in the "require" section and pull it down at the same time (with dependencies).
2012-01-24 16:26:
In a new post to his blog Paul Reinheimer talks about replacing sessions with cookies and some of the (security) pitfalls that can come with it. I've seen several instances where people have demonstrated the ease with which encrypted cookies can replace sessions within PHP. Michael Nitschinger wrote a piece recently demonstrating the switch with Lithium, while CodeIgniter does this by default (optionally encrypting). The problem is that while replacing sessions with cookies works, it introduces a few risks not present with native session support, and these risks tend to be under documented. He gives an illustration of an attacker who sits between Amazon and one of their warehouses. Despite encrypting their order details, all it would take is the attacker to grab an order and copy it and resend (a "replay attack"). He's created an example application to illustrate the point (source on github). The attacker doesn't even have to know what the encrypted information contains - they only have to replicate it.
Paul Reinheimer's Blog: Cookies don't replace Sessions
In a new post to his blog Paul Reinheimer talks about replacing sessions with cookies and some of the (security) pitfalls that can come with it. I've seen several instances where people have demonstrated the ease with which encrypted cookies can replace sessions within PHP. Michael Nitschinger wrote a piece recently demonstrating the switch with Lithium, while CodeIgniter does this by default (optionally encrypting). The problem is that while replacing sessions with cookies works, it introduces a few risks not present with native session support, and these risks tend to be under documented. He gives an illustration of an attacker who sits between Amazon and one of their warehouses. Despite encrypting their order details, all it would take is the attacker to grab an order and copy it and resend (a "replay attack"). He's created an example application to illustrate the point (source on github). The attacker doesn't even have to know what the encrypted information contains - they only have to replicate it.
2012-01-24 15:50:
On the KingFoo blog today there's an excellent look at everything new coming up in PHP 5.4, the next version of PHP set to be released in early February. PHP 5.4 will be stable soon. In this post I'll try to give you an overview and examples of the new PHP 5.4 features. If you want to try out PHP 5.4 (which is currently in RC3), it has to be installed first. I suggest that you try this out on a virtual machine so you don't break your current PHP version. Improvements on the list include: Improved Session Extension Built-in webserver Traits Array dereferencing Method calls through arrays Binary notation for integers Instantiate a class without running constructor Improved JSON extension Improved CURL extension And this is just a start - they detail each of the improvements and provide code where needed to illustrate the update. They also link over to the PHP.net manual (or PHP bug tracker) for more information on the new feature/change.
KingFoo Blog: PHP 5.4 - What's new?
On the KingFoo blog today there's an excellent look at everything new coming up in PHP 5.4, the next version of PHP set to be released in early February. PHP 5.4 will be stable soon. In this post I'll try to give you an overview and examples of the new PHP 5.4 features. If you want to try out PHP 5.4 (which is currently in RC3), it has to be installed first. I suggest that you try this out on a virtual machine so you don't break your current PHP version. Improvements on the list include: Improved Session Extension Built-in webserver Traits Array dereferencing Method calls through arrays Binary notation for integers Instantiate a class without running constructor Improved JSON extension Improved CURL extension And this is just a start - they detail each of the improvements and provide code where needed to illustrate the update. They also link over to the PHP.net manual (or PHP bug tracker) for more information on the new feature/change.
2012-01-24 14:32:
The PHP.net has announced the availability of the latest Release Candidate in the PHP 5.4.0 series - PHP 5.4.0 RC6: The PHP development team announces the 6th release candidate of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. [...] The 6th release candidate focused on improving traits. Please test them carefully and help us to identify bugs in order to ensure that the release is solid and all things behave as expected. You can download this latest release from the PHP QA site (Windows binaries) and test it on your local instance/applications. Any and all feedback about issues should be reported to either the QA mailing list or on the bug tracker. A complete list of updates is available in the NEWS file.
PHP.net: PHP 5.4.0 RC6 released
The PHP.net has announced the availability of the latest Release Candidate in the PHP 5.4.0 series - PHP 5.4.0 RC6: The PHP development team announces the 6th release candidate of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. [...] The 6th release candidate focused on improving traits. Please test them carefully and help us to identify bugs in order to ensure that the release is solid and all things behave as expected. You can download this latest release from the PHP QA site (Windows binaries) and test it on your local instance/applications. Any and all feedback about issues should be reported to either the QA mailing list or on the bug tracker. A complete list of updates is available in the NEWS file.
2012-01-24 14:00:
Latest PECL Releases: pecl_http 2.0.0dev4 svm 0.1.5 gmagick 1.1.0RC2 gmagick 1.1.0RC1
Community News: Latest PECL Releases for 01.24.2012
Latest PECL Releases: pecl_http 2.0.0dev4 svm 0.1.5 gmagick 1.1.0RC2 gmagick 1.1.0RC1
2012-01-23 20:04:
In this new post to his blog Jani Hartikainen wonders if "everything needs to be integrated into a framework". There is occasionally people asking about things such as "Is there an integration for X in framework Y?" Then they are disappointed when it isn't, acting as if it's a really bad thing. But why do things need to be integrated to begin with? He points out that other frameworks (ex. Ruby on Rails) have a lot of things integrated, but he doesn't agree that this should be the standard. He suggests that, by not having tools that are tightly coupled with the framework you're using, you open yourself up to a wider, possibly better range of external tools. One could argue that integrated libraries give you a productivity boost. While it may be so, I think the main boost you get is the very first steps: It's easier to get started, but after that the benefit fades. In the long run, it may even turn into a poor investment in general, as you could have learned a general purpose tool instead.
Jani Hartikainen's Blog: Why does everything need to be integrated into a framework?
In this new post to his blog Jani Hartikainen wonders if "everything needs to be integrated into a framework". There is occasionally people asking about things such as "Is there an integration for X in framework Y?" Then they are disappointed when it isn't, acting as if it's a really bad thing. But why do things need to be integrated to begin with? He points out that other frameworks (ex. Ruby on Rails) have a lot of things integrated, but he doesn't agree that this should be the standard. He suggests that, by not having tools that are tightly coupled with the framework you're using, you open yourself up to a wider, possibly better range of external tools. One could argue that integrated libraries give you a productivity boost. While it may be so, I think the main boost you get is the very first steps: It's easier to get started, but after that the benefit fades. In the long run, it may even turn into a poor investment in general, as you could have learned a general purpose tool instead.
2012-01-23 19:55:
On 7php.com today there's a new community interview - this time it's with Michelangelo van Dam, the President of the PHPBenelux user group and well known PHP speaker/community advocate. In this edition, I talked with Michelangelo van Dam a senior PHP/Zend Framework consultant. This man really needs no introduction; he is so much of an invaluable asset to the PHP community. As per wefollow.com, he is ranked as the 4th (out of 113) most influential person on Twitter for #zendframework and as the 25th (out of 2,543) most influential person for #php Questions in the interview cover everything from a bit of history about Michelangelo out to how supportive the PHP community is: Give and expect nothing in return. People appreciate it more when you give something from the heart instead of giving something as a favor for a future return. Other questions touch on his "community animal" nickname, his community/life balance and his tracking of the work Microsoft is doing to help the PHP language.
7php.com: Interview With Michelangelo van Dam - President Of PHPBenelux PHP Use
On 7php.com today there's a new community interview - this time it's with Michelangelo van Dam, the President of the PHPBenelux user group and well known PHP speaker/community advocate. In this edition, I talked with Michelangelo van Dam a senior PHP/Zend Framework consultant. This man really needs no introduction; he is so much of an invaluable asset to the PHP community. As per wefollow.com, he is ranked as the 4th (out of 113) most influential person on Twitter for #zendframework and as the 25th (out of 2,543) most influential person for #php Questions in the interview cover everything from a bit of history about Michelangelo out to how supportive the PHP community is: Give and expect nothing in return. People appreciate it more when you give something from the heart instead of giving something as a favor for a future return. Other questions touch on his "community animal" nickname, his community/life balance and his tracking of the work Microsoft is doing to help the PHP language.
2012-01-23 18:14:
Lorna Mitchell is back with a second installment in her "Building a RESTful PHP Server" series with this new post about handling and routing the incoming requests. (You can find the first part about working with the request here) This is the second part of a series, showing how you might write a RESTful API using PHP. This part covers the routing, autoloading, and controller code for the service, and follows on from the first installment which showed how to parse the incoming request to get all the information you need. She shows how to grab the controller name from the incoming request (based on her previous code), create the object for it and execute the requested action name. Also included is a sample autoloader and a basic controller - a UsersController with "getAction" and "postAction" methods for responding to GET and POST requests.
Lorna Mitchell's Blog: Building A RESTful PHP Server: Routing the Request
Lorna Mitchell is back with a second installment in her "Building a RESTful PHP Server" series with this new post about handling and routing the incoming requests. (You can find the first part about working with the request here) This is the second part of a series, showing how you might write a RESTful API using PHP. This part covers the routing, autoloading, and controller code for the service, and follows on from the first installment which showed how to parse the incoming request to get all the information you need. She shows how to grab the controller name from the incoming request (based on her previous code), create the object for it and execute the requested action name. Also included is a sample autoloader and a basic controller - a UsersController with "getAction" and "postAction" methods for responding to GET and POST requests.
2012-01-23 17:55:
Fabien Potencier has posted the tenth part of his series about making a custom framework based on the Symfony2 component set. In this latest article he focuses on using the HttpKernelInterface to add in some additional HTTP-related support. In the conclusion of the second part of this series, I've talked about one great benefit of using the Symfony2 components: the interoperability between all frameworks and applications using them. Let's do a big step towards this goal by making our framework implement HttpKernelInterface. By changing up the custom framework just a bit to use HttpKernelInterface, you get built-in HTTP caching (HttpCache). He shows how to use this class to create some custom caching rules and how to use Edge Side Includes to only cache partial parts of the page.
Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 10)
Fabien Potencier has posted the tenth part of his series about making a custom framework based on the Symfony2 component set. In this latest article he focuses on using the HttpKernelInterface to add in some additional HTTP-related support. In the conclusion of the second part of this series, I've talked about one great benefit of using the Symfony2 components: the interoperability between all frameworks and applications using them. Let's do a big step towards this goal by making our framework implement HttpKernelInterface. By changing up the custom framework just a bit to use HttpKernelInterface, you get built-in HTTP caching (HttpCache). He shows how to use this class to create some custom caching rules and how to use Edge Side Includes to only cache partial parts of the page.
2012-01-23 16:25:
On NetTuts.com today a new tutorial has been posted to help you test your applications and make it a simpler process using the EnhancePHP framework. EnhancePHP is a lightweight Open Source PHP unit testing framework with support for mocks and stubs. You know it; I know it. We should be testing our code more than we do. Part of the reason we don't, I think, is that we don't know exactly how. Well, I'm getting rid of that excuse today: I'm teaching you to test your PHP with the EnhancePHP framework. He shows you how to download it, get it installed and creates a simple structure to do some TDD (Test-Driven Development) with it. His tests check three things - valid email addresses, username restrictions and phone number formatting. He also includes a look at creating mocks/stubs for a "scoreboard" example. You can find out more about the EnhancePHP framework on its github page.
NetTuts.com: Testing your PHP Codebase with EnhancePHP
On NetTuts.com today a new tutorial has been posted to help you test your applications and make it a simpler process using the EnhancePHP framework. EnhancePHP is a lightweight Open Source PHP unit testing framework with support for mocks and stubs. You know it; I know it. We should be testing our code more than we do. Part of the reason we don't, I think, is that we don't know exactly how. Well, I'm getting rid of that excuse today: I'm teaching you to test your PHP with the EnhancePHP framework. He shows you how to download it, get it installed and creates a simple structure to do some TDD (Test-Driven Development) with it. His tests check three things - valid email addresses, username restrictions and phone number formatting. He also includes a look at creating mocks/stubs for a "scoreboard" example. You can find out more about the EnhancePHP framework on its github page.
2012-01-23 15:37:
On PHPMaster.com today there's a a new tutorial helping you take some first steps with CakePHP, a popular full-stack PHP framework, by Vito Tardia. CakePHP is a framework that provides a solid base for PHP development. It allows users at any skill level to rapidly develop robust web applications. [...] Personally, the reason why I prefer CakePHP over other PHP frameworks is its better support for console applications. CakePHP has a powerful console tool that can be customized to build applications for both the web and the console world. In this article I'll introduce you to two of CakePHP's most useful features: automatic code generation using the console tool Bake and dynamic scaffolding. He walks you through the full (user friendly) installation and configuration, a few changes to increase security and where to go to set up your database connection. From there he shows how to use the "Bake" command to generate a "subscribers" model and automatically create the user interfaces to work with it (CRUD operations)
PHPMaster.com: Rapid Application Development with CakePHP
On PHPMaster.com today there's a a new tutorial helping you take some first steps with CakePHP, a popular full-stack PHP framework, by Vito Tardia. CakePHP is a framework that provides a solid base for PHP development. It allows users at any skill level to rapidly develop robust web applications. [...] Personally, the reason why I prefer CakePHP over other PHP frameworks is its better support for console applications. CakePHP has a powerful console tool that can be customized to build applications for both the web and the console world. In this article I'll introduce you to two of CakePHP's most useful features: automatic code generation using the console tool Bake and dynamic scaffolding. He walks you through the full (user friendly) installation and configuration, a few changes to increase security and where to go to set up your database connection. From there he shows how to use the "Bake" command to generate a "subscribers" model and automatically create the user interfaces to work with it (CRUD operations)
2012-01-23 14:03:
Latest PEAR Releases: Text_LanguageDetect 0.3.0
Community News: Latest PEAR Releases for 01.23.2012
Latest PEAR Releases: Text_LanguageDetect 0.3.0
2012-01-20 20:54:
Jakub Zalas has a recent post to his blog with a hint about how to test Symfony container services by mocking them (when testing with Behat) with the help of Mockery (and the PSSMockeryBundle). Mocking objects in unit tests is pretty straightforward as every object used in a test case is usually created in a scope of one test class. In functional tests it's a bit harder since we either don't have full control over objects being created or it's simply too laborious to mock half the framework. [...] We're getting the service from a container [in the example] and calling a method which should send a lead. The problem is we don't want to actually call an API while executing Behat scenarios. Rather than hitting up the API for each test, he opts to create mock objects and results with the tools Mockery has to offer. He gives code for a "is API available" method that either returns a valid container or a mocked object, depending on how it was called.
Jakub Zalas' Blog: Mocking Symfony Container services in Behat scenarios with Mockery
Jakub Zalas has a recent post to his blog with a hint about how to test Symfony container services by mocking them (when testing with Behat) with the help of Mockery (and the PSSMockeryBundle). Mocking objects in unit tests is pretty straightforward as every object used in a test case is usually created in a scope of one test class. In functional tests it's a bit harder since we either don't have full control over objects being created or it's simply too laborious to mock half the framework. [...] We're getting the service from a container [in the example] and calling a method which should send a lead. The problem is we don't want to actually call an API while executing Behat scenarios. Rather than hitting up the API for each test, he opts to create mock objects and results with the tools Mockery has to offer. He gives code for a "is API available" method that either returns a valid container or a mocked object, depending on how it was called.
2012-01-20 19:09:
Michael Nitschinger has a new post for the Lithium framework users out there - a quick tutorial about encrypting your session information with the new built in "Encrypt" strategy feature. If you check out the master branch, you can use the new Encrypt strategy to encrypt your session data automatically. This means that you can read and write session data in cleartext and they will be encrypted on the fly before getting stored (in a cookie, for example). You'll need the mcrypt extension installed for it to work correctly, but it makes storing the encrypted version of your data more or less automatic. Just set up your Session configuration to use it as a strategy and any time you call a "read" or "write" the hard work is handled for you. For those more interests in what's "under the hood" he goes on to talk about how the strategy works, what cipher it uses by default, how to change it and the default string to use in hashing.
Michael Nitschinger's Blog: Session Encryption with Lithium
Michael Nitschinger has a new post for the Lithium framework users out there - a quick tutorial about encrypting your session information with the new built in "Encrypt" strategy feature. If you check out the master branch, you can use the new Encrypt strategy to encrypt your session data automatically. This means that you can read and write session data in cleartext and they will be encrypted on the fly before getting stored (in a cookie, for example). You'll need the mcrypt extension installed for it to work correctly, but it makes storing the encrypted version of your data more or less automatic. Just set up your Session configuration to use it as a strategy and any time you call a "read" or "write" the hard work is handled for you. For those more interests in what's "under the hood" he goes on to talk about how the strategy works, what cipher it uses by default, how to change it and the default string to use in hashing.
2012-01-20 18:29:
On the IBM developerWorks site today there's a new tutorial showing you how to store shared data directly to a shared memory space of your PHP application. Once created, and given proper permissions, other processes in the same machine can manipulate those segments by: read, write, and delete. This means that an application written in C can share information with an application written in other languages, such as Java or PHP. They can all share information, as long as they can access and understand that information. [...] This article's proposal is simple, learn how to create and manipulate shared memory segments with PHP and use them to store datasets that other applications can use. Your PHP installation will need to have been compiled with "enable-shmop" to work with the code in this tutorial. Their examples show how to use the shmop_open, shmop_write and other related functions to read, write, remove and close segments in the shared memory space. They also include an example of using the SimpleSHM library to make it easier to interact with the shared memory space as a standard storage location.
IBM developerWorks: Store datasets directly in shared memory with PHP
On the IBM developerWorks site today there's a new tutorial showing you how to store shared data directly to a shared memory space of your PHP application. Once created, and given proper permissions, other processes in the same machine can manipulate those segments by: read, write, and delete. This means that an application written in C can share information with an application written in other languages, such as Java or PHP. They can all share information, as long as they can access and understand that information. [...] This article's proposal is simple, learn how to create and manipulate shared memory segments with PHP and use them to store datasets that other applications can use. Your PHP installation will need to have been compiled with "enable-shmop" to work with the code in this tutorial. Their examples show how to use the shmop_open, shmop_write and other related functions to read, write, remove and close segments in the shared memory space. They also include an example of using the SimpleSHM library to make it easier to interact with the shared memory space as a standard storage location.
2012-01-20 17:57:
The WebDev Radio podcast has released their latest episode today - an interview with Jeff Carouth (@jcarouth) from last year's ZendCon conference: I chatted with Jeff Carouth about his day to day worklife as a PHP guy (among other things) at Texas A and M. Learn the A and M mascot name, Jeff's favorite design pattern, and more. You can listen to this latest episode either via the in-page player or by downloading the mp3 directly.
WebDevRadio: Episode 95:Jeff Carouth Interview from Zendcon 2011
The WebDev Radio podcast has released their latest episode today - an interview with Jeff Carouth (@jcarouth) from last year's ZendCon conference: I chatted with Jeff Carouth about his day to day worklife as a PHP guy (among other things) at Texas A and M. Learn the A and M mascot name, Jeff's favorite design pattern, and more. You can listen to this latest episode either via the in-page player or by downloading the mp3 directly.
2012-01-20 16:12:
On DZone.com today Giorgio Sironi has a quick tutorial showing you how to set up and use the PHPUnit_Selenium component in the latest releases of the popular testing software. With the 1.2 release, PHPUnit_Selenium supports (basically) for the first time the Selenium 2 WebDriver API. While PHPUnit_Selenium already worked with Selenium 2, it did so only by using the Selenium 1 emulation included in the jar; now it provides an object-oriented API right natively supported in a base PHPUnit test case, shipped in PHPUnit's PEAR channel. He includes the steps you'll need to pull it from the PEAR channel and how to set up a test case based on the PHPUnit_Extensions_Selenium2TestCase object. He gives a few examples of how to select various components on the page (via CSS selectors and XPath), assert that the right information is there and interact with forms.
DZone.com: PHPUnit_Selenium
On DZone.com today Giorgio Sironi has a quick tutorial showing you how to set up and use the PHPUnit_Selenium component in the latest releases of the popular testing software. With the 1.2 release, PHPUnit_Selenium supports (basically) for the first time the Selenium 2 WebDriver API. While PHPUnit_Selenium already worked with Selenium 2, it did so only by using the Selenium 1 emulation included in the jar; now it provides an object-oriented API right natively supported in a base PHPUnit test case, shipped in PHPUnit's PEAR channel. He includes the steps you'll need to pull it from the PEAR channel and how to set up a test case based on the PHPUnit_Extensions_Selenium2TestCase object. He gives a few examples of how to select various components on the page (via CSS selectors and XPath), assert that the right information is there and interact with forms.
2012-01-20 15:31:
Brian Swan has a new post to his blog about using Azure Federations in your PHP applications: In a nutshell, SQL Azure Federations introduces an abstraction layer for the sharding of SQL Azure databases. The value in federations lies in your ability to have elastic scalability of the database layer of your application (to match the elastic scalability of the rest of your application when it's running in the cloud). And, one nice thing about the way federations work is that nearly everything can be done with simple SQL commands. Of course, that means that using SQL Azure Federations via PHP should be easy. So in this post, I'll introduce you to SQL Azure federations by showing you how to use them via PHP. He uses the SQL Server drivers to make the connection to the Azure instance and, based on his included code, creates a federation and tables inside it. He also shows how to insert data into these tables, split up a federation, insert data after this split and how to query a federation member with the filtering on or off.
Brian Swan's Blog: Using SQL Azure Federations via PHP
Brian Swan has a new post to his blog about using Azure Federations in your PHP applications: In a nutshell, SQL Azure Federations introduces an abstraction layer for the sharding of SQL Azure databases. The value in federations lies in your ability to have elastic scalability of the database layer of your application (to match the elastic scalability of the rest of your application when it's running in the cloud). And, one nice thing about the way federations work is that nearly everything can be done with simple SQL commands. Of course, that means that using SQL Azure Federations via PHP should be easy. So in this post, I'll introduce you to SQL Azure federations by showing you how to use them via PHP. He uses the SQL Server drivers to make the connection to the Azure instance and, based on his included code, creates a federation and tables inside it. He also shows how to insert data into these tables, split up a federation, insert data after this split and how to query a federation member with the filtering on or off.
2012-01-20 14:02:
Popular posts from PHPDeveloper.org for the past week:Gonzalo Ayuso's Blog: Checking the performance of PHP exceptions PHPMaster.com: MongoDB Revisited DZone.com: Open/Closed Principle on real world code Stuart Herbert's Blog: ContractLib - An Introduction & Comparing it to PHP's Assert Stuart Herbert's Blog: Introducing ContractLib (Programming Contracts) Larry Garfield's Blog: PHP project structure survey Dave Marshall's Blog: Defending against Cache Stampedes Ulf Wendel's Blog: PHP mysqli quickstart is online! NetTuts.com: Zend Framework from Scratch - Models and Integrating Doctrine ORM Developer Drive: Building a PHP Ad Tracker: Creating the Database Tables
Site News: Popular Posts for the Week of 01.20.2012
Popular posts from PHPDeveloper.org for the past week:Gonzalo Ayuso's Blog: Checking the performance of PHP exceptions PHPMaster.com: MongoDB Revisited DZone.com: Open/Closed Principle on real world code Stuart Herbert's Blog: ContractLib - An Introduction & Comparing it to PHP's Assert Stuart Herbert's Blog: Introducing ContractLib (Programming Contracts) Larry Garfield's Blog: PHP project structure survey Dave Marshall's Blog: Defending against Cache Stampedes Ulf Wendel's Blog: PHP mysqli quickstart is online! NetTuts.com: Zend Framework from Scratch - Models and Integrating Doctrine ORM Developer Drive: Building a PHP Ad Tracker: Creating the Database Tables
2012-01-19 20:40:
Kurt Payne has a new post to his blog showing how you can unit test your process forking in your PHP application (pcntl). At some point, many php developers turn to the pcntl functions in php to write a daemon, or server, or simulate threading. But how do you unit test this with complete code coverage? [...] We need to engage some black arts php extensions to make this happen. An installation guide follows, and the post ends with a complete listing of the unit test. He uses the test_helpers extension (as provided by Sebastian Bergmann) and Runkit to allow the test to define new methods copying the current pcntl methods and mocks up the responses. Tests are included to check the parent of a process, checking the children of a process and testing that a fork could be made. Hes's even included visual proof of this working.
Kurt Payne's Blog: How to Unit Test pcntl_fork()
Kurt Payne has a new post to his blog showing how you can unit test your process forking in your PHP application (pcntl). At some point, many php developers turn to the pcntl functions in php to write a daemon, or server, or simulate threading. But how do you unit test this with complete code coverage? [...] We need to engage some black arts php extensions to make this happen. An installation guide follows, and the post ends with a complete listing of the unit test. He uses the test_helpers extension (as provided by Sebastian Bergmann) and Runkit to allow the test to define new methods copying the current pcntl methods and mocks up the responses. Tests are included to check the parent of a process, checking the children of a process and testing that a fork could be made. Hes's even included visual proof of this working.
2012-01-19 19:03:
In this new post to his blog Wojciech Sznapka compares three different frameworks - Symfony2 (PHP), Django (Python) and Ruby on Rails (Ruby) - in their request handling performance, lines of code and average community on Github. If you ask me, which one is the best - I can't point one, all of them are very good. But let's try to measure frameworks. For purpose of this article, I created three applications in Symfony2, Django and Ruby On Rails. All those apps do the same - show two tables, one shows top USA cities (by population), second shows US states with highest number of big cities (above 100k citizens). I don't want to measure frameworks by echoing "Hello world", because it's pointless. Each of his applications use the same data set and use a default ORM with optimized queries, HTML rendered by an internal template engine and rounded floats. His performance requests (using Apache's ab) for this sample application show Symfony2 being able to handle the most requests/second followed by Ruby then Django. Symfony2 comes in at a larger file size than both the others combined, though. As far as the community is concerned, Ruby on Rails outpaces the others with about three times as many "watchers" on Github. Be sure to read the comments for some opinions, both for and against his results.
Wojciech Sznapka's Blog: Modern frameworks comparison
In this new post to his blog Wojciech Sznapka compares three different frameworks - Symfony2 (PHP), Django (Python) and Ruby on Rails (Ruby) - in their request handling performance, lines of code and average community on Github. If you ask me, which one is the best - I can't point one, all of them are very good. But let's try to measure frameworks. For purpose of this article, I created three applications in Symfony2, Django and Ruby On Rails. All those apps do the same - show two tables, one shows top USA cities (by population), second shows US states with highest number of big cities (above 100k citizens). I don't want to measure frameworks by echoing "Hello world", because it's pointless. Each of his applications use the same data set and use a default ORM with optimized queries, HTML rendered by an internal template engine and rounded floats. His performance requests (using Apache's ab) for this sample application show Symfony2 being able to handle the most requests/second followed by Ruby then Django. Symfony2 comes in at a larger file size than both the others combined, though. As far as the community is concerned, Ruby on Rails outpaces the others with about three times as many "watchers" on Github. Be sure to read the comments for some opinions, both for and against his results.
2012-01-19 18:16:
Chris Hartjes ran into an issue with hit unit tests where PHPUnit was throwing an "aborted" error no matter what tests were run. Thankfully, in this new post, he shares a solution. That was a pretty annoying bug. I never did find out what the problem was as I moved onto other problems and chalked that error up to some undiagnosed weirdness on that particular server. From time to time I would get asked on Twitter if I had ever solved the problem. My answer was always "no, and if you do solve it please let met know how you fixed it." Today, my friends, was the day. Based on a response from Demian Katz, he was able to get around the issue with flag set on the PHPUnit command line - "-dzend.enable_gc=0". Apparently the issue has to do with garbage collection and has been a known issue since the beginning of 2011.
Chris Hartjes' Blog: PHPUnit Aborted Fix
Chris Hartjes ran into an issue with hit unit tests where PHPUnit was throwing an "aborted" error no matter what tests were run. Thankfully, in this new post, he shares a solution. That was a pretty annoying bug. I never did find out what the problem was as I moved onto other problems and chalked that error up to some undiagnosed weirdness on that particular server. From time to time I would get asked on Twitter if I had ever solved the problem. My answer was always "no, and if you do solve it please let met know how you fixed it." Today, my friends, was the day. Based on a response from Demian Katz, he was able to get around the issue with flag set on the PHPUnit command line - "-dzend.enable_gc=0". Apparently the issue has to do with garbage collection and has been a known issue since the beginning of 2011.
2012-01-19 17:02:
In this new post to her blog Lorna Mitchell starts off a new series (based on popular demand) looking at building an RESTful server in PHP. Back to basics - no framework, just PHP. In the first part of this (probably) 3-part series, we'll begin with the basics. It might seem boring, but the most important thing to get right with REST is parsing all the various elements of the HTTP request and responding accordingly. I've put in code samples from from a small-scale toy project I created to make me think about the steps involved. Her "basics" include: the routing to send everything to the main index file (a "front controller" of sorts) with the .htaccess settings included Handling the incoming request with a "Request" class Parsing the incoming parameters from the "php://input" stream
Lorna Mitchell's Blog: Building A RESTful PHP Server: Understanding the Request
In this new post to her blog Lorna Mitchell starts off a new series (based on popular demand) looking at building an RESTful server in PHP. Back to basics - no framework, just PHP. In the first part of this (probably) 3-part series, we'll begin with the basics. It might seem boring, but the most important thing to get right with REST is parsing all the various elements of the HTTP request and responding accordingly. I've put in code samples from from a small-scale toy project I created to make me think about the steps involved. Her "basics" include: the routing to send everything to the main index file (a "front controller" of sorts) with the .htaccess settings included Handling the incoming request with a "Request" class Parsing the incoming parameters from the "php://input" stream
2012-01-19 16:20:
In response to a previous post benchmarking exceptions, Volker Dusch has posted some of his own thoughts and benchmarking results on the same topic. Some days ago there was a blog post regarding php exception performance in 5.4 and the numbers got reported all over the place. The actually numbers are secondary. The main point is: Don't trust "random" stuff on the Internet when thinking about improving your application performance. You always need to measure things for your self and take care doing so! I've initially trusted the benchmark myself and disgraced the whole post saying: "Well yes, exceptions are slower than if statements but nice that they got faster". He includes some results with a bit more standardized testing - one run with both 5.3 and 5.4 using XDebug and another with it turned off for both. His results make sense, if you think about them: So what we learn from that? Running stuff with debugging tools is slower than not doing that. That's why we don't use xDebug in production.
Volker Dusch's Blog: Never trust other peoples benchmarks - A recent example (exceptions)
In response to a previous post benchmarking exceptions, Volker Dusch has posted some of his own thoughts and benchmarking results on the same topic. Some days ago there was a blog post regarding php exception performance in 5.4 and the numbers got reported all over the place. The actually numbers are secondary. The main point is: Don't trust "random" stuff on the Internet when thinking about improving your application performance. You always need to measure things for your self and take care doing so! I've initially trusted the benchmark myself and disgraced the whole post saying: "Well yes, exceptions are slower than if statements but nice that they got faster". He includes some results with a bit more standardized testing - one run with both 5.3 and 5.4 using XDebug and another with it turned off for both. His results make sense, if you think about them: So what we learn from that? Running stuff with debugging tools is slower than not doing that. That's why we don't use xDebug in production.
2012-01-19 15:58:
Fabien Potencier has posted the ninth part of his "build a framework on Symfony2 components series. In this latest tutorial he takes the simple framework he's already created (complete with some unit tests) and makes it easier to extend. Our framework is still missing a major characteristic of any good framework: extensibility. Being extensible means that the developer should be able to easily hook into the framework life cycle to modify the way the request is handled. He chooses the Observer design pattern as a basis for his example, allowing any kind of behavior/actions to be added to the framework's execution. He includes the Symfony2 dispatcher to make this work and includes the code for a "handle" method to fire off events. It executes a "ResponseEvent" every time the framework is executed. An "addListener" method provides the hook to apply a callback to an event - in his case an anonymous function (or closure).
Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 9)
Fabien Potencier has posted the ninth part of his "build a framework on Symfony2 components series. In this latest tutorial he takes the simple framework he's already created (complete with some unit tests) and makes it easier to extend. Our framework is still missing a major characteristic of any good framework: extensibility. Being extensible means that the developer should be able to easily hook into the framework life cycle to modify the way the request is handled. He chooses the Observer design pattern as a basis for his example, allowing any kind of behavior/actions to be added to the framework's execution. He includes the Symfony2 dispatcher to make this work and includes the code for a "handle" method to fire off events. It executes a "ResponseEvent" every time the framework is executed. An "addListener" method provides the hook to apply a callback to an event - in his case an anonymous function (or closure).
2012-01-18 20:11:
In this new post to his blog Ade Slade shows how to integrate the Pimple lightweight dependency injection container with a Zend Framework application. This post will describe a way to integrate Zend Framework 1 and Pimple. A complete working version of the code is available on github. Thankfully, Zend Framework 2 features its own Dependency Injection Container. Happy days. Still, if you're not prepared to wait, you may find this useful. He shows how to add a resource plugin into the Pimple container - an entity manager that's part of Doctrine. He creates his controller, pulling the manager from the Pimple container and includes a unit test for the controller too (using PHPUnit, but he also suggests Mockery).
Ade Slade's Blog: Integrating Zend Framework 1 and Pimple
In this new post to his blog Ade Slade shows how to integrate the Pimple lightweight dependency injection container with a Zend Framework application. This post will describe a way to integrate Zend Framework 1 and Pimple. A complete working version of the code is available on github. Thankfully, Zend Framework 2 features its own Dependency Injection Container. Happy days. Still, if you're not prepared to wait, you may find this useful. He shows how to add a resource plugin into the Pimple container - an entity manager that's part of Doctrine. He creates his controller, pulling the manager from the Pimple container and includes a unit test for the controller too (using PHPUnit, but he also suggests Mockery).
2012-01-18 19:12:
In a new post to his blog Ulf Wendel has pointed out that the mysqlnd query cache plugin quickstart is posted on the docs.php.net site. New in the PHP manual: a quickstart for the mysqlnd query cache plugin. PECL/mysqlnd_qc, the mysqlnd query cache plugin, is transparent and ease to use. But, how? Some pointers have been given in assorted presentations, here on my blog and in some, few examples from the manual. Fixed. You can now browse a quickstart to gain a quick overview. The query cache plugin can replace the query caching MySQL does and can help with things like multiple storage options (memory, APC, Memcache, etc) and almost no changes to your application. There's also a method (mysqlnd_qc_get_query_trace_log) that comes with the plugin that gives you a "stack trace" of every query run through the MySQL interface.
Ulf Wendel's Blog: PHP mysqlnd query cache plugin quickstart is online!
In a new post to his blog Ulf Wendel has pointed out that the mysqlnd query cache plugin quickstart is posted on the docs.php.net site. New in the PHP manual: a quickstart for the mysqlnd query cache plugin. PECL/mysqlnd_qc, the mysqlnd query cache plugin, is transparent and ease to use. But, how? Some pointers have been given in assorted presentations, here on my blog and in some, few examples from the manual. Fixed. You can now browse a quickstart to gain a quick overview. The query cache plugin can replace the query caching MySQL does and can help with things like multiple storage options (memory, APC, Memcache, etc) and almost no changes to your application. There's also a method (mysqlnd_qc_get_query_trace_log) that comes with the plugin that gives you a "stack trace" of every query run through the MySQL interface.
2012-01-18 18:50:
Kevin Schroeder is looking for suggestions. He wants to know what the PHP community wants to hear about in upcoming webinars from Zend. Just wrapped up a call working on our webinar schedule for the year. We've got a bunch of ideas but we'd like to also get your input as well. Yes, I know y'all want ZF2 webinars. We have that down. I would also like to do an HTML5 and mobile webinar but I need an SME (Subject Matter Expert) for that. [...] I would also love to have webinars on how to use various API's, even if there is not native PHP support. So, what kinds of webinars do you want? Leave your suggestions in his comments along with one already suggesting a "Why PHP?" checklist of sorts to help encourage companies/employers to go with the language.
Kevin Schroeder's Blog: Call for webinars (Zend)
Kevin Schroeder is looking for suggestions. He wants to know what the PHP community wants to hear about in upcoming webinars from Zend. Just wrapped up a call working on our webinar schedule for the year. We've got a bunch of ideas but we'd like to also get your input as well. Yes, I know y'all want ZF2 webinars. We have that down. I would also like to do an HTML5 and mobile webinar but I need an SME (Subject Matter Expert) for that. [...] I would also love to have webinars on how to use various API's, even if there is not native PHP support. So, what kinds of webinars do you want? Leave your suggestions in his comments along with one already suggesting a "Why PHP?" checklist of sorts to help encourage companies/employers to go with the language.
2012-01-18 17:04:
On the PHPClasses.org blog there's a new post with a "zeitgeist" they've generated from statistics on the site (such as search queries and overall popularity of packages). For those that are not yet aware of this probably because they only arrived to the PHPClasses site recently, PHP Zeitgeist is an initiative that aims to study what were the last year trends regarding what PHP developers have been searching for. According to their results, some of the trends ramping up (or still going strong) for 2012 include: Social media sites Sites like Groupon, Foursquare and Bitcoin jQuery plugins Doctrine MODX SugarCRM
PHPClasses.org: PHP Zeitgeist 2012
On the PHPClasses.org blog there's a new post with a "zeitgeist" they've generated from statistics on the site (such as search queries and overall popularity of packages). For those that are not yet aware of this probably because they only arrived to the PHPClasses site recently, PHP Zeitgeist is an initiative that aims to study what were the last year trends regarding what PHP developers have been searching for. According to their results, some of the trends ramping up (or still going strong) for 2012 include: Social media sites Sites like Groupon, Foursquare and Bitcoin jQuery plugins Doctrine MODX SugarCRM
2012-01-18 16:49:
On PHPBuilder.com today Jason Gilmore has a new tutorial showing how to create voice recognition applications with PHP and the help of open source voice interpretation tools. Voice recognition or speech recognition technology is not easy to develop. In-house development would be very costly, and buying proprietary libraries that convert voice to text would make the developed application very expensive for end users. On the other hand, when developing in PHP, you have many open-source solutions available. The same dilemma happens with voice recognition in PHP -- there is an open-source class that can be used in voice applications. That way your application would cost less, and you also can offer it for free. His tool of choice is Voice PHP, an open source project that uses four classes with support for SSML, SRGS, CCXML and VoiceXML. In his sample application he shows how to use the libraries to generate an application that can listen to a user's voice and translate that into certain menu options.
PHPBuilder.com: Create PHP Voice Recognition Apps on the Cheap
On PHPBuilder.com today Jason Gilmore has a new tutorial showing how to create voice recognition applications with PHP and the help of open source voice interpretation tools. Voice recognition or speech recognition technology is not easy to develop. In-house development would be very costly, and buying proprietary libraries that convert voice to text would make the developed application very expensive for end users. On the other hand, when developing in PHP, you have many open-source solutions available. The same dilemma happens with voice recognition in PHP -- there is an open-source class that can be used in voice applications. That way your application would cost less, and you also can offer it for free. His tool of choice is Voice PHP, an open source project that uses four classes with support for SSML, SRGS, CCXML and VoiceXML. In his sample application he shows how to use the libraries to generate an application that can listen to a user's voice and translate that into certain menu options.
2012-01-18 15:42:
On the Ibuildings techPortal today they've posted the latest episode in their DPC Radio series as recorded at the last Dutch PHP Conference. In this new episode they share a session from Tobias Schlitt called "Advanced OO Patterns". You already know Singleton, Signal/Observer, Factory and friends. But, which object oriented patterns are en vogue in the PHP world and how can you seize their power? This talk gives you an overview on Dependency Injection, Data Mapper and more OO patterns the PHP world talks about right know, using practical code examples. You can listen to this latest episode either via the in-page player or by downloading the mp3 directly. You can follow along with the talk in his slides over on the qafoo.com site.
Ibuildings techPortal: DPC Radio: Advanced OO Patterns
On the Ibuildings techPortal today they've posted the latest episode in their DPC Radio series as recorded at the last Dutch PHP Conference. In this new episode they share a session from Tobias Schlitt called "Advanced OO Patterns". You already know Singleton, Signal/Observer, Factory and friends. But, which object oriented patterns are en vogue in the PHP world and how can you seize their power? This talk gives you an overview on Dependency Injection, Data Mapper and more OO patterns the PHP world talks about right know, using practical code examples. You can listen to this latest episode either via the in-page player or by downloading the mp3 directly. You can follow along with the talk in his slides over on the qafoo.com site.
2012-01-17 19:44:
In this new post to PHPMaster.com today Ahmed Shreef continues on from his previous introduction to MongoDB and gets into more detail on things like cursors, query operators, queries on embedded documents and the sort/skip methods. In my previous article Introduction to MongoDB I discussed installing Mongo, its PHP extension, and how to perform simple insert and find operations. Of course there are many, many more features than what I mentioned so I wanted to write another article to show you some of them. Other topics mentioned include queries on arrays of data and running queries with indexes to improve their performance. Code is also included for each example.
PHPMaster.com: MongoDB Revisited
In this new post to PHPMaster.com today Ahmed Shreef continues on from his previous introduction to MongoDB and gets into more detail on things like cursors, query operators, queries on embedded documents and the sort/skip methods. In my previous article Introduction to MongoDB I discussed installing Mongo, its PHP extension, and how to perform simple insert and find operations. Of course there are many, many more features than what I mentioned so I wanted to write another article to show you some of them. Other topics mentioned include queries on arrays of data and running queries with indexes to improve their performance. Code is also included for each example.
2012-01-17 18:19:
Brian Moon has a reminder about date handling in PHP - days are not always 86400 seconds long, sometimes there's "leap seconds" included too. Thankfully, there's easy ways around it: The problem with this is that it assume that there are only 86400 seconds in every day. There are in fact not. On days when the clocks change for daylight savings time, there are either 1 hour more than that or 1 hour less than that. In addition, there are also leap seconds put into our time system to keep us in line with the sun. There is one this year, 2012, on June 30th in fact. Since they don't happen with the regularity that daylight savings time does, it may be easy to forget those. Luckily, for this problem, the solution is the same. His first solution involves letting strtotime do the work for him, internally calculating the leap seconds or any other issue that might come up. As an alternate solution, he also mentions "doing your math at noon" - this gives you enough leeway to make the offset leap seconds could cause a much smaller risk.
Brian Moon's Blog: Errors when adding/subtracing dates using seconds
Brian Moon has a reminder about date handling in PHP - days are not always 86400 seconds long, sometimes there's "leap seconds" included too. Thankfully, there's easy ways around it: The problem with this is that it assume that there are only 86400 seconds in every day. There are in fact not. On days when the clocks change for daylight savings time, there are either 1 hour more than that or 1 hour less than that. In addition, there are also leap seconds put into our time system to keep us in line with the sun. There is one this year, 2012, on June 30th in fact. Since they don't happen with the regularity that daylight savings time does, it may be easy to forget those. Luckily, for this problem, the solution is the same. His first solution involves letting strtotime do the work for him, internally calculating the leap seconds or any other issue that might come up. As an alternate solution, he also mentions "doing your math at noon" - this gives you enough leeway to make the offset leap seconds could cause a much smaller risk.
2012-01-17 17:58:
Stuart Herbert has two new posts to his blog showing how to use the ContractLib tool he's created to define programming "contracts". In the first he shows some sample usage of the tool and in the second he compares the functionality of ContractLib's features and PHP's own "assert" method. ContractLib is a simple-to-use PHP component for easily enforcing programming contracts throughout your PHP components. These programming contracts can go a long way to helping you, and the users of your components, develop more robust code. In his example tests he shows how to set a pre-condition on a method's input ensuring that it will always be the correct datatype (array). In his comparison with PHP's "assert", he lists out some of the features that either one has and notes that ContractLib allows you to be much more flexible with your checking than just simple statements.
Stuart Herbert's Blog: ContractLib - An Introduction & Comparing it to PHP's Assert
Stuart Herbert has two new posts to his blog showing how to use the ContractLib tool he's created to define programming "contracts". In the first he shows some sample usage of the tool and in the second he compares the functionality of ContractLib's features and PHP's own "assert" method. ContractLib is a simple-to-use PHP component for easily enforcing programming contracts throughout your PHP components. These programming contracts can go a long way to helping you, and the users of your components, develop more robust code. In his example tests he shows how to set a pre-condition on a method's input ensuring that it will always be the correct datatype (array). In his comparison with PHP's "assert", he lists out some of the features that either one has and notes that ContractLib allows you to be much more flexible with your checking than just simple statements.
2012-01-17 16:39:
Fabien Potencier has posted the eighth part in his "building a framework on Symfony2 components" series. So far he's created a full-featured microframework with routing, controllers, HTTP handling and namespaced code. In this latest part he improves the sample framework by adding some unit tests. Some watchful readers pointed out some subtle but nonetheless important bugs in the framework we have built yesterday. When creating a framework, you must be sure that it behaves as advertised. If not, all the applications based on it will exhibit the same bugs. The good news is that whenever you fix a bug, you are fixing a bunch of applications too. Today's mission is to write unit tests for the framework we have created by using PHPUnit. He includes the XML for a basic phpunit.xml configuration file and uses a UrlMatcher and ControllerResolver in a "Framework" class and makes the test check for "not found" URLs and for checking for a correct Response.
Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 8)
Fabien Potencier has posted the eighth part in his "building a framework on Symfony2 components" series. So far he's created a full-featured microframework with routing, controllers, HTTP handling and namespaced code. In this latest part he improves the sample framework by adding some unit tests. Some watchful readers pointed out some subtle but nonetheless important bugs in the framework we have built yesterday. When creating a framework, you must be sure that it behaves as advertised. If not, all the applications based on it will exhibit the same bugs. The good news is that whenever you fix a bug, you are fixing a bunch of applications too. Today's mission is to write unit tests for the framework we have created by using PHPUnit. He includes the XML for a basic phpunit.xml configuration file and uses a UrlMatcher and ControllerResolver in a "Framework" class and makes the test check for "not found" URLs and for checking for a correct Response.
2012-01-17 15:02:
Gonzalo Ayuso has a new post to his blog today looking at the performance of PHP exceptions and how it could effect your application's overall speed. Sometimes we use exceptions to manage the flow of our scripts. I imagine that the use of exceptions must have a performance lack. Because of that I will perform a small benchmark to test the performance of one simple script throwing exceptions and without them. His (little) benchmarking scripts are included - both looping 100000 times, one throwing an exception and the other not. The results were pretty obvious - the memory usage was about the same but the speed was about ten times faster without the exceptions (in PHP 5.3). In PHP 5.4, however, the numbers were closer as far as time to run. Obviously, unless you make super heavy use of exceptions, you're not even going to come close to something like this (micro-optimization anyone?).
Gonzalo Ayuso's Blog: Checking the performance of PHP exceptions
Gonzalo Ayuso has a new post to his blog today looking at the performance of PHP exceptions and how it could effect your application's overall speed. Sometimes we use exceptions to manage the flow of our scripts. I imagine that the use of exceptions must have a performance lack. Because of that I will perform a small benchmark to test the performance of one simple script throwing exceptions and without them. His (little) benchmarking scripts are included - both looping 100000 times, one throwing an exception and the other not. The results were pretty obvious - the memory usage was about the same but the speed was about ten times faster without the exceptions (in PHP 5.3). In PHP 5.4, however, the numbers were closer as far as time to run. Obviously, unless you make super heavy use of exceptions, you're not even going to come close to something like this (micro-optimization anyone?).
2012-01-17 14:07:
Latest PECL Releases: pecl_http 2.0.0dev3 zookeeper 0.2.0 zookeeper 0.2.1 TextCat 0.2.0 oci8 1.4.7 lua 0.9.3
Community News: Latest PECL Releases for 01.17.2012
Latest PECL Releases: pecl_http 2.0.0dev3 zookeeper 0.2.0 zookeeper 0.2.1 TextCat 0.2.0 oci8 1.4.7 lua 0.9.3
2012-01-16 20:08:
Larry Garfield has posted the results of some of his research into popular PHP frameworks and projects and see how they handle their structure as it relates to the PSR-0 standard. As Drupal is in the process of considering how to restructure code to best leverage the PSR-0 standard, I figured it would be wise to take a quick survey of how some other major projects organize their code bases. This is not a complete rundown of every project, simply roughly comparable notes for those areas Drupal is currently discussing. I am posting it here in the hopes that it will be useful to more than just Drupal. The projects he looked to for his examples were: CakePHP Symfony2 Silex CodeIgniter Zend Framework 2 Composer
Larry Garfield's Blog: PHP project structure survey
Larry Garfield has posted the results of some of his research into popular PHP frameworks and projects and see how they handle their structure as it relates to the PSR-0 standard. As Drupal is in the process of considering how to restructure code to best leverage the PSR-0 standard, I figured it would be wise to take a quick survey of how some other major projects organize their code bases. This is not a complete rundown of every project, simply roughly comparable notes for those areas Drupal is currently discussing. I am posting it here in the hopes that it will be useful to more than just Drupal. The projects he looked to for his examples were: CakePHP Symfony2 Silex CodeIgniter Zend Framework 2 Composer
2012-01-16 19:48:
On Developer Drive today there's a new post (the first in a series) from Gerald Hanks about building an ad tracker in PHP. In this first part he sets up some of the background - the database that will hold the tracker information. Banner ads for services related to the web site owner's industry allow customers to view products that tie into the site owner's core business. In exchange, the web site owner can charge the banner ad owner for every impression (banner ad appearance) or click-through (when a user clicks the banner ad). In order to build a banner ad management system, we must first create the database tables that will hold the ad information, the client data and the activity schedule for each ad. He includes the SQL you'll need to create a few tables - the tracking table for the ads themselves (their metadata), the clients table to handle the groups wanting the ads and the activity table to track views and click-throughs.
Developer Drive: Building a PHP Ad Tracker: Creating the Database Tables
On Developer Drive today there's a new post (the first in a series) from Gerald Hanks about building an ad tracker in PHP. In this first part he sets up some of the background - the database that will hold the tracker information. Banner ads for services related to the web site owner's industry allow customers to view products that tie into the site owner's core business. In exchange, the web site owner can charge the banner ad owner for every impression (banner ad appearance) or click-through (when a user clicks the banner ad). In order to build a banner ad management system, we must first create the database tables that will hold the ad information, the client data and the activity schedule for each ad. He includes the SQL you'll need to create a few tables - the tracking table for the ads themselves (their metadata), the clients table to handle the groups wanting the ads and the activity table to track views and click-throughs.
2012-01-16 18:30:
On 7php.com there's a new interview posted with Enrico Zimual of Zend - "Everything is an Array in PHP". In this edition, I talked with Enrico Zimuel a computer geek since he was 9yrs old. He has written a couple of books namely "Secrets, Spies and Cipher Codes" published by Apogeo in 1999 and the recent "How to use the digital sign" published by Tecniche Nuove in 2010. Enrico has a pretty impressive 'geek' path. He also speaks at many international conferences [...]. You can find his presentations on slideshare. Questions in the interview include: How do you find PHP now as compared to when you first started? Based on your experience, what are the good and bad parts of PHP? To someone who wants to become a better PHP developer, what is your advice? What are some good PHP blog or resources you highly recommend? Read the full interview here.
7php.com: PHP Interview With Enrico Zimuel Senior Software Engineer At Zend Technologies
On 7php.com there's a new interview posted with Enrico Zimual of Zend - "Everything is an Array in PHP". In this edition, I talked with Enrico Zimuel a computer geek since he was 9yrs old. He has written a couple of books namely "Secrets, Spies and Cipher Codes" published by Apogeo in 1999 and the recent "How to use the digital sign" published by Tecniche Nuove in 2010. Enrico has a pretty impressive 'geek' path. He also speaks at many international conferences [...]. You can find his presentations on slideshare. Questions in the interview include: How do you find PHP now as compared to when you first started? Based on your experience, what are the good and bad parts of PHP? To someone who wants to become a better PHP developer, what is your advice? What are some good PHP blog or resources you highly recommend? Read the full interview here.
2012-01-16 17:04:
In a response to a recent post on DZone.com about the "Open/Closed Principle" Josh Adell has posted an example of a " flexible and extendable command invocation solution" implementing this SOLID idea. Let's overcome some of these issues [with only being able to extend the invoker class and that the invoker needs to know how to create commands], and also make the code even more extensible. I'll use a simplified command invoker to demonstrate. His code is included - the creation of a "Command" interface and two comments that implement it: "HelloCommand" and "PwdCommand", each with "register" and "execute" methods. His "Invoker" class then only needs to be told how to map these commands and the "register" is called as they're needed. You can find the full example code for this invocation example in this gist.
Josh Adell's Blog: Command Invoker Pattern with the Open/Closed Principle
In a response to a recent post on DZone.com about the "Open/Closed Principle" Josh Adell has posted an example of a " flexible and extendable command invocation solution" implementing this SOLID idea. Let's overcome some of these issues [with only being able to extend the invoker class and that the invoker needs to know how to create commands], and also make the code even more extensible. I'll use a simplified command invoker to demonstrate. His code is included - the creation of a "Command" interface and two comments that implement it: "HelloCommand" and "PwdCommand", each with "register" and "execute" methods. His "Invoker" class then only needs to be told how to map these commands and the "register" is called as they're needed. You can find the full example code for this invocation example in this gist.
2012-01-16 16:52:
Davey Shafik has posted about an interesting find with closures in PHP revolving around an update to add "$this" access inside the closure. However, it didn't stop there; there was also the addition of Closure::bind() and Closure->bindTo(). These methods are identical except one is a static method into which the closure is passed, the second an instance method on the closure itself. These methods both take two arguments (on top of the closure for the static version): $newthis and $newscope. What this means is that unlike the regular object model the concept of $this and lexical scope (what is in scope for the function with regards to private/protected methods inside objects) are completely separated. He also mentions that you can change the "$this" to a different object (complex) or swapping out the object the closure is bound to while keeping "$this" the same (simpler). He mentions that it could be useful for unit testing but can have its drawbacks. He's included code to illustrate the breakage it can cause in the PHP OOP model (with an explanation).
Davey Shafik's Blog: The Closure Puzzle
Davey Shafik has posted about an interesting find with closures in PHP revolving around an update to add "$this" access inside the closure. However, it didn't stop there; there was also the addition of Closure::bind() and Closure->bindTo(). These methods are identical except one is a static method into which the closure is passed, the second an instance method on the closure itself. These methods both take two arguments (on top of the closure for the static version): $newthis and $newscope. What this means is that unlike the regular object model the concept of $this and lexical scope (what is in scope for the function with regards to private/protected methods inside objects) are completely separated. He also mentions that you can change the "$this" to a different object (complex) or swapping out the object the closure is bound to while keeping "$this" the same (simpler). He mentions that it could be useful for unit testing but can have its drawbacks. He's included code to illustrate the breakage it can cause in the PHP OOP model (with an explanation).
2012-01-16 15:46:
Fabien Potencier has posted the seventh part of his series looking at how to make a custom framework on top of the components from the Symfony2 framework. In this part of the series he improves his basic framework by adding some namespacing to organize the application a bit more. If you have a closer look at the code, front.php has one input, the Request, and one output, the Response. Our framework class will follow this simple principle: the logic is about creating the Response associated with a Request. As the Symfony2 components requires PHP 5.3, let's create our very own namespace for our framework: Simplex. He puts the main front controller in just the "Simplex" namespace but adds in others for the controllers and models. He also updates his Composer configuration to create some PSR-0 autoloading.
Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 7)
Fabien Potencier has posted the seventh part of his series looking at how to make a custom framework on top of the components from the Symfony2 framework. In this part of the series he improves his basic framework by adding some namespacing to organize the application a bit more. If you have a closer look at the code, front.php has one input, the Request, and one output, the Response. Our framework class will follow this simple principle: the logic is about creating the Response associated with a Request. As the Symfony2 components requires PHP 5.3, let's create our very own namespace for our framework: Simplex. He puts the main front controller in just the "Simplex" namespace but adds in others for the controllers and models. He also updates his Composer configuration to create some PSR-0 autoloading.
2012-01-16 14:00:
Latest PEAR Releases: HTTP2 0.1.0
Community News: Latest PEAR Releases for 01.16.2012
Latest PEAR Releases: HTTP2 0.1.0
2012-01-13 21:11:
In this recent post to his blog Stuart Herbert introduces a system he's created to handle "contracts" in PHP development - ContractLib. Programming contracts are tests around functions and methods, and they are normally used: to catch any 'bad' data that has been passed into the function or method from the caller, and to catch any 'bad' data generated by the function or method before it can be returned to the caller. These are pre-condition and post-condition tests, and they are tests that either pass or fail. He points out that by having contracts you not only increase the robustness of your code but you also save time not trying to hunt down data-related issues. Using pre-conditions, you can can check data to ensure things like correct formatting, data that's out of range and data that might be missing. His ContractLib comes with a set of tests that provide good examples of how to use the functionality. Installation instructions are included.
Stuart Herbert's Blog: Introducing ContractLib (Programming Contracts)
In this recent post to his blog Stuart Herbert introduces a system he's created to handle "contracts" in PHP development - ContractLib. Programming contracts are tests around functions and methods, and they are normally used: to catch any 'bad' data that has been passed into the function or method from the caller, and to catch any 'bad' data generated by the function or method before it can be returned to the caller. These are pre-condition and post-condition tests, and they are tests that either pass or fail. He points out that by having contracts you not only increase the robustness of your code but you also save time not trying to hunt down data-related issues. Using pre-conditions, you can can check data to ensure things like correct formatting, data that's out of range and data that might be missing. His ContractLib comes with a set of tests that provide good examples of how to use the functionality. Installation instructions are included.
2012-01-13 20:13:
Dave Marshall has a new post to his blog showing one method for defending against cache stampedes from assaulting your caching servers and (possibly) bringing them down. I've recently had a problem with a rather large operation (that could probably be optimised considerably, but nevermind), where by if the cached result of the operation expired, several web server threads would attempt the operation, causing some major headaches for our database and web servers. This is something I've come across before, and is commonly(?) known as a Cache Stampede. This is bad, this post describes the basics of what I've done to deal with it. His example uses a Zend_Cache interface to Memecache, but it could be applied in other places too. His method uses a binary semaphore to check and see if there's a "lock" and sleep for a bit before checking again. Sample code is included showing how to create this system and how to refresh the data with a new expiration on a cache miss.
Dave Marshall's Blog: Defending against Cache Stampedes
Dave Marshall has a new post to his blog showing one method for defending against cache stampedes from assaulting your caching servers and (possibly) bringing them down. I've recently had a problem with a rather large operation (that could probably be optimised considerably, but nevermind), where by if the cached result of the operation expired, several web server threads would attempt the operation, causing some major headaches for our database and web servers. This is something I've come across before, and is commonly(?) known as a Cache Stampede. This is bad, this post describes the basics of what I've done to deal with it. His example uses a Zend_Cache interface to Memecache, but it could be applied in other places too. His method uses a binary semaphore to check and see if there's a "lock" and sleep for a bit before checking again. Sample code is included showing how to create this system and how to refresh the data with a new expiration on a cache miss.
2012-01-13 19:13:
Ulf Wendel has a new post to his blog pointing out the new mysqli quickstart that's been added to the PHP manual. New in the PHP manual: a mysqli quickstart. You are new to PHP but you know how to code, you know SQL, you know relational databases and MySQL? Then, I hope, this is for you. All you need is a quick overview on the concepts? The rest is in the reference section! Here you go. It includes sections on: making connections executing statements stored procedures multiple statements
Ulf Wendel's Blog: PHP mysqli quickstart is online!
Ulf Wendel has a new post to his blog pointing out the new mysqli quickstart that's been added to the PHP manual. New in the PHP manual: a mysqli quickstart. You are new to PHP but you know how to code, you know SQL, you know relational databases and MySQL? Then, I hope, this is for you. All you need is a quick overview on the concepts? The rest is in the reference section! Here you go. It includes sections on: making connections executing statements stored procedures multiple statements
2012-01-13 18:08:
In the sixth part of his series on creating a custom framework on top of the Symfony2 components, Fabien Potencier looks at how to improve the previous examples by swapping out the more procedural controllers with actual classes. The move is pretty straightforward and makes a lot of sense as soon as you create more pages but you might have noticed a non-desirable side-effect... The LeapYearController class is always instantiated, even if the requested URL does not match the leap_year route. This is bad for one main reason: performance wise, all controllers for all routes must now be instantiated for every request. It would be better if controllers were lazy-loaded so that only the controller associated with the matched route is instantiated. To help solve the issue, he uses the HttpKernel component and its "controller resolver" to figure out how to call the controller and pass it the correct parameters, but only when needed. A resolver object is created and that is used to instantiate the controller object. Sample "action" calls are included to fill out the basic controller (his "leap year" example) and the full resulting code is included both for the framework and the new object oriented controller.
Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 6)
In the sixth part of his series on creating a custom framework on top of the Symfony2 components, Fabien Potencier looks at how to improve the previous examples by swapping out the more procedural controllers with actual classes. The move is pretty straightforward and makes a lot of sense as soon as you create more pages but you might have noticed a non-desirable side-effect... The LeapYearController class is always instantiated, even if the requested URL does not match the leap_year route. This is bad for one main reason: performance wise, all controllers for all routes must now be instantiated for every request. It would be better if controllers were lazy-loaded so that only the controller associated with the matched route is instantiated. To help solve the issue, he uses the HttpKernel component and its "controller resolver" to figure out how to call the controller and pass it the correct parameters, but only when needed. A resolver object is created and that is used to instantiate the controller object. Sample "action" calls are included to fill out the basic controller (his "leap year" example) and the full resulting code is included both for the framework and the new object oriented controller.
2012-01-13 17:58:
NetTuts.com has posted a second tutorial in their series focusing on the Zend Framework today. In this latest article they focus on integrating the powerful Doctrine ORM with a Zend Framework application. Ready to take your PHP skills to the next level? In this new "From Scratch" series, we'll focus exclusively on Zend Framework, a full-stack PHP framework created by Zend Technologies. This second tutorial on our series is entitled "Models and Integrating Doctrine ORM". They continue on from their previous tutorial to talk about what models are (with an example involving "bankers"). They also show how to use the Zend Framework "zf" command line tool to configure your database settings, set up the tables and download/bootstrap the Doctrine code. The include the code to create some simple models and how to use them to create and update records in your database. You can grab all of the sample code for their examples from The Next Social's github repository.
NetTuts.com: Zend Framework from Scratch - Models and Integrating Doctrine ORM
NetTuts.com has posted a second tutorial in their series focusing on the Zend Framework today. In this latest article they focus on integrating the powerful Doctrine ORM with a Zend Framework application. Ready to take your PHP skills to the next level? In this new "From Scratch" series, we'll focus exclusively on Zend Framework, a full-stack PHP framework created by Zend Technologies. This second tutorial on our series is entitled "Models and Integrating Doctrine ORM". They continue on from their previous tutorial to talk about what models are (with an example involving "bankers"). They also show how to use the Zend Framework "zf" command line tool to configure your database settings, set up the tables and download/bootstrap the Doctrine code. The include the code to create some simple models and how to use them to create and update records in your database. You can grab all of the sample code for their examples from The Next Social's github repository.
2012-01-13 16:05:
In a new post to DZone.com Giorgio Sironi talks about the "open/closed principle" in software development and shows an example based on the design of the PHPUnit_Selenium project. This article shows an example of how the application of the Open/Closed Principle improved the design of a real project, the open source library PHPUnit_Selenium. These design concepts apply to every object-oriented language, including Java, Ruby or even C++. The Open Closed Principle, part of SOLID set, states that software should be open for extension and at the same time closed for modification. He starts with a little background on the project, pointing out that there's a Session object it uses for all of its testing with a magic "__call" method that handles any kind of method call to the object. This method has issues (dependencies, strict requirements for use) but can be refactored according to the Open/Closed idea to set up an array of anonymous functions that can be called as a "command". Examples of these types of classes are also included (one for the "click" action on a button and another for getting the current location).
DZone.com: Open/Closed Principle on real world code
In a new post to DZone.com Giorgio Sironi talks about the "open/closed principle" in software development and shows an example based on the design of the PHPUnit_Selenium project. This article shows an example of how the application of the Open/Closed Principle improved the design of a real project, the open source library PHPUnit_Selenium. These design concepts apply to every object-oriented language, including Java, Ruby or even C++. The Open Closed Principle, part of SOLID set, states that software should be open for extension and at the same time closed for modification. He starts with a little background on the project, pointing out that there's a Session object it uses for all of its testing with a magic "__call" method that handles any kind of method call to the object. This method has issues (dependencies, strict requirements for use) but can be refactored according to the Open/Closed idea to set up an array of anonymous functions that can be called as a "command". Examples of these types of classes are also included (one for the "click" action on a button and another for getting the current location).
2012-01-13 14:02:
Popular posts from PHPDeveloper.org for the past week:Udemy Blog: Code Wars: PHP vs Ruby vs Python - Who Reigns Supreme [Infographic] Sankuru Blog: A pluggable compiler and virtual machine in PHP Chris Hartjes' Blog: Better Remote Code Development Stoimen Popov's Blog: PHP Performance: Bitwise Division Paul Jones' Blog: The Aura Project: Now For PHP 5.4, With Beta Releases 7php.com: Building Your PHP Geek Cred To Publicly Be An Awesome PHP Developer Robert Basic's Blog: Creating a chat bot with PHP and Dbus PHPMaster.com: ClamAV as a Validation Filter in Zend Framework PHP.net: PHP 5.4.0 RC5 released PHPMaster.com: Introduction to PhpDoc
Site News: Popular Posts for the Week of 01.13.2012
Popular posts from PHPDeveloper.org for the past week:Udemy Blog: Code Wars: PHP vs Ruby vs Python - Who Reigns Supreme [Infographic] Sankuru Blog: A pluggable compiler and virtual machine in PHP Chris Hartjes' Blog: Better Remote Code Development Stoimen Popov's Blog: PHP Performance: Bitwise Division Paul Jones' Blog: The Aura Project: Now For PHP 5.4, With Beta Releases 7php.com: Building Your PHP Geek Cred To Publicly Be An Awesome PHP Developer Robert Basic's Blog: Creating a chat bot with PHP and Dbus PHPMaster.com: ClamAV as a Validation Filter in Zend Framework PHP.net: PHP 5.4.0 RC5 released PHPMaster.com: Introduction to PhpDoc
2012-01-12 19:56:
In this new press release Zend has announced the posting of the results from their "Zend Developer Pluse" survey - a survey taken of developers world-wide about their habits, preferences and desires. Zend Technologies addresses [the question of how a new demand for a new generation of apps] in Zend Developer Pulse, a new survey series that takes the pulse of a vibrant community of developers from around the world. The company's first developer survey conducted in late November 2011 offers insights on emerging technology and career trends captured from 3,335 respondents. The findings are summarized in a report now available at [http://www.zend.com/topics/zend-developer-pulse-survey-report-0112-EN.pdf]. The press release mentions some of the details from the survey including that 66% of developers will be working with mobile app development projcts, that next-generation UI deveopment scored high in skillsets, there was a strong interest in cloud development and that there's been a strong rise in the need for PHP development skills in the last year. You can read the entire report here.
Zend: Zend Takes The Pulse Of Developers In The APP Economy
In this new press release Zend has announced the posting of the results from their "Zend Developer Pluse" survey - a survey taken of developers world-wide about their habits, preferences and desires. Zend Technologies addresses [the question of how a new demand for a new generation of apps] in Zend Developer Pulse, a new survey series that takes the pulse of a vibrant community of developers from around the world. The company's first developer survey conducted in late November 2011 offers insights on emerging technology and career trends captured from 3,335 respondents. The findings are summarized in a report now available at [http://www.zend.com/topics/zend-developer-pulse-survey-report-0112-EN.pdf]. The press release mentions some of the details from the survey including that 66% of developers will be working with mobile app development projcts, that next-generation UI deveopment scored high in skillsets, there was a strong interest in cloud development and that there's been a strong rise in the need for PHP development skills in the last year. You can read the entire report here.
2012-01-12 18:09:
In this recent post to his blog Stefan Koopmanschap shares some of the troubles (and a solution) when he was dealing with getting the Geoip PECL extension installed on his Zend Server setup in OSX. Today I needed to get a client application up and running on my local system. This application uses the Geoip PECL package, so I needed to get this up and running. This turned out to be slightly more difficult than just a PECL install, as you're missing some libraries by default, so here is my log of things to do to get it up and running. He gives the complete list of steps his followed including downloading the source and his way around this "System could not load this extension" issue. The trick was to recompile the source with the correct architecture. By default his extension was built with i386 instead of 64-bit but updating some of the CFLAGS settings (and a few other environment variables) got things compiling correctly.
Stefan Koopmanshcap's Blog: Installing the Geoip PECL package for Zend Server on OSX
In this recent post to his blog Stefan Koopmanschap shares some of the troubles (and a solution) when he was dealing with getting the Geoip PECL extension installed on his Zend Server setup in OSX. Today I needed to get a client application up and running on my local system. This application uses the Geoip PECL package, so I needed to get this up and running. This turned out to be slightly more difficult than just a PECL install, as you're missing some libraries by default, so here is my log of things to do to get it up and running. He gives the complete list of steps his followed including downloading the source and his way around this "System could not load this extension" issue. The trick was to recompile the source with the correct architecture. By default his extension was built with i386 instead of 64-bit but updating some of the CFLAGS settings (and a few other environment variables) got things compiling correctly.
2012-01-12 17:48:
Fabien Potencier has posted the fifth part of his series looking at building a custom framework on top of the Symfony2 components. In this new tutorial he adds in one of the major features of any framework - the controller level. For simple pages like the ones we have created so far, that's not a problem, but if you want to add more logic, you would be forced to put the logic into the template itself, which is probably not a good idea, especially if you still have the separation of concerns principle in mind. Let's separate the template code from the logic by adding a new layer: the controller: The controller mission is to generate a Response based on the information conveyed by the client Request. He updates the template rendering to use an external method instead of doing it itself and updates the routing to include a "_controller" attribute pointing to the method. The full code for the updated version of the framework is included - a simple request/response with handling for a "leap_year" route.
Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 5)
Fabien Potencier has posted the fifth part of his series looking at building a custom framework on top of the Symfony2 components. In this new tutorial he adds in one of the major features of any framework - the controller level. For simple pages like the ones we have created so far, that's not a problem, but if you want to add more logic, you would be forced to put the logic into the template itself, which is probably not a good idea, especially if you still have the separation of concerns principle in mind. Let's separate the template code from the logic by adding a new layer: the controller: The controller mission is to generate a Response based on the information conveyed by the client Request. He updates the template rendering to use an external method instead of doing it itself and updates the routing to include a "_controller" attribute pointing to the method. The full code for the updated version of the framework is included - a simple request/response with handling for a "leap_year" route.
2012-01-12 16:12:
Paul Reinheimer has a recent post to his blog talking about the danger of "hooks" in your development - the functionality several frameworks and other tools come with to allow you to add functionality to the core without having to change the main source. I ran into hooks rather simultaneously with two very different frameworks: Code Igniter and Lithium. In both cases I was using a rather nifty hook to handle ensuring that users were properly authenticated and authorized before accessing a page. [...] One day, while messing around, I accidentally turned off the hook configuration within Code Igniter (actually I clobbered a file, and restored the wrong one). Then, things came crashing down in a horrible cacophony of... actually they didn't. Everything kept working: that was the problem. He shows two solutions he came up with to be sure that his hooks were executed - one for Lithium and the other for CodeIgniter. The Lithium one uses a "_remap" method and the CodeIgniter example uses the magic "__invoke" method to check for an "AUTH_CHECKED" constant that's only defined as a part of his hooks. I'm no longer entirely dependent on one configuration option or file for my security to function. Should it fail, I've got a secondary check in place; this example of defence in depth allows me to be comfortable with the hooks security system once more.
Paul Reinheimer's Blog: The Danger of Hooks
Paul Reinheimer has a recent post to his blog talking about the danger of "hooks" in your development - the functionality several frameworks and other tools come with to allow you to add functionality to the core without having to change the main source. I ran into hooks rather simultaneously with two very different frameworks: Code Igniter and Lithium. In both cases I was using a rather nifty hook to handle ensuring that users were properly authenticated and authorized before accessing a page. [...] One day, while messing around, I accidentally turned off the hook configuration within Code Igniter (actually I clobbered a file, and restored the wrong one). Then, things came crashing down in a horrible cacophony of... actually they didn't. Everything kept working: that was the problem. He shows two solutions he came up with to be sure that his hooks were executed - one for Lithium and the other for CodeIgniter. The Lithium one uses a "_remap" method and the CodeIgniter example uses the magic "__invoke" method to check for an "AUTH_CHECKED" constant that's only defined as a part of his hooks. I'm no longer entirely dependent on one configuration option or file for my security to function. Should it fail, I've got a secondary check in place; this example of defence in depth allows me to be comfortable with the hooks security system once more.
2012-01-12 15:21:
On the PHPClasses.org blog today there's a new post looking at the security vulnerability that effected not only PHP but lots of other languages making them susceptible to attack from the outside. In PHP and several other languages used to implement Web applications, arrays are used to store the values of request variables such as $_GET, $_POST, $COOKIE, etc.. IF you receive a request with a large number of request values, until recent versions PHP may run into trouble. He goes on to explain why there's an issue with the array overloading and what PHP has done in recent releases to help correct the issue - the max_input_vars setting in the php.ini. He also points out that this is not a new issue - it was originally identified back in 2003 (with a video of the original presentation). He points out that the most recent releases of the PHP language have this fix in them and, if at all possible, you should upgrade to protect your applications.
PHPClasses.org: PHP Vulnerability May Halt Millions of Servers
On the PHPClasses.org blog today there's a new post looking at the security vulnerability that effected not only PHP but lots of other languages making them susceptible to attack from the outside. In PHP and several other languages used to implement Web applications, arrays are used to store the values of request variables such as $_GET, $_POST, $COOKIE, etc.. IF you receive a request with a large number of request values, until recent versions PHP may run into trouble. He goes on to explain why there's an issue with the array overloading and what PHP has done in recent releases to help correct the issue - the max_input_vars setting in the php.ini. He also points out that this is not a new issue - it was originally identified back in 2003 (with a video of the original presentation). He points out that the most recent releases of the PHP language have this fix in them and, if at all possible, you should upgrade to protect your applications.
2012-01-11 20:13:
On the Udemy blog there's a new post with a large infographic showing "who reigns supreme" comparing Ruby, Python and PHP (don't worry, this isn't flamebait...it's actual good stats comparing the state of these three languages). Just as the Japanese, Spanish and French languages are uniquely different, programming languages also have their variations, some more popular and easier to use than others. With the recent introduction of some new ones, there is a 'war' of modern day languages. What's easier and faster to use is not always the best option. The graphic includes stats like: Usability ratings Popularity in the TIOBE index How much it's discussed (from the IEEE Spectrum, IRC) The number of open job postings Average run time/lines of code Check out the full post for more interesting data.
Udemy Blog: Code Wars: PHP vs Ruby vs Python - Who Reigns Supreme [Infographic]
On the Udemy blog there's a new post with a large infographic showing "who reigns supreme" comparing Ruby, Python and PHP (don't worry, this isn't flamebait...it's actual good stats comparing the state of these three languages). Just as the Japanese, Spanish and French languages are uniquely different, programming languages also have their variations, some more popular and easier to use than others. With the recent introduction of some new ones, there is a 'war' of modern day languages. What's easier and faster to use is not always the best option. The graphic includes stats like: Usability ratings Popularity in the TIOBE index How much it's discussed (from the IEEE Spectrum, IRC) The number of open job postings Average run time/lines of code Check out the full post for more interesting data.
2012-01-11 19:09:
On the ServerGrove blog today there's a new post about using their TranslationEditorBundle (Symfony2) to handle multilingual support for your site. We have been working a lot with Symfony2 translations lately (we translated our website to Spanish and we are in the process of translating our control panel too). Dealing with multiple translation files is not difficult, but it takes time, lots of copy & paste. We have found that is quite easy to make mistakes, create duplicate lines, etc... in short, it's messy. To tame the translation chaos we decided to create a simple web based editor to deal with Symfony2 translations. The result is the TranslationEditorBundle and it's publicly available for anyone to use and contribute to. The bundle gives you a simple web frontend to the translation process, making it a lot simpler to input the different versions of the text as well as determine where any duplication might be happening. It also gives you things like the total number of entries and the number of them missing their translations.
ServerGrove Blog: Easily manage multilingual sites with the new TranslationEditorBundle for Symfony2
On the ServerGrove blog today there's a new post about using their TranslationEditorBundle (Symfony2) to handle multilingual support for your site. We have been working a lot with Symfony2 translations lately (we translated our website to Spanish and we are in the process of translating our control panel too). Dealing with multiple translation files is not difficult, but it takes time, lots of copy & paste. We have found that is quite easy to make mistakes, create duplicate lines, etc... in short, it's messy. To tame the translation chaos we decided to create a simple web based editor to deal with Symfony2 translations. The result is the TranslationEditorBundle and it's publicly available for anyone to use and contribute to. The bundle gives you a simple web frontend to the translation process, making it a lot simpler to input the different versions of the text as well as determine where any duplication might be happening. It also gives you things like the total number of entries and the number of them missing their translations.
2012-01-11 18:50:
In this latest post to his blog Justin Carmony shares some of his experience using Redis and Solo to asynchronously run queries and return data without the user having to wait. Sometimes there are situations when you want to parallel process things. Other times you might have a list of tasks to accomplish, and you don't want to make the user wait after pressing a button. This is where "Workers" can come in. They are independent scripts that run along side of your application, performing tasks, or "jobs." Solo is a very basic Perl script that ensures only one process of a type is running at once. Using this and a PHP library called predis, he shows how to set up workers and add items to your processing queue. The workers themselves run on a cron job and connect to the queue server to see what they need to do. He also throws in some "bells and whistles" - extras that can enhance your worker system: queue monitoring, version numbering and killing workers based on a hash value. His code examples are posted on his github account and a screencast is included in the post to show the system in action.
Justin Carmony's Blog: PHP Workers with Redis & Solo
In this latest post to his blog Justin Carmony shares some of his experience using Redis and Solo to asynchronously run queries and return data without the user having to wait. Sometimes there are situations when you want to parallel process things. Other times you might have a list of tasks to accomplish, and you don't want to make the user wait after pressing a button. This is where "Workers" can come in. They are independent scripts that run along side of your application, performing tasks, or "jobs." Solo is a very basic Perl script that ensures only one process of a type is running at once. Using this and a PHP library called predis, he shows how to set up workers and add items to your processing queue. The workers themselves run on a cron job and connect to the queue server to see what they need to do. He also throws in some "bells and whistles" - extras that can enhance your worker system: queue monitoring, version numbering and killing workers based on a hash value. His code examples are posted on his github account and a screencast is included in the post to show the system in action.
2012-01-11 17:25:
Brian Swan has posted another in his "unit testing on Azure" posts to his blog today. This time he shows how to get VisualPHPUnit running on your Windows Azure installed code. Last month, I wrote a post that outlined 3 ways to test PHP applications in Windows Azure, and since then I've covered two of those approaches: Running PHPUnit in Windows Azure (uses RDP) and Automating PHPUnit Tests in Windows Azure. In this post I'll cover how to use a web-front end (VisualPHPUnit specifically) to run tests in Azure. The process is really simple - it's basically three steps (after the VisualPHPUnit install): Edit the configuration file to point to the right tests directory Password protect the VisualPHPUnit directory Deploy your application by following the instructions here
Brian Swan's Blog: Running VisualPHPUnit in Windows Azure
Brian Swan has posted another in his "unit testing on Azure" posts to his blog today. This time he shows how to get VisualPHPUnit running on your Windows Azure installed code. Last month, I wrote a post that outlined 3 ways to test PHP applications in Windows Azure, and since then I've covered two of those approaches: Running PHPUnit in Windows Azure (uses RDP) and Automating PHPUnit Tests in Windows Azure. In this post I'll cover how to use a web-front end (VisualPHPUnit specifically) to run tests in Azure. The process is really simple - it's basically three steps (after the VisualPHPUnit install): Edit the configuration file to point to the right tests directory Password protect the VisualPHPUnit directory Deploy your application by following the instructions here
2012-01-11 16:49:
Lukas Smith has a new post to his blog today with his own take on the MicroPHP manifesto that was posted by Ed Finkler recently. Lukas shares his thoughts on when he sees each type of framework (micro/full stack) has its place and how the project or development team can influence this choice. Ed's recent blog post labeled the The MicroPHP Manifesto got a lot of attention. [...] In general I totally agree with Ed on the point that we need more decoupled components in the PHP world. The timing seems a bit odd since exactly that seems to be an emerging trend with all the various libraries cropping up since PHP 5.3. He gets into more of his thoughts comparing the recently popular microframeworks to the full stack, broad use case frameworks that try to provide everything you might need. He talks about the difference between them related to configuration over code and when he sees is a good shifting point to move from the simpler micro world to the full stack (hint: business logic). So the key take a way point is that when choosing to go micro or full stack its very important to consider in what kind of company on what kind of products you are working on.
Lukas Smith's Blog: My take on the MicroPHP manifesto buzz
Lukas Smith has a new post to his blog today with his own take on the MicroPHP manifesto that was posted by Ed Finkler recently. Lukas shares his thoughts on when he sees each type of framework (micro/full stack) has its place and how the project or development team can influence this choice. Ed's recent blog post labeled the The MicroPHP Manifesto got a lot of attention. [...] In general I totally agree with Ed on the point that we need more decoupled components in the PHP world. The timing seems a bit odd since exactly that seems to be an emerging trend with all the various libraries cropping up since PHP 5.3. He gets into more of his thoughts comparing the recently popular microframeworks to the full stack, broad use case frameworks that try to provide everything you might need. He talks about the difference between them related to configuration over code and when he sees is a good shifting point to move from the simpler micro world to the full stack (hint: business logic). So the key take a way point is that when choosing to go micro or full stack its very important to consider in what kind of company on what kind of products you are working on.
2012-01-11 15:10:
The PHP development group has officially announced the release of PHP 5.3.9, the latest in the 5.3.x series. The PHP development team would like to announce the immediate availability of PHP 5.3.9. This release focuses on improving the stability of the PHP 5.3.x branch with over 90 bug fixes, some of which are security related. Bugfixes and updates in this release include the max_input_vars directive, an autoloading issue with is_a and changes to the FPM SAPI module. You can see the full list of changes here or just go over and download this latest release and get to installing - source, Windows binaries.
PHP.net: PHP 5.3.9 Released!
The PHP development group has officially announced the release of PHP 5.3.9, the latest in the 5.3.x series. The PHP development team would like to announce the immediate availability of PHP 5.3.9. This release focuses on improving the stability of the PHP 5.3.x branch with over 90 bug fixes, some of which are security related. Bugfixes and updates in this release include the max_input_vars directive, an autoloading issue with is_a and changes to the FPM SAPI module. You can see the full list of changes here or just go over and download this latest release and get to installing - source, Windows binaries.
2012-01-10 20:58:
The latest episode of the DevHell podcast has been posted - Episode 3, "Beatings Will Continue Until Test Coverage Improves". Fresh off our holiday break, we're back with our longest show yet. We talk about Chris' new book The Grumpy Programmer's Guide To Building Testable PHP Applications, including his experiences self-publishing with Leanpub. Chris also explains how he fears no precipitation on his excursions to the Codemash conference in Ohio. Then Ed talks about the thought process that lead to his latest shit-stirring blog post "The MicroPHP Manifesto." Ed may or may not begin crying openly. Finally, we discuss when it might be necessary to trash your existing application and rewrite it. You can listen to this latest episode either via the in-page player or by downloading the mp3 directly.
DevHell Podcast: Episode 3: Beatings Will Continue Until Test Coverage Improves
The latest episode of the DevHell podcast has been posted - Episode 3, "Beatings Will Continue Until Test Coverage Improves". Fresh off our holiday break, we're back with our longest show yet. We talk about Chris' new book The Grumpy Programmer's Guide To Building Testable PHP Applications, including his experiences self-publishing with Leanpub. Chris also explains how he fears no precipitation on his excursions to the Codemash conference in Ohio. Then Ed talks about the thought process that lead to his latest shit-stirring blog post "The MicroPHP Manifesto." Ed may or may not begin crying openly. Finally, we discuss when it might be necessary to trash your existing application and rewrite it. You can listen to this latest episode either via the in-page player or by downloading the mp3 directly.
2012-01-10 19:34:
Ariz Jacinto has written up a new post with the commands you'll need to get PHP up and runnign with MSSQL Server's native ODBC driver working on linux (accessible through PDO). Last month, MS announced the preview release of SQL Server ODBC Driver for Linux, a 64-bit binary driver for Red Hat Enterprise Linux 5. This is good news for companies using heterogenous platforms e.g. LAMP stack running a PHP application that connects to both MySQL and MSSQL Server. Meaning, these companies no longer have to use third-party drivers such as FreeTDS that MS doesn't support. Then a few days ago, MS released version 1 of the driver. I immediately downloaded the driver and recompiled PHP with it as a PDO (PHP Data Object) ODBC driver. His process has five steps to it, including one for making a test script (code included) and another with a few gotchas/performance considerations to keep an eye out for when using the driver.
Ariz Jacinto's Blog: Compiling PHP with MSSQL Server's Native ODBC Driver for Linux as a PDO Driver
Ariz Jacinto has written up a new post with the commands you'll need to get PHP up and runnign with MSSQL Server's native ODBC driver working on linux (accessible through PDO). Last month, MS announced the preview release of SQL Server ODBC Driver for Linux, a 64-bit binary driver for Red Hat Enterprise Linux 5. This is good news for companies using heterogenous platforms e.g. LAMP stack running a PHP application that connects to both MySQL and MSSQL Server. Meaning, these companies no longer have to use third-party drivers such as FreeTDS that MS doesn't support. Then a few days ago, MS released version 1 of the driver. I immediately downloaded the driver and recompiled PHP with it as a PDO (PHP Data Object) ODBC driver. His process has five steps to it, including one for making a test script (code included) and another with a few gotchas/performance considerations to keep an eye out for when using the driver.
2012-01-10 18:53:
On the Sankuru blog today the next post in the series about creating a compiler in PHP has been posted. In this latest tutorial he shows how to set up a plugin architecture for the compiler that allows you to quickly and easily extend it beyond its base functionality. A plugin architecture allows multiple developers to work on the same application and let yet another person assemble their work later on. It allows the plugin developer to understand just his plugin API without having to understand all the details of the entire application. He describes a few platforms that already have the concept of plugins including Joomla, Mediawiki and SugarCRM. He explains what a plugin architecture should be and what it shouldn't be. All of this is his first steps towards building a plugin-enabled compiler and virtual machine in PHP.
SaniSoft Blog: A pluggable compiler and virtual machine in PHP
On the Sankuru blog today the next post in the series about creating a compiler in PHP has been posted. In this latest tutorial he shows how to set up a plugin architecture for the compiler that allows you to quickly and easily extend it beyond its base functionality. A plugin architecture allows multiple developers to work on the same application and let yet another person assemble their work later on. It allows the plugin developer to understand just his plugin API without having to understand all the details of the entire application. He describes a few platforms that already have the concept of plugins including Joomla, Mediawiki and SugarCRM. He explains what a plugin architecture should be and what it shouldn't be. All of this is his first steps towards building a plugin-enabled compiler and virtual machine in PHP.
2012-01-10 18:53:
On the Sankuru blog today the next post in the series about creating a compiler in PHP has been posted. In this latest tutorial he shows how to set up a plugin architecture for the compiler that allows you to quickly and easily extend it beyond its base functionality. A plugin architecture allows multiple developers to work on the same application and let yet another person assemble their work later on. It allows the plugin developer to understand just his plugin API without having to understand all the details of the entire application. He describes a few platforms that already have the concept of plugins including Joomla, Mediawiki and SugarCRM. He explains what a plugin architecture should be and what it shouldn't be. All of this is his first steps towards building a plugin-enabled compiler and virtual machine in PHP.
Sankuru Blog: A pluggable compiler and virtual machine in PHP
On the Sankuru blog today the next post in the series about creating a compiler in PHP has been posted. In this latest tutorial he shows how to set up a plugin architecture for the compiler that allows you to quickly and easily extend it beyond its base functionality. A plugin architecture allows multiple developers to work on the same application and let yet another person assemble their work later on. It allows the plugin developer to understand just his plugin API without having to understand all the details of the entire application. He describes a few platforms that already have the concept of plugins including Joomla, Mediawiki and SugarCRM. He explains what a plugin architecture should be and what it shouldn't be. All of this is his first steps towards building a plugin-enabled compiler and virtual machine in PHP.
2012-01-10 17:07:
On PHPMaster.com today there's a new post from Moshe Teutsch about working with docblock comments in PHP scripts and how to use the phpDocumentor tool to generate the documentation from them. If you've ever tried to read code written by someone other than yourself (who hasn't?), you know it can be a daunting task. [...] PhpDoc, short for PhpDocumentor, is a powerful tool that allows you to easily document your code via specially formatted comments. [...] By using PhpDoc, you can make it easy for others (and yourself) to understand your code - weeks, months, and even years after you've written it. He introduces the concept of "docblocks" and includes several examples of how to comment things like packages, files, classes and functions/methods. Finally, he wraps up the post with an example of using the "phpdoc" command to run phpDocumentor and build the docs. In the comments, another tool is also suggested - DocBlox, a project that still parses the same docbloc syntax but does it in a much more memory efficient way (and is an actively maintained project).
PHPMaster.com: Introduction to PhpDoc
On PHPMaster.com today there's a new post from Moshe Teutsch about working with docblock comments in PHP scripts and how to use the phpDocumentor tool to generate the documentation from them. If you've ever tried to read code written by someone other than yourself (who hasn't?), you know it can be a daunting task. [...] PhpDoc, short for PhpDocumentor, is a powerful tool that allows you to easily document your code via specially formatted comments. [...] By using PhpDoc, you can make it easy for others (and yourself) to understand your code - weeks, months, and even years after you've written it. He introduces the concept of "docblocks" and includes several examples of how to comment things like packages, files, classes and functions/methods. Finally, he wraps up the post with an example of using the "phpdoc" command to run phpDocumentor and build the docs. In the comments, another tool is also suggested - DocBlox, a project that still parses the same docbloc syntax but does it in a much more memory efficient way (and is an actively maintained project).
2012-01-10 16:47:
In this new post to his blog Nikita Popov aims to dispel the popular micro-optimization myth of using single quotes over double quotes for a performance boost. If there is one PHP related thing that I really hate, then it is definitely the Single Quotes Performance Myth. [...] Let's do a random Google search for "PHP single quotes performance": You will get many results telling you that single quotes are faster than double quotes and that string interpolation is much slower than string concatenation. Most of them advise to use single quotes and concatenation to improve the performance of your application. Let's be clear here: This is pointless. He did some benchmarking of his own to see how the myth would hold up and, as it turns out, it doesn't - "There is none". His proof compares two strings, one normal single-quoted and the other a double-quoted, and the opcodes they generate. They end up exactly the same. Since it's the opcodes that matter, he recommends using something like APC if you're really worried about the performance. He also includes an example using the token_get_all function of PHP to see how fast the strings run through the lexer too (again, almost no difference). As an added bonus, he also throws in a bit about string concatenation versus string interpolation with some benchmarking scripts and results of their own.
Nikita Popov's Blog: Disproving the Single Quotes Performance Myth
In this new post to his blog Nikita Popov aims to dispel the popular micro-optimization myth of using single quotes over double quotes for a performance boost. If there is one PHP related thing that I really hate, then it is definitely the Single Quotes Performance Myth. [...] Let's do a random Google search for "PHP single quotes performance": You will get many results telling you that single quotes are faster than double quotes and that string interpolation is much slower than string concatenation. Most of them advise to use single quotes and concatenation to improve the performance of your application. Let's be clear here: This is pointless. He did some benchmarking of his own to see how the myth would hold up and, as it turns out, it doesn't - "There is none". His proof compares two strings, one normal single-quoted and the other a double-quoted, and the opcodes they generate. They end up exactly the same. Since it's the opcodes that matter, he recommends using something like APC if you're really worried about the performance. He also includes an example using the token_get_all function of PHP to see how fast the strings run through the lexer too (again, almost no difference). As an added bonus, he also throws in a bit about string concatenation versus string interpolation with some benchmarking scripts and results of their own.
2012-01-10 15:19:
On the PHPWomen blog today there's a new book review of SitePoint's latest major PHP publication - "PHP Master" (by Lorna Mitchell, Davey Shafik and Matthew Turland). At 357 pages (375 including index), this book provides a thorough grounding in the key topics todays PHP developer should strive to know, and know well. The back cover ambitiously states that the book is "guaranteed to take your PHP skills to the next level". Keep reading to find out whether or not I agree. She walks you through the contents of the book, noting that, despite her being an experienced developer, there were still things that she found new. Despite the stated demographic, I think this book has a lot to offer novice developers. It would be a real challenge to properly digest and understand the wide range of topics covered, but an achievable and worthwhile one nonetheless. [...] If you're still undecided, my advice is buy the book - you won't regret it.
PHPWomen.org: Book review: PHP Master
On the PHPWomen blog today there's a new book review of SitePoint's latest major PHP publication - "PHP Master" (by Lorna Mitchell, Davey Shafik and Matthew Turland). At 357 pages (375 including index), this book provides a thorough grounding in the key topics todays PHP developer should strive to know, and know well. The back cover ambitiously states that the book is "guaranteed to take your PHP skills to the next level". Keep reading to find out whether or not I agree. She walks you through the contents of the book, noting that, despite her being an experienced developer, there were still things that she found new. Despite the stated demographic, I think this book has a lot to offer novice developers. It would be a real challenge to properly digest and understand the wide range of topics covered, but an achievable and worthwhile one nonetheless. [...] If you're still undecided, my advice is buy the book - you won't regret it.
2012-01-10 14:08:
Latest PECL Releases: mongo 1.2.7 lua 0.9.2 yaf 2.1.6 eio 0.4.0
Community News: Latest PECL Releases for 01.10.2012
Latest PECL Releases: mongo 1.2.7 lua 0.9.2 yaf 2.1.6 eio 0.4.0
2012-01-09 19:20:
New on PHPMaster.com there's a tutorial showing you how to use ClamAV support to work as a validation filter in a Zend Framework application. ClamAV is an open source project that helps identify malicious threats like trojeans, viruses and malware. Ok, so you're pretty comfortable with using the Zend Framework, specifically the use of Forms. Along with that, you have a good working knowledge of how to combine a host of standard validators [...] but what do you do when a situation arises that's outside the scope of the pre-packaged validators and filters? Let's say you want to guard against users uploading files that contain viruses, for example. You would have to write a custom validator that checks the uploads aren't infected. You'll need to install the ClamAV extension on your loal machine for the feature to work. Once it's there, though, it's as simple as setting up the validator (based on Zend_Validate_Abstract) and calling the "cl_scanfile" method on the uploaded file. Also included is the code for a sample controller with a Zend_Form instance and an upload file field to help prove it's working.
PHPMaster.com: ClamAV as a Validation Filter in Zend Framework
New on PHPMaster.com there's a tutorial showing you how to use ClamAV support to work as a validation filter in a Zend Framework application. ClamAV is an open source project that helps identify malicious threats like trojeans, viruses and malware. Ok, so you're pretty comfortable with using the Zend Framework, specifically the use of Forms. Along with that, you have a good working knowledge of how to combine a host of standard validators [...] but what do you do when a situation arises that's outside the scope of the pre-packaged validators and filters? Let's say you want to guard against users uploading files that contain viruses, for example. You would have to write a custom validator that checks the uploads aren't infected. You'll need to install the ClamAV extension on your loal machine for the feature to work. Once it's there, though, it's as simple as setting up the validator (based on Zend_Validate_Abstract) and calling the "cl_scanfile" method on the uploaded file. Also included is the code for a sample controller with a Zend_Form instance and an upload file field to help prove it's working.
2012-01-09 18:10:
Robert Basic has continued his series looking at using Dbus in PHP with this latest post to his blog - using the foundation he's created before to make a chat bot that will listen and respond to commands on a Jabber network. Now that we know how to use DBus to communicate with Pidgin from PHP and how to listen to DBus signals, it's time to put it all together by creating a simple chat bot! Nothing fancy, just a simple script that runs somewhere on some server and, by using a Pidgin account, can respond to some basic queries we send it. His new code listens for an incoming message on the "PurpleInterface", grabs the name of the sender and calls a "PurpleConvImSend" method with the conversation object and the message to send. You can find the complete source for the project on his github account.
Robert Basic's Blog: Creating a chat bot with PHP and Dbus
Robert Basic has continued his series looking at using Dbus in PHP with this latest post to his blog - using the foundation he's created before to make a chat bot that will listen and respond to commands on a Jabber network. Now that we know how to use DBus to communicate with Pidgin from PHP and how to listen to DBus signals, it's time to put it all together by creating a simple chat bot! Nothing fancy, just a simple script that runs somewhere on some server and, by using a Pidgin account, can respond to some basic queries we send it. His new code listens for an incoming message on the "PurpleInterface", grabs the name of the sender and calls a "PurpleConvImSend" method with the conversation object and the message to send. You can find the complete source for the project on his github account.
2012-01-09 16:31:
Fabien Potencier has posted the third and fourth parts of his "Build a framework on top of Symfony2 components series to his blog: Part three adds on another page to the sample site, creating a front controller and changing the output to use "setContent()" instead of just echoing the data. In part four he refactors the code to be a bit more readable, adds in the Symfony2 Routing component to correctly get the requests to the right controller and an example of how to generate routes based on route definitions. You can find the other parts of the series here: part one, part two.
Fabien Potencier's Blog: Create your own framework...on top of the Symfony2 Components (parts 3 & 4)
Fabien Potencier has posted the third and fourth parts of his "Build a framework on top of Symfony2 components series to his blog: Part three adds on another page to the sample site, creating a front controller and changing the output to use "setContent()" instead of just echoing the data. In part four he refactors the code to be a bit more readable, adds in the Symfony2 Routing component to correctly get the requests to the right controller and an example of how to generate routes based on route definitions. You can find the other parts of the series here: part one, part two.
2012-01-09 15:43:
7php.com has posted a new interview today with Chris Tankersley of the Northwest Ohio PHP Users group. The interview (made up of about 20 questions) talks about everything from what Chris thinks about PHP to some advice to aspiring developers to his framework preference. In this edition, I talked with Chris Tankersley a Zend PHP 5.3 Certified Engineer who has around 8-9 years programming experience in PHP. I'm impressed with his humbleness. He has not even mentioned his blog where he obviously rambles and grumbles about PHP and his projects. Chris has written a nice article on the PHP | Architect blog where he explains How To Exactly Find Where You Are Using The Yahoo PlaceFinder web service. Other questions include: What's the best PHP book you've read? What's one PHP project you really appreciate? Recently Microsoft has also started actively to concentrate on PHP, any comments on that? If you had to go back in time, would you still choose PHP? Check out the full post for the answers!
7php.com: Interview With Chris Tankersley Founder Of Northwest Ohio PHP Users Group
7php.com has posted a new interview today with Chris Tankersley of the Northwest Ohio PHP Users group. The interview (made up of about 20 questions) talks about everything from what Chris thinks about PHP to some advice to aspiring developers to his framework preference. In this edition, I talked with Chris Tankersley a Zend PHP 5.3 Certified Engineer who has around 8-9 years programming experience in PHP. I'm impressed with his humbleness. He has not even mentioned his blog where he obviously rambles and grumbles about PHP and his projects. Chris has written a nice article on the PHP | Architect blog where he explains How To Exactly Find Where You Are Using The Yahoo PlaceFinder web service. Other questions include: What's the best PHP book you've read? What's one PHP project you really appreciate? Recently Microsoft has also started actively to concentrate on PHP, any comments on that? If you had to go back in time, would you still choose PHP? Check out the full post for the answers!
2012-01-09 14:25:
The PHP development team has officially released PHP 5.4.0 RC5, the latest (and the second to last) release candidate for the next major version of the language. The PHP development team announces the 5th release candidate of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. Bugs fixed in this version include a few to the Core, SAPI/CLI SAPI, PHP-FPM support and improvements to the session extension. Download and test out this latest version on your systems - the more feedback they receive the better! You can report issues you might find on the PHP bug tracker.
PHP.net: PHP 5.4.0 RC5 released
The PHP development team has officially released PHP 5.4.0 RC5, the latest (and the second to last) release candidate for the next major version of the language. The PHP development team announces the 5th release candidate of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. Bugs fixed in this version include a few to the Core, SAPI/CLI SAPI, PHP-FPM support and improvements to the session extension. Download and test out this latest version on your systems - the more feedback they receive the better! You can report issues you might find on the PHP bug tracker.
2012-01-09 14:02:
Latest PEAR Releases: Net_IMAP 1.1.1 HTML_BBCodeParser 1.2.3 Tree 0.3.7 Tree 0.3.6 Image_QRCode 0.1.3 Net_Growl 2.5.0
Community News: Latest PEAR Releases for 01.09.2012
Latest PEAR Releases: Net_IMAP 1.1.1 HTML_BBCodeParser 1.2.3 Tree 0.3.7 Tree 0.3.6 Image_QRCode 0.1.3 Net_Growl 2.5.0
2012-01-06 18:02:
Chris Hartjes is asking for suggestions to help solve a common problem for developers (remote or otherwise) that have to develop in a non-local setup: a better method for remote code development. I've been playing around with Sublime Text (because of the awesome vim bindings) and was thinking about why do I always have to be logged into the remote server to do my work. Normally I connect using SSH, then attach to my tmux session and then fire up vim. This is okay but it lacks a certain elegance in it's approach. [...] What I'm chafing against is having to deal with multiple environments all the time to get my work done. His ultimate goal is to be able to update and commit code without having to be logged into the remote server - essentially to replicate the local development experience regardless of the underlying technology. Have a suggestion or a method that's currently working for you? Leave him a comment!
Chris Hartjes' Blog: Better Remote Code Development
Chris Hartjes is asking for suggestions to help solve a common problem for developers (remote or otherwise) that have to develop in a non-local setup: a better method for remote code development. I've been playing around with Sublime Text (because of the awesome vim bindings) and was thinking about why do I always have to be logged into the remote server to do my work. Normally I connect using SSH, then attach to my tmux session and then fire up vim. This is okay but it lacks a certain elegance in it's approach. [...] What I'm chafing against is having to deal with multiple environments all the time to get my work done. His ultimate goal is to be able to update and commit code without having to be logged into the remote server - essentially to replicate the local development experience regardless of the underlying technology. Have a suggestion or a method that's currently working for you? Leave him a comment!
2012-01-06 17:03:
As Paul Jones mentions in this new post to his blog the Aura project, a PHP framework, originally targeted at PHP 5.3 has changed its direction a bit - they've shifted from a focus on PHP 5.3 to the upcoming PHP 5.4 release. When I initially announced the Aura project, it was targeted at PHP 5.3. With a stable release of PHP 5.4 impending, we have moved the target to PHP 5.4. In addition, we have made 1.0.0-beta1 releases of almost all the component packages. (See an earlier announcement from Hari KT.) The components include: a dependency injection container, an autoloader and a view system that are all self-contained with no other dependencies. You can find the complete code for these containers (and one for combining them all into a single system) on the project's github page.
Paul Jones' Blog: The Aura Project: Now For PHP 5.4, With Beta Releases
As Paul Jones mentions in this new post to his blog the Aura project, a PHP framework, originally targeted at PHP 5.3 has changed its direction a bit - they've shifted from a focus on PHP 5.3 to the upcoming PHP 5.4 release. When I initially announced the Aura project, it was targeted at PHP 5.3. With a stable release of PHP 5.4 impending, we have moved the target to PHP 5.4. In addition, we have made 1.0.0-beta1 releases of almost all the component packages. (See an earlier announcement from Hari KT.) The components include: a dependency injection container, an autoloader and a view system that are all self-contained with no other dependencies. You can find the complete code for these containers (and one for combining them all into a single system) on the project's github page.
2012-01-06 16:26:
Stoimen Popov has a new post to his blog today comparing the performance of bitwise division versus the normal "/" division operator. Recently I wrote about binary search and then I said that in some languages, like PHP, bitwise division by two is not faster than the typical "/" operator. However I decided to make some experiments and here are the results. According to his results using the bitwise method is slightly faster, but you'd only really notice it when working with large sets of data (like his example using 10,000,000). The code to run his benchmarks is included in the post.
Stoimen Popov's Blog: PHP Performance: Bitwise Division
Stoimen Popov has a new post to his blog today comparing the performance of bitwise division versus the normal "/" division operator. Recently I wrote about binary search and then I said that in some languages, like PHP, bitwise division by two is not faster than the typical "/" operator. However I decided to make some experiments and here are the results. According to his results using the bitwise method is slightly faster, but you'd only really notice it when working with large sets of data (like his example using 10,000,000). The code to run his benchmarks is included in the post.
2012-01-06 15:50:
On the 7php.com blog Khayrattee Wasseem has a few suggestions about how to "build your geek cred" as a PHP developer - suggestions of resources and things you can do to get more involved in the language and its community. If you've read the PHP|Architect Magazine - March 2011 Edition, you have surely enjoyed the nice article by Jason Austin (a PHP developer from Raleigh, NC) titled "Good PHP help is hard to find". Jason talks about 'the why' and 'the how' to distinguish yourself as a qualified PHP Professional from the crowd. And the way to do that is: "You have to build your geek cred". I think he did a brilliant job with the article. Some of Khayrattee's suggestions include (each rated with a number of "cred points"): Get certified with recognised certifications like the Zend Certified Engineer program Start a PHP meetup group near you Sign up to attend PHP conferences around the world Blog about PHP { have a blog dedicated to it }
7php.com: Building Your PHP Geek Cred To Publicly Be An Awesome PHP Developer
On the 7php.com blog Khayrattee Wasseem has a few suggestions about how to "build your geek cred" as a PHP developer - suggestions of resources and things you can do to get more involved in the language and its community. If you've read the PHP|Architect Magazine - March 2011 Edition, you have surely enjoyed the nice article by Jason Austin (a PHP developer from Raleigh, NC) titled "Good PHP help is hard to find". Jason talks about 'the why' and 'the how' to distinguish yourself as a qualified PHP Professional from the crowd. And the way to do that is: "You have to build your geek cred". I think he did a brilliant job with the article. Some of Khayrattee's suggestions include (each rated with a number of "cred points"): Get certified with recognised certifications like the Zend Certified Engineer program Start a PHP meetup group near you Sign up to attend PHP conferences around the world Blog about PHP { have a blog dedicated to it }
2012-01-06 14:04:
Popular posts from PHPDeveloper.org for the past week:Sankuru Blog: A simple bytecode compiler with virtual machine, written in Php, for the EL language Henrik Bjørnskov's Blog: Symfony2: Add Cross Site Request Forgery protection to login forms Mark Story's Blog: New errors in PHP 5.4 Ed Finkler's Blog: The MicroPHP Manifesto Freek Lijten's Blog: The real problem of the hash table dos attack NetTuts.com: Creating an API-Centric Web Application Hasin Hayder's Blog: Getting comfy with PhpStorm - one of the best IDEs so far! Reddit.com: A Response to "The MicroPHP Manifesto" Site News: Popular Posts for the Week of 12.30.2011 Kenny Katzgrau's Blog: The Top 10 CodeIgniter Sparks of 2011
Site News: Popular Posts for the Week of 01.06.2012
Popular posts from PHPDeveloper.org for the past week:Sankuru Blog: A simple bytecode compiler with virtual machine, written in Php, for the EL language Henrik Bjørnskov's Blog: Symfony2: Add Cross Site Request Forgery protection to login forms Mark Story's Blog: New errors in PHP 5.4 Ed Finkler's Blog: The MicroPHP Manifesto Freek Lijten's Blog: The real problem of the hash table dos attack NetTuts.com: Creating an API-Centric Web Application Hasin Hayder's Blog: Getting comfy with PhpStorm - one of the best IDEs so far! Reddit.com: A Response to "The MicroPHP Manifesto" Site News: Popular Posts for the Week of 12.30.2011 Kenny Katzgrau's Blog: The Top 10 CodeIgniter Sparks of 2011
2012-01-05 21:39:
In a recent post to his blog Jeremy Cook has a tutorial about using the Countable interface (part of the SPL) in your objects to make them play nicely with functions like count. PHP provides a number of predefined interfaces and classes that can really make your life as a developer easier but which are often overlooked. The functionality offered by the Standard PHP Library (SPL) and the predefined interfaces is extremely cool and very powerful but very underutilized. [...] I thought I'd write a few articles with examples of how I've used these classes and interfaces in the hope that someone would find it useful. I'd love it if people felt like commenting with their own examples too. I'll start with a quick look at the Countable interface. He includes sample code for classes using the Countable interface and defining the custom "count()" method inside. This method lets you define how the object will behave when something like count is called on it. His examples show returning the number of items in a private variable, determining the state of an object and including logic to only find valid data (like from a database table).
Jeremy Cook's Blog: Using the Countable Interface
In a recent post to his blog Jeremy Cook has a tutorial about using the Countable interface (part of the SPL) in your objects to make them play nicely with functions like count. PHP provides a number of predefined interfaces and classes that can really make your life as a developer easier but which are often overlooked. The functionality offered by the Standard PHP Library (SPL) and the predefined interfaces is extremely cool and very powerful but very underutilized. [...] I thought I'd write a few articles with examples of how I've used these classes and interfaces in the hope that someone would find it useful. I'd love it if people felt like commenting with their own examples too. I'll start with a quick look at the Countable interface. He includes sample code for classes using the Countable interface and defining the custom "count()" method inside. This method lets you define how the object will behave when something like count is called on it. His examples show returning the number of items in a private variable, determining the state of an object and including logic to only find valid data (like from a database table).
2012-01-05 20:20:
Sharon Levy has a new post to her blog showing a trick she's come up with to show the PHP version information (usually found in the phpinfo) even when it's disabled. Sometimes the most crucial, basic piece of information can seem so hard to find. For example, suppose you wanted to find out what version of PHP your remote webhost provides to shared hosting users? What would you do? [...] For development purposes it can be helpful having phpinfo() available, but on a live shared host, you may discover as I did recently that it is no longer available; your host may have disabled it. She includes three other ways you can use to get the version of PHP you're working with: If you have command line access, running "php -v" Using the phpversion function (or PHP_VERSION constant) Appending a certain value to the URL (only works in some cases)
Sharon Levy's Blog: PHP Version
Sharon Levy has a new post to her blog showing a trick she's come up with to show the PHP version information (usually found in the phpinfo) even when it's disabled. Sometimes the most crucial, basic piece of information can seem so hard to find. For example, suppose you wanted to find out what version of PHP your remote webhost provides to shared hosting users? What would you do? [...] For development purposes it can be helpful having phpinfo() available, but on a live shared host, you may discover as I did recently that it is no longer available; your host may have disabled it. She includes three other ways you can use to get the version of PHP you're working with: If you have command line access, running "php -v" Using the phpversion function (or PHP_VERSION constant) Appending a certain value to the URL (only works in some cases)
2012-01-05 19:31:
On PHPClasses.org today the latest episode (#19) of the "Lately in PHP" podcast has been posted. In it Manual Lemos and Ernani Joppert: talk about the concept of a JIT (just in time) compiler for PHP (such as HipHop or Phalanger). JIT compilation is the main topic of the episode 19 of the Lately in PHP podcast presented by Manuel Lemos and Ernani Joppert who received as guests Miloslav Beno of the Phalanger team and Nuno Lopes of the PECL LLVM project to discuss this and other interesting topics of the PHP scene. The hosts and their guests talk about compiling PHP, things that happened in 2011 and look forward to what's to come in the world of PHP in 2012. You can listen to this latest episode either via the in-page player, by downloading the mp3 or by subscribing to the podcast feed.
PHPClasses.org: Lately in PHP Podcast Episode 19 - The Debate of Making PHP Faster using a JIT
On PHPClasses.org today the latest episode (#19) of the "Lately in PHP" podcast has been posted. In it Manual Lemos and Ernani Joppert: talk about the concept of a JIT (just in time) compiler for PHP (such as HipHop or Phalanger). JIT compilation is the main topic of the episode 19 of the Lately in PHP podcast presented by Manuel Lemos and Ernani Joppert who received as guests Miloslav Beno of the Phalanger team and Nuno Lopes of the PECL LLVM project to discuss this and other interesting topics of the PHP scene. The hosts and their guests talk about compiling PHP, things that happened in 2011 and look forward to what's to come in the world of PHP in 2012. You can listen to this latest episode either via the in-page player, by downloading the mp3 or by subscribing to the podcast feed.
2012-01-05 18:58:
Brian Swan has posted another tutorial in a series looking at testing applications on the Azure platform. In this latest post he talks about how to automate your PHPUnit tests as a part of the start up of the instance. In this post, I'll show you how to deploy your PHPUnit tests with your application, have the tests run as a start up task, and have the results written to your storage account for analysis. Attached to this post is a .zip file that contains a skeleton project that you can use to automatically run PHPUnit tests when you deploy a PHP application to Azure. I'll walk you though how to use the skeleton project, then provide a bit more detail as to how it all works (so you can make modifications where necessary). He has it broken up into a few easy-to-follow steps: Download the AzurePHPWebRole zip archive and unpack it Copy your application, tests and PHP installation into the resulting file structure Create a skeleton "ServiceConfiguration.cscfg" file with the "cspack" command and edit it to change the "osfamily" and "osversion" settings Use "cspack" to package up the application and deploy the application He walks you through the "how it works" steps too - the things that happen for you automatically on the server side to do things like set up the file to log to, configure the PHP environment and execute the "runtests" Powershell file as included in the AzurePHPWebRole download.
Brian Swan's Blog: Automating PHPUnit Tests in Windows Azure
Brian Swan has posted another tutorial in a series looking at testing applications on the Azure platform. In this latest post he talks about how to automate your PHPUnit tests as a part of the start up of the instance. In this post, I'll show you how to deploy your PHPUnit tests with your application, have the tests run as a start up task, and have the results written to your storage account for analysis. Attached to this post is a .zip file that contains a skeleton project that you can use to automatically run PHPUnit tests when you deploy a PHP application to Azure. I'll walk you though how to use the skeleton project, then provide a bit more detail as to how it all works (so you can make modifications where necessary). He has it broken up into a few easy-to-follow steps: Download the AzurePHPWebRole zip archive and unpack it Copy your application, tests and PHP installation into the resulting file structure Create a skeleton "ServiceConfiguration.cscfg" file with the "cspack" command and edit it to change the "osfamily" and "osversion" settings Use "cspack" to package up the application and deploy the application He walks you through the "how it works" steps too - the things that happen for you automatically on the server side to do things like set up the file to log to, configure the PHP environment and execute the "runtests" Powershell file as included in the AzurePHPWebRole download.
2012-01-05 17:41:
On PHPMaster.com today there's a new tutorial posted about using the Phing build tool to automate a process, usually a build for a website launch. In his example, he shows a simple "Hello World" example and how to work with multiple targets in the same build file. Phing is a PHP project build tool based on Apache Ant. A build system helps you to perform a group of actions using a single command. [...] Phing helps overcome [human error] issues by automating tasks like running unit tests, applying database changes, deploying application code, etc. In this article I'll show you some of the basics of working with Phing. He includes the commands you'll need to install Phing (if it's not already) via the PEAR installer and a basic "build.xml" file. He explains the parts of the file - tags for "project", "target" "echo" and "property - and includes a more complex build example with multiple targets (and how to call one specifically from the command line).
PHPMaster.com: Using Phing
On PHPMaster.com today there's a new tutorial posted about using the Phing build tool to automate a process, usually a build for a website launch. In his example, he shows a simple "Hello World" example and how to work with multiple targets in the same build file. Phing is a PHP project build tool based on Apache Ant. A build system helps you to perform a group of actions using a single command. [...] Phing helps overcome [human error] issues by automating tasks like running unit tests, applying database changes, deploying application code, etc. In this article I'll show you some of the basics of working with Phing. He includes the commands you'll need to install Phing (if it's not already) via the PEAR installer and a basic "build.xml" file. He explains the parts of the file - tags for "project", "target" "echo" and "property - and includes a more complex build example with multiple targets (and how to call one specifically from the command line).
2012-01-05 16:02:
Anthony Ferrara has posted his own response to the recently posted MicroPHP Manifesto (from Ed Finkler that has caused quite a stir in the PHP community). In the post, Anthony mentions some of the points he both agrees and disagrees with about the manifesto. I came across a rather interesting post yesterday entitled The MicroPHP Manifesto. The author made clever use of a very interesting analogy (drum players) to try to prove his point that less is more. The article makes a very interesting read, and I would suggest that everyone reads it. Go ahead. I'll wait. With that said, I have to disagree with the article rather vehemently. I think the message is somewhat right, but for all the wrong reasons. One of his main points is that he believes in the "right tool for the right job" mentality and suggests that, like the manifesto says, small things are good for some jobs. In other places, though, a full-stack framework (or component-based one) is the right fit. He finishes off the post by going through the manifesto points themselves and adding commentary with his thoughts on each.
Anthony Ferrara's Blog: The MicroPHP Fallacy
Anthony Ferrara has posted his own response to the recently posted MicroPHP Manifesto (from Ed Finkler that has caused quite a stir in the PHP community). In the post, Anthony mentions some of the points he both agrees and disagrees with about the manifesto. I came across a rather interesting post yesterday entitled The MicroPHP Manifesto. The author made clever use of a very interesting analogy (drum players) to try to prove his point that less is more. The article makes a very interesting read, and I would suggest that everyone reads it. Go ahead. I'll wait. With that said, I have to disagree with the article rather vehemently. I think the message is somewhat right, but for all the wrong reasons. One of his main points is that he believes in the "right tool for the right job" mentality and suggests that, like the manifesto says, small things are good for some jobs. In other places, though, a full-stack framework (or component-based one) is the right fit. He finishes off the post by going through the manifesto points themselves and adding commentary with his thoughts on each.
2012-01-05 15:11:
Fabien Potencier is back with the next installment of his "Building a framework on top of Symfony2" tutorial series with this look at using the HttpFoundation component to use the Request and Response classes to handle HTTP interaction. (Part one is here.) The first step towards better code is probably to use an Object-Oriented approach; that's the main goal of the Symfony2 HttpFoundation component: replacing the default PHP global variables and functions by an Object-Oriented layer. He shows how using this component not only makes OOP handling of requests/responses simpler, but also helps to make your application more secure through features already included in the HttpFoundation component. Sample code is included showing how to fetch the current request, get filtered values from the superglobals (GET/SERVER/etc) and how to respond with a refactored version of the "Hello world" message from the previous example.
Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 2)
Fabien Potencier is back with the next installment of his "Building a framework on top of Symfony2" tutorial series with this look at using the HttpFoundation component to use the Request and Response classes to handle HTTP interaction. (Part one is here.) The first step towards better code is probably to use an Object-Oriented approach; that's the main goal of the Symfony2 HttpFoundation component: replacing the default PHP global variables and functions by an Object-Oriented layer. He shows how using this component not only makes OOP handling of requests/responses simpler, but also helps to make your application more secure through features already included in the HttpFoundation component. Sample code is included showing how to fetch the current request, get filtered values from the superglobals (GET/SERVER/etc) and how to respond with a refactored version of the "Hello world" message from the previous example.
2012-01-04 18:40:
Improving on his last post about creating a bytecode compiler in PHP, the Sankuru blog has a new post in the series looking at extending the basic compiler to add support for if/while and do while logic. In order to obtain a turing-complete programming language, that is, a language in which we can implement and execute any arbitrary algorithm, that is, that other turing-complete machines can execute too, we now need to add a way of (conditionally) branching, that is, the IF statement, and at least one way of repeating statements, that is the WHILE or the DO WHILE statements. He includes a simple TL-based script as an end goal for the compiler to be able to execute and shows how to add rules for it to the lexer/parser. Rules for the "if" are relatively simple, but there's a hitch in dealing with embedded "while" statements he had to work around. The post ends with the bytecode results for the sample program and the resulting output from the compiled versions execution.
Sankuru Blog: Adding support for if/while/do while, to a simple compiler & virtual machine in PHP
Improving on his last post about creating a bytecode compiler in PHP, the Sankuru blog has a new post in the series looking at extending the basic compiler to add support for if/while and do while logic. In order to obtain a turing-complete programming language, that is, a language in which we can implement and execute any arbitrary algorithm, that is, that other turing-complete machines can execute too, we now need to add a way of (conditionally) branching, that is, the IF statement, and at least one way of repeating statements, that is the WHILE or the DO WHILE statements. He includes a simple TL-based script as an end goal for the compiler to be able to execute and shows how to add rules for it to the lexer/parser. Rules for the "if" are relatively simple, but there's a hitch in dealing with embedded "while" statements he had to work around. The post ends with the bytecode results for the sample program and the resulting output from the compiled versions execution.
2012-01-04 17:10:
Kevin Schroeder has come back around and has posted a new tutorial to his blog showing how to connect PDT to the Zend Developer Cloud (the "PHP Development Tools" extension for the Eclipse IDE). A couple of weeks ago I wrote a series of blog posts on how to connect to the Zend Developer cloud with various IDEs. Except one that I missed... PDT. The deployment plugin is already installed in PDT 3 and so you already will have the ability to push to the DevCloud instance. The process is pretty simple thanks to that plugin - just create the project (or use an existing one), set up a new target for deployment then launch and deploy the PHP application directly. You can find out more about the "PHP Development Tools" on its Eclipse project site.
Kevin Schroeder's Blog: Connecting to the Zend Developer Cloud with PDT
Kevin Schroeder has come back around and has posted a new tutorial to his blog showing how to connect PDT to the Zend Developer Cloud (the "PHP Development Tools" extension for the Eclipse IDE). A couple of weeks ago I wrote a series of blog posts on how to connect to the Zend Developer cloud with various IDEs. Except one that I missed... PDT. The deployment plugin is already installed in PDT 3 and so you already will have the ability to push to the DevCloud instance. The process is pretty simple thanks to that plugin - just create the project (or use an existing one), set up a new target for deployment then launch and deploy the PHP application directly. You can find out more about the "PHP Development Tools" on its Eclipse project site.
2012-01-04 16:18:
On Reddit today there's a rather large discussion going on about the recently posted manifesto from Ed Finkler about building simple, manageable tools rather than using "kitchen sink" frameworks for your applications. As of the time of this post there's about sixty-five comments posted to the thread with widely ranging opinions: "How is [lots of separate libraries scattered around] better than simply using a framework?" "This is part of the reason for the PSR0 reference for auto loaders [...] Part of the problem is an inconsistent way to load modules." "I would love to see this become a trend in the PHP community. I think this is exactly the direction needed to make PHP exciting again and regain mindshare in the wider dev community." "I know, many people are currently on that micro trip but seriously, I think that there is as much to microframeworks as there is to microoptimization" "A framework is a tool. If you don't need it, why use it?" "There's a tool for ever job, I agree some projects or companies "need" something like Zend or Symfony for their enterprise projects. Whether or not you'd want to work on a project with 1000's of classes is something else all together." Read the full responses to Ed's article here.
Reddit.com: A Response to "The MicroPHP Manifesto"
On Reddit today there's a rather large discussion going on about the recently posted manifesto from Ed Finkler about building simple, manageable tools rather than using "kitchen sink" frameworks for your applications. As of the time of this post there's about sixty-five comments posted to the thread with widely ranging opinions: "How is [lots of separate libraries scattered around] better than simply using a framework?" "This is part of the reason for the PSR0 reference for auto loaders [...] Part of the problem is an inconsistent way to load modules." "I would love to see this become a trend in the PHP community. I think this is exactly the direction needed to make PHP exciting again and regain mindshare in the wider dev community." "I know, many people are currently on that micro trip but seriously, I think that there is as much to microframeworks as there is to microoptimization" "A framework is a tool. If you don't need it, why use it?" "There's a tool for ever job, I agree some projects or companies "need" something like Zend or Symfony for their enterprise projects. Whether or not you'd want to work on a project with 1000's of classes is something else all together." Read the full responses to Ed's article here.
2012-01-04 15:47:
Fabien Potencier has written up a new post on his blog talking about creating your own framework layered on top of the Symfony2 framework's component system (yes, a framework from a framework). Symfony2 is a reusable set of standalone, decoupled, and cohesive PHP components that solve common web development problems. Instead of using these low-level components, you can use the ready-to-be-used Symfony2 full-stack web framework, which is based on these components... or you can create your very own framework. This series is about the latter. He talks about the reasoning behind wanting to make your own framework, mostly dealing with exploration and/or proving you can do it. He walks you through every step of the way - creating the base directory, setting up a project via Composer, creating an autoloader and making a first basic file - a "Hello world" echo message. In the next part of the series, he'll add in the HttpFoundation component for web interaction.
Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 1)
Fabien Potencier has written up a new post on his blog talking about creating your own framework layered on top of the Symfony2 framework's component system (yes, a framework from a framework). Symfony2 is a reusable set of standalone, decoupled, and cohesive PHP components that solve common web development problems. Instead of using these low-level components, you can use the ready-to-be-used Symfony2 full-stack web framework, which is based on these components... or you can create your very own framework. This series is about the latter. He talks about the reasoning behind wanting to make your own framework, mostly dealing with exploration and/or proving you can do it. He walks you through every step of the way - creating the base directory, setting up a project via Composer, creating an autoloader and making a first basic file - a "Hello world" echo message. In the next part of the series, he'll add in the HttpFoundation component for web interaction.
2012-01-03 20:18:
On NetTuts.com there's a recent post from Nikko Bautista about creating an API-centric application and how it can help you make a more flexible, accessible application overall. Code is included to make a simple TODO list application based on this idea. Planning to start working on a new web application? In this tutorial, we'll discuss how to create an API-centric web application, and explain why this is essential in today's multi-platform world. [...] An API-Centric Web Application is a web application that basically executes most, if not, all its functionality through API calls. [...] Another characteristic of an API-Centric Web Application is that the API will always be stateless, meaning it can't recognize API calls by session. He talks about how doing the work like this, though it might seem like more trouble up front, can lead to an easier time later when you need to add multi-platform support (or even open it to customers directly). In the sample application, he shows the creation of a TODO application that can create, read, update and delete items via an API. Also included is a bit of code to help secure your service with an APP ID and APP SECRET authentication set. Full code for the backend API and the frontend to interface with it can be downloaded here.
NetTuts.com: Creating an API-Centric Web Application
On NetTuts.com there's a recent post from Nikko Bautista about creating an API-centric application and how it can help you make a more flexible, accessible application overall. Code is included to make a simple TODO list application based on this idea. Planning to start working on a new web application? In this tutorial, we'll discuss how to create an API-centric web application, and explain why this is essential in today's multi-platform world. [...] An API-Centric Web Application is a web application that basically executes most, if not, all its functionality through API calls. [...] Another characteristic of an API-Centric Web Application is that the API will always be stateless, meaning it can't recognize API calls by session. He talks about how doing the work like this, though it might seem like more trouble up front, can lead to an easier time later when you need to add multi-platform support (or even open it to customers directly). In the sample application, he shows the creation of a TODO application that can create, read, update and delete items via an API. Also included is a bit of code to help secure your service with an APP ID and APP SECRET authentication set. Full code for the backend API and the frontend to interface with it can be downloaded here.
2012-01-03 19:44:
As mentioned by the PHPNW twitter account, the videos for almost all of the sessions in this year's PHP North West conference have been posted. Sessions so far include: Ian Barber's keynote How to Stand on the Shoulders of Giants Sebastian Bergmann's PHP Tester's Toolbox Scott MacVicar's Scaling Your Development Team Alistair Stead's Varnish your PHP application, make it fly! Jacopo Romei's Many To Many - No Man Is An Island Volker Dusch's Stop Wasting Time By Applying Clean Code Principles You can find the full list in this link bundle complete with author bios, links to the videos and a summary of each session.
Community News: Videos of PHP North West 2011 Sessions Published
As mentioned by the PHPNW twitter account, the videos for almost all of the sessions in this year's PHP North West conference have been posted. Sessions so far include: Ian Barber's keynote How to Stand on the Shoulders of Giants Sebastian Bergmann's PHP Tester's Toolbox Scott MacVicar's Scaling Your Development Team Alistair Stead's Varnish your PHP application, make it fly! Jacopo Romei's Many To Many - No Man Is An Island Volker Dusch's Stop Wasting Time By Applying Clean Code Principles You can find the full list in this link bundle complete with author bios, links to the videos and a summary of each session.
2012-01-03 18:06:
New from the XPertDeveloper.com blog there's a tutorial showing how to use the Facebook graph API to get page details via a simple cURL request (cURL PHP support required for the example). Here is the technique to get the detail of the Facebook page with Graph API and PHP. This is the very easy method to get the Facebook page detail. So Let's see how to get this done. With this method you can get details of any Facebook page [inluding] name, picture, link, website, products, description and if the user can post to it. The sample code is only a few lines - it uses the Facebook page ID (easy to grab from the URL) and fetches a URL with it as a parameter. The output is returned as a standard PHP object with all of the properties attached (decoded from JSON). This is just one of many methods the Facebook graph API has, so check out their documentation for more methods and details on returned values.
XPertDeveloper.com: Get Facebook Page Detail Using Graph API and PHP
New from the XPertDeveloper.com blog there's a tutorial showing how to use the Facebook graph API to get page details via a simple cURL request (cURL PHP support required for the example). Here is the technique to get the detail of the Facebook page with Graph API and PHP. This is the very easy method to get the Facebook page detail. So Let's see how to get this done. With this method you can get details of any Facebook page [inluding] name, picture, link, website, products, description and if the user can post to it. The sample code is only a few lines - it uses the Facebook page ID (easy to grab from the URL) and fetches a URL with it as a parameter. The output is returned as a standard PHP object with all of the properties attached (decoded from JSON). This is just one of many methods the Facebook graph API has, so check out their documentation for more methods and details on returned values.
2012-01-03 17:46:
Ed Finkler has put together what he calls the MicroPHP Manifesto, a call to arms for the PHP community to get "back to the basics" and focus more on things like good well-crafted code rather than extending out into "complex, verbose solutions." The approach I've been taking lately is to start with as lightweight a foundation as possible, in the form of a "microframework." [...] For additional functionality, I pull in lightweight libraries that help me accomplish only the tasks I need. Clarity and brevity are my top considerations. My other big consideration is the commitment I make when I use code I didn't write. He goes on to talk about difficulties finding lightweight libraries to suit his needs and gives some cloc benchmarks for the Symfony HttpKernel and the Slim and Epiphany microframeworks. The end of the post is the most important part - the manifesto itself...one he hopes will ring true with the development community. It includes things like: "I am a PHP developer. I am not a Zend Framework or Symfony or CakePHP developer." "I like building small things with simple purposes." "I need to justify every piece of code I add to a project." "I want to write code that's easily understood." For more read the full post over on his blog.
Ed Finkler's Blog: The MicroPHP Manifesto
Ed Finkler has put together what he calls the MicroPHP Manifesto, a call to arms for the PHP community to get "back to the basics" and focus more on things like good well-crafted code rather than extending out into "complex, verbose solutions." The approach I've been taking lately is to start with as lightweight a foundation as possible, in the form of a "microframework." [...] For additional functionality, I pull in lightweight libraries that help me accomplish only the tasks I need. Clarity and brevity are my top considerations. My other big consideration is the commitment I make when I use code I didn't write. He goes on to talk about difficulties finding lightweight libraries to suit his needs and gives some cloc benchmarks for the Symfony HttpKernel and the Slim and Epiphany microframeworks. The end of the post is the most important part - the manifesto itself...one he hopes will ring true with the development community. It includes things like: "I am a PHP developer. I am not a Zend Framework or Symfony or CakePHP developer." "I like building small things with simple purposes." "I need to justify every piece of code I add to a project." "I want to write code that's easily understood." For more read the full post over on his blog.
2012-01-03 17:19:
Phil Sturgeon has a new post to his blog about what he sees 2012 as being for the PHP community - the year of cloud hosting with all of the platform-as-a-service companies that have started up over the last year. Cloud hosting is nothing new. Seeing as "cloud" is such a loosely used term some will consider their VPS solutions on Slicehost or Rackspace to be "cloud hosting". That is partially true, but this article covers how PHP is getting some serious attention in the PaaS (Platform as a Service) field. This year you will almost certainly find yourself making the decision wether or not to move some of your applications and services across to the cloud, and this article can hopefully help you work out why and how. He talks a bit about how the idea compares with Ruby's Heroku hosting service and some of the benefits that come with it: Speedy deployments Security Scaling He also looks forward to the future, mentioning some of the major players in the PHP PaaS space like Orchestra.io and App Fog (as well as a brief suggestion of a possible PHP beta over at Heroku).
Phil Sturgeon's Blog: 2012: The year of PHP cloud hosting
Phil Sturgeon has a new post to his blog about what he sees 2012 as being for the PHP community - the year of cloud hosting with all of the platform-as-a-service companies that have started up over the last year. Cloud hosting is nothing new. Seeing as "cloud" is such a loosely used term some will consider their VPS solutions on Slicehost or Rackspace to be "cloud hosting". That is partially true, but this article covers how PHP is getting some serious attention in the PaaS (Platform as a Service) field. This year you will almost certainly find yourself making the decision wether or not to move some of your applications and services across to the cloud, and this article can hopefully help you work out why and how. He talks a bit about how the idea compares with Ruby's Heroku hosting service and some of the benefits that come with it: Speedy deployments Security Scaling He also looks forward to the future, mentioning some of the major players in the PHP PaaS space like Orchestra.io and App Fog (as well as a brief suggestion of a possible PHP beta over at Heroku).
2012-01-03 16:54:
In a quick new post to his blog, Rob Allen has shared a snippet for the Sublime Text 2 editor to make creating getters and setters for your class simpler (dynamically too). As with a lot of editors, Sublime Text supports snippets which are essentially text expansions of a short phrase into more text. I needed to create a few getXxx() and setXxx() methods for some properties of a class and decided that the easiest way to do this would be with a snippet. Included in the post is the code you'll need to put into the snippet - a simple find (regular expression based) looks at the currently selected variable and expands out the getter and setter for it. For more information on the Sublime Text 2 editor, see the product's website.
Rob Allen's Blog: Sublime Text 2 Snippet for PHP getter and setter generation
In a quick new post to his blog, Rob Allen has shared a snippet for the Sublime Text 2 editor to make creating getters and setters for your class simpler (dynamically too). As with a lot of editors, Sublime Text supports snippets which are essentially text expansions of a short phrase into more text. I needed to create a few getXxx() and setXxx() methods for some properties of a class and decided that the easiest way to do this would be with a snippet. Included in the post is the code you'll need to put into the snippet - a simple find (regular expression based) looks at the currently selected variable and expands out the getter and setter for it. For more information on the Sublime Text 2 editor, see the product's website.
2012-01-03 15:25:
On PHPMaster.com today there's a new article introducing you to the Command design pattern and looking to help you understand its use a bit better. The majority of [cell phone] users have opted to receive an email, but a significant number are now opting to receive the notifications via SMS. Here's the problem: How do you send a message via two different channels to both groups of users? The logical approach would be to split the users into 2 groups, email recipients and SMS recipients, which would involve running 2 different queries and sending the codeword to each group separately. Using the Command Pattern, which I will introduce you to in this article, you can send the message to both groups of users in a single process. He uses the message queue he mentioned as an example - showing how you can can queue up different kinds of objects (actions) based on a common interface into the same process. He creates a "DailyAlertEmail" and "DailyAlertSMS" classes, both with a "send" method. The settings for these are then pulled from a database and the "execute" method on the "MessageQueue" class is called to loop through them, calling "send" to do that work.
PHPMaster.com: Understanding the Command Design Pattern
On PHPMaster.com today there's a new article introducing you to the Command design pattern and looking to help you understand its use a bit better. The majority of [cell phone] users have opted to receive an email, but a significant number are now opting to receive the notifications via SMS. Here's the problem: How do you send a message via two different channels to both groups of users? The logical approach would be to split the users into 2 groups, email recipients and SMS recipients, which would involve running 2 different queries and sending the codeword to each group separately. Using the Command Pattern, which I will introduce you to in this article, you can send the message to both groups of users in a single process. He uses the message queue he mentioned as an example - showing how you can can queue up different kinds of objects (actions) based on a common interface into the same process. He creates a "DailyAlertEmail" and "DailyAlertSMS" classes, both with a "send" method. The settings for these are then pulled from a database and the "execute" method on the "MessageQueue" class is called to loop through them, calling "send" to do that work.
2012-01-03 14:08:
Latest PECL Releases: cairo 0.3.0
Community News: Latest PECL Releases for 01.03.2012
Latest PECL Releases: cairo 0.3.0
2012-01-02 22:07:
Hasin Haydertalks about "getting comfy with PHPStorm" a relatively recent addition to the IDE ranks for PHP. I am a big time fan of Netbeans and I left it a few days after it's release of 6.7. It was so good, heavenly, yummy but I had to leave this old pal because of it's extreme hunger to the available resources. [...] I left Netbeans and started using PhpStorm. I have a company license and I am glad that I made this move. I am not going to preach PhpStorm in rest of this article, but what I will do is sharing my experience with PhpStorm. He goes through a list of his favorite things about the IDE - its speed it operates at overall, great Javascript/HTML intellisense, version control integration, less resource intensive and that it costs less overall (and comes from a "developer friendly" company). If you're interested in trying out PHPStorm for yourself, you can find a demo at http://www.jetbrains.com/phpstorm.
Hasin Hayder's Blog: Getting comfy with PhpStorm - one of the best IDEs so far!
Hasin Haydertalks about "getting comfy with PHPStorm" a relatively recent addition to the IDE ranks for PHP. I am a big time fan of Netbeans and I left it a few days after it's release of 6.7. It was so good, heavenly, yummy but I had to leave this old pal because of it's extreme hunger to the available resources. [...] I left Netbeans and started using PhpStorm. I have a company license and I am glad that I made this move. I am not going to preach PhpStorm in rest of this article, but what I will do is sharing my experience with PhpStorm. He goes through a list of his favorite things about the IDE - its speed it operates at overall, great Javascript/HTML intellisense, version control integration, less resource intensive and that it costs less overall (and comes from a "developer friendly" company). If you're interested in trying out PHPStorm for yourself, you can find a demo at http://www.jetbrains.com/phpstorm.
2012-01-02 19:43:
PHPMaster.com has a recent tutorial showing how to use the built-in Imagick extension to watermark your images effectively. It talks about what makes a good watermark and how to superimpose one on your images with a bit of sample code. Imagine a friend of yours approaches you one day and would like you to build her a website so she can showcase her photography. She wants to be able to easily upload her photographs and have them watermarked so that people can't easily steal them. "Don't worry!" you tell her, because you know there are functions provided by the Imagick extension that makes watermarking images a breeze in PHP. He talks about things like watermark transparency, the size of it (how much of the image you want it to cover) and the contrast of the watermark image to make it stand out from the image enough to be useful. Their example image and script puts the PHPMaster.com logo over the center of the image and includes a bit of code showing how to scale the watermark image to fit the image (this versus this.
PHPMaster.com: Watermarking Images
PHPMaster.com has a recent tutorial showing how to use the built-in Imagick extension to watermark your images effectively. It talks about what makes a good watermark and how to superimpose one on your images with a bit of sample code. Imagine a friend of yours approaches you one day and would like you to build her a website so she can showcase her photography. She wants to be able to easily upload her photographs and have them watermarked so that people can't easily steal them. "Don't worry!" you tell her, because you know there are functions provided by the Imagick extension that makes watermarking images a breeze in PHP. He talks about things like watermark transparency, the size of it (how much of the image you want it to cover) and the contrast of the watermark image to make it stand out from the image enough to be useful. Their example image and script puts the PHPMaster.com logo over the center of the image and includes a bit of code showing how to scale the watermark image to fit the image (this versus this.
2012-01-02 18:02:
In this new post, Sameer Borate shows you how to use his Amazon BrowseNodes script to work with the returned data from the Amazon Advertising API. The BrowseNodes tool automatically gets all the child BrowseNodes and their names. The program recursively traverses the BrowserNode hierarchy and returns all the BrowseNodes and their respective names. You can display the nodes on the console or save it to a CSV file. You can also include the library in your existing projects to process BrowseNodes. You'll need curl support on your system to make it work. Several code examples are included showing how to grab a certain node, showing a list of nodes, saving the node information to a CSV, changing locales and getting the parent node for the current node.
Sameer Borate's Blog: Amazon Advertising API BrowseNodes
In this new post, Sameer Borate shows you how to use his Amazon BrowseNodes script to work with the returned data from the Amazon Advertising API. The BrowseNodes tool automatically gets all the child BrowseNodes and their names. The program recursively traverses the BrowserNode hierarchy and returns all the BrowseNodes and their respective names. You can display the nodes on the console or save it to a CSV file. You can also include the library in your existing projects to process BrowseNodes. You'll need curl support on your system to make it work. Several code examples are included showing how to grab a certain node, showing a list of nodes, saving the node information to a CSV, changing locales and getting the parent node for the current node.
2012-01-02 16:32:
Kenny Katzgrau has a new post with the top ten Sparks (CodeIgniter packages) for the year of 2011: It's a moderately simple app that provides a vehicle for quickly dropping other developers' code in your codebase. Many of the packages on GetSparks are very well maintained. I am continually impressed by the amount of effort spark developers pour into their submissions when I peruse the site and try new packages out. [...] GetSparks has almost clocked 50,000 package downloads at this point, but there are handful of sparks that have really stood out in terms of popularity. Packages in the top ten list by popularity include (in no particular order) php-activerecord, template, gravatar_helper and markdown. He also thanks a few of the folks that have made the GetSparks.org site what it is.
Kenny Katzgrau's Blog: The Top 10 CodeIgniter Sparks of 2011
Kenny Katzgrau has a new post with the top ten Sparks (CodeIgniter packages) for the year of 2011: It's a moderately simple app that provides a vehicle for quickly dropping other developers' code in your codebase. Many of the packages on GetSparks are very well maintained. I am continually impressed by the amount of effort spark developers pour into their submissions when I peruse the site and try new packages out. [...] GetSparks has almost clocked 50,000 package downloads at this point, but there are handful of sparks that have really stood out in terms of popularity. Packages in the top ten list by popularity include (in no particular order) php-activerecord, template, gravatar_helper and markdown. He also thanks a few of the folks that have made the GetSparks.org site what it is.
2011-12-30 20:11:
Richard McIntyre has a new post to his blog showing how he set up OAuth support in a Lithium-based application with the help of a handy plugin (li3_oath). The OAuth protocol is a fantastic way to login to remote services and websites. Unfortunately the spec is different in OAuth 1.0 and the yet un-solidified 2.0, the implementation is also different across different services. At the moment this is a bit of a goose chase, but libraries like li3_oauth can help! [...] I like to be in control and calling the shots! I also want to have users have the option to login to other services under the same umbrella. Working directly with OAuth is what I wanted to do. Of course I was doing this in Lithium because it is clearly the best PHP Framework! His process is broken up into four steps: Grab the latest version of the li3_oauth plugin Fork and refactor the plugin Create the Tweet and Facebook controllers Refactor a bit more to turn it into a service The code changes are pretty minimal and are included in the post.
Richard McIntyre's Blog: Using OAuth in Lithium
Richard McIntyre has a new post to his blog showing how he set up OAuth support in a Lithium-based application with the help of a handy plugin (li3_oath). The OAuth protocol is a fantastic way to login to remote services and websites. Unfortunately the spec is different in OAuth 1.0 and the yet un-solidified 2.0, the implementation is also different across different services. At the moment this is a bit of a goose chase, but libraries like li3_oauth can help! [...] I like to be in control and calling the shots! I also want to have users have the option to login to other services under the same umbrella. Working directly with OAuth is what I wanted to do. Of course I was doing this in Lithium because it is clearly the best PHP Framework! His process is broken up into four steps: Grab the latest version of the li3_oauth plugin Fork and refactor the plugin Create the Tweet and Facebook controllers Refactor a bit more to turn it into a service The code changes are pretty minimal and are included in the post.
2011-12-30 19:53:
In response to some of the comments being made about the hash table Denial of Service attack recently posted Freek Lijten has posted his thoughts about the real problem with the whole situation - how it was handled by the communities involved. Interesting they may be, but I want to address what in my opinion is the real problem: The way the communication around it was handled by different projects and the fact that the exploit could still exist at all. [...] In the presentation Wälde and Klink talk about their disclosure process. The PHP project had them wait 3 weeks for a first response while this is obviously a serious matter. He argues that things like a commit message mentioning a DoS prevention fix instead of just mentioning the fix have the potential to do more harm than good. He also points out that other communities were notified of the problem (like Python) and some still haven't responded to the issue. This attack was the result of good research and it is important that it is disclosed. More importantly however is the fact that organisation got by with years of not noticing it and even worse, reacted very poor after being informed. I can't say I have a ready solution to avoid these kind of things in the future, perhaps that will prove to be an interesting discussion.
Freek Lijten's Blog: The real problem of the hash table dos attack
In response to some of the comments being made about the hash table Denial of Service attack recently posted Freek Lijten has posted his thoughts about the real problem with the whole situation - how it was handled by the communities involved. Interesting they may be, but I want to address what in my opinion is the real problem: The way the communication around it was handled by different projects and the fact that the exploit could still exist at all. [...] In the presentation Wälde and Klink talk about their disclosure process. The PHP project had them wait 3 weeks for a first response while this is obviously a serious matter. He argues that things like a commit message mentioning a DoS prevention fix instead of just mentioning the fix have the potential to do more harm than good. He also points out that other communities were notified of the problem (like Python) and some still haven't responded to the issue. This attack was the result of good research and it is important that it is disclosed. More importantly however is the fact that organisation got by with years of not noticing it and even worse, reacted very poor after being informed. I can't say I have a ready solution to avoid these kind of things in the future, perhaps that will prove to be an interesting discussion.
2011-12-30 18:06:
On the Sankuru blog there's a recent post looking at the construction of a simple bytecode compiler with a virtual machine as written in PHP (for Expression Language). In my previous blog posts, I demonstrated how we can use the builtin PCRE library, to create a lexer in Php. I also showed how to use Bison-generated LALR1 parser tables in Php. In this blog post, I will re-use these lexing and parsing facilities to compile EL programs from within Php. He uses his lexer/parser (available for download) in an example program that outputs some values and does some simple mathematical operations. There's sections detailing the Bison grammar used, execution stacks, callbacks and the bytecode it produces.
Sankuru Blog: A simple bytecode compiler with virtual machine, written in Php, for the EL language
On the Sankuru blog there's a recent post looking at the construction of a simple bytecode compiler with a virtual machine as written in PHP (for Expression Language). In my previous blog posts, I demonstrated how we can use the builtin PCRE library, to create a lexer in Php. I also showed how to use Bison-generated LALR1 parser tables in Php. In this blog post, I will re-use these lexing and parsing facilities to compile EL programs from within Php. He uses his lexer/parser (available for download) in an example program that outputs some values and does some simple mathematical operations. There's sections detailing the Bison grammar used, execution stacks, callbacks and the bytecode it produces.
2011-12-30 17:28:
In a new post to his blog Henrik Bjørnskov has a tip on preventing cross-site request forgeries in your Symfony2 forms with the help of a simple Symfony2 configuration setting. When talking with @jmikola on #Symfony-dev this afternoon we got into the subject of cross site request forgery and symfony2 login forms. And it seems that form-login already supports this but neither of us knew how it worked. So here is another quick tip. This time about securing you login form from cross site attacks. The key is to define a "csrf_provider" in your security.yml config file and point it to the "form.csrf_provider" provider. He also includes the controller and view code/templating you'll need to get the token included in the form (and validated).
Henrik Bjørnskov's Blog: Symfony2: Add Cross Site Request Forgery protection to login forms
In a new post to his blog Henrik Bjørnskov has a tip on preventing cross-site request forgeries in your Symfony2 forms with the help of a simple Symfony2 configuration setting. When talking with @jmikola on #Symfony-dev this afternoon we got into the subject of cross site request forgery and symfony2 login forms. And it seems that form-login already supports this but neither of us knew how it worked. So here is another quick tip. This time about securing you login form from cross site attacks. The key is to define a "csrf_provider" in your security.yml config file and point it to the "form.csrf_provider" provider. He also includes the controller and view code/templating you'll need to get the token included in the form (and validated).
2011-12-30 16:56:
As the conference season for next year gets closer, several conferences have opened their Call for Papers. A few of them have deadlines coming up soon, so don't forget the following important dates if you'd like to submit! php|tek 2012 - ends December 31st, 2011 (tomorrow!) Dutch PHP Conference - ends January 31st, 2012 phpDay Italy - ends February 28th, 2012 Be sure to submit while there's still time! Thanks to Thijs Feryn for the reminder!
Community News: Conference Call for Papers Reminders!
As the conference season for next year gets closer, several conferences have opened their Call for Papers. A few of them have deadlines coming up soon, so don't forget the following important dates if you'd like to submit! php|tek 2012 - ends December 31st, 2011 (tomorrow!) Dutch PHP Conference - ends January 31st, 2012 phpDay Italy - ends February 28th, 2012 Be sure to submit while there's still time! Thanks to Thijs Feryn for the reminder!
2011-12-30 15:30:
In this quick new post to his blog Mark Story talks about two new errors he ran across when upgrading his installation to PHP 5.4, both showing up under E_ALL. I've been running the PHP5.4 RC builds for the last few months, and there are some interesting changes in the upcoming PHP release. On top of all the great new features coming in PHP5.4. After updating to PHP5.4-RC4, a few things that used to not trigger errors and silently do the wrong thing, now trigger notices or warnings. The two he mentions deal with a new warning on illegal string offsets and the other about string offsets ("Notice: String offset cast occurred"). You can find out about more changes in the PHP 5.4 series in the various Changelogs for each Release Candidate and beta release.
Mark Story's Blog: New errors in PHP 5.4
In this quick new post to his blog Mark Story talks about two new errors he ran across when upgrading his installation to PHP 5.4, both showing up under E_ALL. I've been running the PHP5.4 RC builds for the last few months, and there are some interesting changes in the upcoming PHP release. On top of all the great new features coming in PHP5.4. After updating to PHP5.4-RC4, a few things that used to not trigger errors and silently do the wrong thing, now trigger notices or warnings. The two he mentions deal with a new warning on illegal string offsets and the other about string offsets ("Notice: String offset cast occurred"). You can find out about more changes in the PHP 5.4 series in the various Changelogs for each Release Candidate and beta release.
2011-12-30 14:09:
Popular posts from PHPDeveloper.org for the past week:Joshua Thijssen's Blog: php 5.4 + htrouter: Your personal Apache 2.2 compatible server DZone.com: Social Comparison of PHP Frameworks Tales of a Coder: What are the Essential PHP/Javascript/Web Development Feeds? Leasewebs Labs: Painless (well, less painful) migration to Symfony2 Smashing Magazine: Create A Christmas Wish List With PHP (For Beginners) Nikita Popov's Blog: Don't be STUPID: GRASP SOLID! NetTuts.com: Ten New Year's Resolutions Every Web Developer Should Make Henrik Bjørnskov' Blog: Symfony2: Quick tip for your security configuration Nikita Popov's Blog: Supercolliding a PHP array Community News: PHP Advent 2011 is Complete!
Site News: Popular Posts for the Week of 12.30.2011
Popular posts from PHPDeveloper.org for the past week:Joshua Thijssen's Blog: php 5.4 + htrouter: Your personal Apache 2.2 compatible server DZone.com: Social Comparison of PHP Frameworks Tales of a Coder: What are the Essential PHP/Javascript/Web Development Feeds? Leasewebs Labs: Painless (well, less painful) migration to Symfony2 Smashing Magazine: Create A Christmas Wish List With PHP (For Beginners) Nikita Popov's Blog: Don't be STUPID: GRASP SOLID! NetTuts.com: Ten New Year's Resolutions Every Web Developer Should Make Henrik Bjørnskov' Blog: Symfony2: Quick tip for your security configuration Nikita Popov's Blog: Supercolliding a PHP array Community News: PHP Advent 2011 is Complete!
2011-12-29 19:15:
In a new post to his blog Nikita Popov talks about a little trick with inserting values into arrays that can make it take a lot longer than it should (because of how PHP stores its array values in hashtables). PHP internally uses hashtables to store arrays. The above creates a hashtable with 100% collisions (i.e. all keys will have the same hash). [...] Because every hash function has collisions this C array doesn't actually store the value we want, but a linked list of possible values. [...] Normally there will be only a small number of collisions, so in most cases the linked list will only have one value. But the [included script] creates a hash where all elements collide. He explains why it works, noting that it's relatively simple to do in PHP because of how it applies a table mask. The slowness comes in when PHP is forced to go through the entire list when it tries to insert. Because of this issue, there's the potential for a Denial of Service attack that could potentially take a server down. There's a fix already in place for the problem, though, so keep an eye out for the next release (that will include a max_input_vars setting to prevent it).
Nikita Popov's Blog: Supercolliding a PHP array
In a new post to his blog Nikita Popov talks about a little trick with inserting values into arrays that can make it take a lot longer than it should (because of how PHP stores its array values in hashtables). PHP internally uses hashtables to store arrays. The above creates a hashtable with 100% collisions (i.e. all keys will have the same hash). [...] Because every hash function has collisions this C array doesn't actually store the value we want, but a linked list of possible values. [...] Normally there will be only a small number of collisions, so in most cases the linked list will only have one value. But the [included script] creates a hash where all elements collide. He explains why it works, noting that it's relatively simple to do in PHP because of how it applies a table mask. The slowness comes in when PHP is forced to go through the entire list when it tries to insert. Because of this issue, there's the potential for a Denial of Service attack that could potentially take a server down. There's a fix already in place for the problem, though, so keep an eye out for the next release (that will include a max_input_vars setting to prevent it).
2011-12-29 18:58:
As is mentioned in this new post to the Seabourne site by Mike Reich, the FCC (Federal Communications Commission) has launched their new portal, MyFcc (beta). The Seaborne post talks about the technology they used to create this widget-based dashboard. MyFCC is a personalized dashboard for power users that provides a simple way to access a broad range of content coming out of the agency. MyFCC content is powered by the Content API module, and is built using our very own Cumula Framework. The site is based on an API the FCC provides and makes it simpler to hone it down to just the information you need. MyFCC is a new approach to open government - making the content easily available to everyone, everywhere via APIs. Using the Content APIs, the public can create their own tools like MyFCC. You can find out more about the launch of MyFcc in this official press release.
Project: PHP-Powered MyFcc.gov Portal Launches (Beta)
As is mentioned in this new post to the Seabourne site by Mike Reich, the FCC (Federal Communications Commission) has launched their new portal, MyFcc (beta). The Seaborne post talks about the technology they used to create this widget-based dashboard. MyFCC is a personalized dashboard for power users that provides a simple way to access a broad range of content coming out of the agency. MyFCC content is powered by the Content API module, and is built using our very own Cumula Framework. The site is based on an API the FCC provides and makes it simpler to hone it down to just the information you need. MyFCC is a new approach to open government - making the content easily available to everyone, everywhere via APIs. Using the Content APIs, the public can create their own tools like MyFCC. You can find out more about the launch of MyFcc in this official press release.
2011-12-29 17:06:
DevShed has a new tutorial posted today looking to help you counteract the bad practice of wrapping procedural code in "class" constructs and provide some useful suggestions of how to avoid it. Static helpers seem to be a great idea at first glance, as they're reusable components that don't require any kind of expensive instantiation for doing common tasks [...]. But the sad and unavoidable truth is in many cases they're simply wrappers for procedural code, which has been elegantly hidden behind a "class" construct. So what's wrong with this? Well, even in the most harmless situations, when you use a static helper that produces a deterministic output, you're actually throwing away the advantages that OOP provides. To illustrate, they create a basic validation class that can check for things like valid emails, float values, integers and URLs using PHP's filter_var function. They point out that the class is difficult to extend and that it is doing too many things to be correctly considered a "piece" of functionality. To correct the problem, they opt for a different approach - an abstract class acting as an interface to structure custom validators against. This provides set/get methods for things like the error message and value to evaluate. The implementation of the validators on top of this class is coming in the next part of the series.
DevShed: Effects of Wrapping Code in Class Constructs
DevShed has a new tutorial posted today looking to help you counteract the bad practice of wrapping procedural code in "class" constructs and provide some useful suggestions of how to avoid it. Static helpers seem to be a great idea at first glance, as they're reusable components that don't require any kind of expensive instantiation for doing common tasks [...]. But the sad and unavoidable truth is in many cases they're simply wrappers for procedural code, which has been elegantly hidden behind a "class" construct. So what's wrong with this? Well, even in the most harmless situations, when you use a static helper that produces a deterministic output, you're actually throwing away the advantages that OOP provides. To illustrate, they create a basic validation class that can check for things like valid emails, float values, integers and URLs using PHP's filter_var function. They point out that the class is difficult to extend and that it is doing too many things to be correctly considered a "piece" of functionality. To correct the problem, they opt for a different approach - an abstract class acting as an interface to structure custom validators against. This provides set/get methods for things like the error message and value to evaluate. The implementation of the validators on top of this class is coming in the next part of the series.
2011-12-29 16:41:
On PHPMaster.com today there's a new post showing you how to write custom session handlers - in their case, a database-based option that can span across multiple servers/services. Sessions are a tool which helps the web programmer overcome the stateless nature of the internet. You can use them to build shopping carts, monitor visits to a website, and even track how a user navigates through your application. PHP's default session handling behavior can provide all you need in most cases, but there may be times when you want to expand the functionality and store session data differently. This article will show you how the default functionality works and then goes on to show you how override it to provide a custom solution. They introduce how sessions are stored normally (based on the save path) and what the serialized contents of it would look like. They show you how to take this, normally stored on the local file system, and change it to be written to a "session" table in a MySQL database (via PDO). It includes reading, writing, updating and some garbage collection to clean out old values from the table.
PHPMaster.com: Writing Custom Session Handlers
On PHPMaster.com today there's a new post showing you how to write custom session handlers - in their case, a database-based option that can span across multiple servers/services. Sessions are a tool which helps the web programmer overcome the stateless nature of the internet. You can use them to build shopping carts, monitor visits to a website, and even track how a user navigates through your application. PHP's default session handling behavior can provide all you need in most cases, but there may be times when you want to expand the functionality and store session data differently. This article will show you how the default functionality works and then goes on to show you how override it to provide a custom solution. They introduce how sessions are stored normally (based on the save path) and what the serialized contents of it would look like. They show you how to take this, normally stored on the local file system, and change it to be written to a "session" table in a MySQL database (via PDO). It includes reading, writing, updating and some garbage collection to clean out old values from the table.
2011-12-29 15:21:
On Dzone.com today Giorgio Sironi has posted what he considers to be some of the most popular Open Source PHP projects of 2011 including Symfony2, Doctrine and HipHop. This non-scientific analysis of the popular and exciting PHP projects starts from researches on active projects on SourceForge and GitHub; the latter is where most of the collaboration and involvement of PHP developers is today. I've also crowdsourced the question on Twitter to catch projects I wasn't aware of, and I hope to do the same with you. Other projects included in his list are: Symfony2 Components Moodle Composer and Packagist Drupal, Joomla, Wordpress Have a project you think he missed? Let him know!
Dzone.com: Open source PHP projects of 2011
On Dzone.com today Giorgio Sironi has posted what he considers to be some of the most popular Open Source PHP projects of 2011 including Symfony2, Doctrine and HipHop. This non-scientific analysis of the popular and exciting PHP projects starts from researches on active projects on SourceForge and GitHub; the latter is where most of the collaboration and involvement of PHP developers is today. I've also crowdsourced the question on Twitter to catch projects I wasn't aware of, and I hope to do the same with you. Other projects included in his list are: Symfony2 Components Moodle Composer and Packagist Drupal, Joomla, Wordpress Have a project you think he missed? Let him know!
2011-12-28 18:35:
Joshua Thijssen has shared a handy tip for those using Zend Server on a pupptet-ed server - using a Facter plugin to check for the ZS install and only install what's needed (rather than end up with multiple PHP installs). This means you should not install the default PHP package for your distribution when the distribution also runs on Zend Server. This Facter plugin will allow you to use the $zendserver fact inside your own manifests to check if Zend server is installed, so you can take measures against installing stuff that is taken care of by ZendServer itself. You can download the plugin from his github account, https://github.com/jaytaph/puppet-facter-zendserver, and easily install it into your puppet setup.
Joshua Thijssen's Blog: Facter: Zend Server
Joshua Thijssen has shared a handy tip for those using Zend Server on a pupptet-ed server - using a Facter plugin to check for the ZS install and only install what's needed (rather than end up with multiple PHP installs). This means you should not install the default PHP package for your distribution when the distribution also runs on Zend Server. This Facter plugin will allow you to use the $zendserver fact inside your own manifests to check if Zend server is installed, so you can take measures against installing stuff that is taken care of by ZendServer itself. You can download the plugin from his github account, https://github.com/jaytaph/puppet-facter-zendserver, and easily install it into your puppet setup.
2011-12-28 17:07:
On the "Tales of a Coder" blog today there's a new post trying to gather some of the more popular web resources for PHP, Javascript and general web development and provide a set of links to make them easier to get to. What feeds do the super star PHP/ JavaScript web developers subscribe to? What are the essential PHP/ JavaScript/ Web Development feeds? I have shared my fledgling list below. Many of these feeds were recommended by my friends at PHPWomen, others I somehow stumbled across myself and some I picked up from articles tweeted with the #linktuesday hashtag, which are aggregated here. So far, the links include php|architect, Planet-PHP.net, the YUI blog, Matt Gemmell's blog and Evan Goer's blog. If you have others to share, be sure to leave them in the comments!
Tales of a Coder: What are the Essential PHP/Javascript/Web Development Feeds?
On the "Tales of a Coder" blog today there's a new post trying to gather some of the more popular web resources for PHP, Javascript and general web development and provide a set of links to make them easier to get to. What feeds do the super star PHP/ JavaScript web developers subscribe to? What are the essential PHP/ JavaScript/ Web Development feeds? I have shared my fledgling list below. Many of these feeds were recommended by my friends at PHPWomen, others I somehow stumbled across myself and some I picked up from articles tweeted with the #linktuesday hashtag, which are aggregated here. So far, the links include php|architect, Planet-PHP.net, the YUI blog, Matt Gemmell's blog and Evan Goer's blog. If you have others to share, be sure to leave them in the comments!
2011-12-28 16:26:
Nikita Popov talks about the SOLID coding practices and creates his own acronym for the complete opposite - STUPID (Singleon, Tight coupling, Untestable, Premature optimization, Indescriptive naming, Duplication). Ever heard of SOLID code? Probably: It is a term describing a collection of design principles for "good code" that was coined by Robert C. Martin (aka "uncle bob"), our beloved evangelist of clean code. [...] So, why not approach the problem from the other side for once? Looking at what makes up bad code. He goes through each part of his STUPID acronym and talks about how it can hurt your code and a few alternatives to help make your application more flexible and easier to maintain in the long run. He also mentions GRASP (General Responsibility Assignment Software Principles), another set of good practices to follow, some similar to SOLID, that can make your app better.
Nikita Popov's Blog: Don't be STUPID: GRASP SOLID!
Nikita Popov talks about the SOLID coding practices and creates his own acronym for the complete opposite - STUPID (Singleon, Tight coupling, Untestable, Premature optimization, Indescriptive naming, Duplication). Ever heard of SOLID code? Probably: It is a term describing a collection of design principles for "good code" that was coined by Robert C. Martin (aka "uncle bob"), our beloved evangelist of clean code. [...] So, why not approach the problem from the other side for once? Looking at what makes up bad code. He goes through each part of his STUPID acronym and talks about how it can hurt your code and a few alternatives to help make your application more flexible and easier to maintain in the long run. He also mentions GRASP (General Responsibility Assignment Software Principles), another set of good practices to follow, some similar to SOLID, that can make your app better.
2011-12-28 15:55:
The latest version of PHP in the 5.4.0 release candidate series has been posted - PHP 5.4.0 RC4, complete with new features and lots of bugfixes. The PHP development team is proud to announce the 4th release candidate of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. THIS IS A RELEASE CANDIDATE - DO NOT USE IT IN PRODUCTION! This is the 4th release candidate. The release candidate phase is intended as a period of bug fixing prior to the stable release. No new features should be included before the final version of PHP 5.4.0. Updates in this release candidate include an update to the max_input_vars directive and a fix for a segfault in the traits code. You can find the full notes for the release in the NEWS file and can download the latest from the PHP.net site - source downloads, Windows binaries.
PHP.net: PHP 5.4.0RC4 Released!
The latest version of PHP in the 5.4.0 release candidate series has been posted - PHP 5.4.0 RC4, complete with new features and lots of bugfixes. The PHP development team is proud to announce the 4th release candidate of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. THIS IS A RELEASE CANDIDATE - DO NOT USE IT IN PRODUCTION! This is the 4th release candidate. The release candidate phase is intended as a period of bug fixing prior to the stable release. No new features should be included before the final version of PHP 5.4.0. Updates in this release candidate include an update to the max_input_vars directive and a fix for a segfault in the traits code. You can find the full notes for the release in the NEWS file and can download the latest from the PHP.net site - source downloads, Windows binaries.
2011-12-27 20:20:
NetTuts.com has posted their list of what they think should be New Year's resolutions for every developer: In less than a week, we'll be in 2012. I know it's a cliché, but where has the year gone? Naturally, we're now at the time of year when folks set goals for the new year. While you might have some goals for your "real" life, how about a few resolutions for your developer life? Suggestions include: Get Better At What You Know Engage the Community Take Better Care Of Yourself Use Better Programming Practices Take a Break
NetTuts.com: Ten New Year's Resolutions Every Web Developer Should Make
NetTuts.com has posted their list of what they think should be New Year's resolutions for every developer: In less than a week, we'll be in 2012. I know it's a cliché, but where has the year gone? Naturally, we're now at the time of year when folks set goals for the new year. While you might have some goals for your "real" life, how about a few resolutions for your developer life? Suggestions include: Get Better At What You Know Engage the Community Take Better Care Of Yourself Use Better Programming Practices Take a Break
2011-12-27 17:39:
On Reddit.com there's a recent post asking about testing developers as a part of the hiring process and how difficult it should be. I developed an exercise for applicants. They must use an open source framework to make a simple bulletin board. It requires account creation, login, thread creation, message creation, unread message indication per thread, and logout. Every applicant is given this exercise after passing an initial test. The initial test is a simple disqualifier and is not challenging for anyone not lying on their resume. There's some great discussion in the comments about things like the suggested time limit, opinions on other methods that could yield the same results, thoughts on the validity of even taking the test based on the level of the job. The popular opinion, though, is that it's too much work for an applicant to go through unless there's a very specific need. As one commentor put it: Most of the excellent programmers will have jobs. Those that don't will probably have several options (unless you're in a very small market) for where to work. When it comes down to applying to the place that wants you to spend a bunch of your own time on their application, or some other company... They'll go with some other company.
Reddit.com: Am I asking too much from my PHP applicant exercise?
On Reddit.com there's a recent post asking about testing developers as a part of the hiring process and how difficult it should be. I developed an exercise for applicants. They must use an open source framework to make a simple bulletin board. It requires account creation, login, thread creation, message creation, unread message indication per thread, and logout. Every applicant is given this exercise after passing an initial test. The initial test is a simple disqualifier and is not challenging for anyone not lying on their resume. There's some great discussion in the comments about things like the suggested time limit, opinions on other methods that could yield the same results, thoughts on the validity of even taking the test based on the level of the job. The popular opinion, though, is that it's too much work for an applicant to go through unless there's a very specific need. As one commentor put it: Most of the excellent programmers will have jobs. Those that don't will probably have several options (unless you're in a very small market) for where to work. When it comes down to applying to the place that wants you to spend a bunch of your own time on their application, or some other company... They'll go with some other company.
2011-12-27 16:14:
On his "MySQL Talk" blog Joe Devon has posted a (very) belated wrapup of ZendCon 2011 he attended earlier this year. I started writing a Zendcon recap post as soon as I got back. And then mis-timed a couple projects. Note to freelancers, make sure your new gig starts AFTER your old gig is over. Or you'll be working an insane schedule. Hence the lateness... First the good part. What made Zendcon special. He notes that it was a great opportunity to meet people "in real life" that he'd only spoken with online and the overall wonderful experience it was. He mentions some specific people in the PHP community including Juozas Kaziukenas, Daniel Cousineau, some impromptu singing of Queen songs and many more (too many to name here). He also mentions some of the sessions attended including the tutorial on Zend Framework and an uncon talk from Ilia Alshanetsky about optimization.
Joe Devon's Blog: Belated Zendcon 2011 Recap
On his "MySQL Talk" blog Joe Devon has posted a (very) belated wrapup of ZendCon 2011 he attended earlier this year. I started writing a Zendcon recap post as soon as I got back. And then mis-timed a couple projects. Note to freelancers, make sure your new gig starts AFTER your old gig is over. Or you'll be working an insane schedule. Hence the lateness... First the good part. What made Zendcon special. He notes that it was a great opportunity to meet people "in real life" that he'd only spoken with online and the overall wonderful experience it was. He mentions some specific people in the PHP community including Juozas Kaziukenas, Daniel Cousineau, some impromptu singing of Queen songs and many more (too many to name here). He also mentions some of the sessions attended including the tutorial on Zend Framework and an uncon talk from Ilia Alshanetsky about optimization.
2011-12-27 15:40:
Henrik Bjørnskov has a quick new post with a security tip for those using the Symfony2 framework in its configuration. Earlier when playing around with the Security component and SecurityBundle i found that for all paths you can specify a route name and the component will match it when check for the request paths. Setting this up in your configuration gives you more control over the paths that are matched as well as more flexibility in defining them. He includes a note about a change you might have to make to the SecurityBundle's code to get the "check_path" part working correctly. You can find out more about the SecurityBundle's integration in this blog post from Pablo Bandin.
Henrik Bjørnskov' Blog: Symfony2: Quick tip for your security configuration
Henrik Bjørnskov has a quick new post with a security tip for those using the Symfony2 framework in its configuration. Earlier when playing around with the Security component and SecurityBundle i found that for all paths you can specify a route name and the component will match it when check for the request paths. Setting this up in your configuration gives you more control over the paths that are matched as well as more flexibility in defining them. He includes a note about a change you might have to make to the SecurityBundle's code to get the "check_path" part working correctly. You can find out more about the SecurityBundle's integration in this blog post from Pablo Bandin.
2011-12-27 14:04:
Latest PECL Releases: yaf 2.1.4 hidef 0.1.11 yaf 2.1.5
Community News: Latest PECL Releases for 12.27.2011
Latest PECL Releases: yaf 2.1.4 hidef 0.1.11 yaf 2.1.5
2011-12-26 23:20:
This year's PHP Advent calendar has finished up and if you haven't gotten a chance to check out some of the great content in this year's edition, be sure to take a look at the full list. It incudes topics like: Front-end testing with SimpleTest Scalable applications Cross-origin ajax working with Chef Error handling Dates and Times The articles are by several well-knowns both in the PHP community and outside. While you're there, be sure to check out some of the previous years too!
Community News: PHP Advent 2011 is Complete!
This year's PHP Advent calendar has finished up and if you haven't gotten a chance to check out some of the great content in this year's edition, be sure to take a look at the full list. It incudes topics like: Front-end testing with SimpleTest Scalable applications Cross-origin ajax working with Chef Error handling Dates and Times The articles are by several well-knowns both in the PHP community and outside. While you're there, be sure to check out some of the previous years too!
2011-12-26 22:38:
On PHPMaster.com today James Appleyard has put tother a tutorial for the beginners out there about working with strings in PHP, using the huge list of built-in functions to work with your values. PHP has a vast selection of built-in string handling functions that allow you to easily manipulate strings in almost any possible way. [...] There is no way I can cover every string function in one article, and besides, that is what the PHP manual is for! But what I will do is show how to work with some of the most commonly used string handling functions that you should know. After this, you'll be working with strings as well as any concert violinist! He shows how to use functions to: change the case of string, remove extra whitespace, get the length, slicing them up and doing replacing on some certain characters. You can find more information on these and the complete list of string functions in PHP in the manual.
PHPMaster.com: String Handling Functions
On PHPMaster.com today James Appleyard has put tother a tutorial for the beginners out there about working with strings in PHP, using the huge list of built-in functions to work with your values. PHP has a vast selection of built-in string handling functions that allow you to easily manipulate strings in almost any possible way. [...] There is no way I can cover every string function in one article, and besides, that is what the PHP manual is for! But what I will do is show how to work with some of the most commonly used string handling functions that you should know. After this, you'll be working with strings as well as any concert violinist! He shows how to use functions to: change the case of string, remove extra whitespace, get the length, slicing them up and doing replacing on some certain characters. You can find more information on these and the complete list of string functions in PHP in the manual.
2011-12-26 21:11:
Michelangelo van Dam has a new post to his blog today about the Microsoft Hackathon happening at this year's PHPBenelux conference with reps from Microsoft in attendance. Even if you have no knowledge of any of Microsoft's PHP solutions you're more then happy to join us and see how you can build applications so they can be distributed with the
Michelangelo van Dam's Blog: Microsoft Hackathon at PHPBenelux Conference 2012
Michelangelo van Dam has a new post to his blog today about the Microsoft Hackathon happening at this year's PHPBenelux conference with reps from Microsoft in attendance. Even if you have no knowledge of any of Microsoft's PHP solutions you're more then happy to join us and see how you can build applications so they can be distributed with the
2011-12-26 19:46:
John Adell has posted a quick start guide to getting your application up and running on the PHPFog PHP platform as a service offering. Being it was Christmas and all, I decided to give myself a present and sign up. I was very surprised by how easy it was to get up and running. I managed to build a simple "echo" service in about 8 minutes, following roughly these steps. It was as simple as "launching" a new custom application, waiting for it to become available, cloning the git repository and setting up a simple app. In his case , it's a basic Silex-based app that makes a simple site to greet users with a "Hello world" message. Throw in a basic .htaccess file and the app is all set to push.
John Adell's Blog: PHP Fog Quickstart
John Adell has posted a quick start guide to getting your application up and running on the PHPFog PHP platform as a service offering. Being it was Christmas and all, I decided to give myself a present and sign up. I was very surprised by how easy it was to get up and running. I managed to build a simple "echo" service in about 8 minutes, following roughly these steps. It was as simple as "launching" a new custom application, waiting for it to become available, cloning the git repository and setting up a simple app. In his case , it's a basic Silex-based app that makes a simple site to greet users with a "Hello world" message. Throw in a basic .htaccess file and the app is all set to push.
2011-12-26 19:46:
Josh Adell has posted a quick start guide to getting your application up and running on the PHPFog PHP platform as a service offering. Being it was Christmas and all, I decided to give myself a present and sign up. I was very surprised by how easy it was to get up and running. I managed to build a simple "echo" service in about i.8 minutes, following roughly these steps. It was as simple as "launching" a new custom application, waiting for it to become available, cloning the git repository and setting up a simple app. In his case , it's a basic Silex-based app that makes a simple site to greet users with a "Hello world" message. Throw in a basic .htaccess file and the app is all set to push.
Josh Adell's Blog: PHP Fog Quickstart
Josh Adell has posted a quick start guide to getting your application up and running on the PHPFog PHP platform as a service offering. Being it was Christmas and all, I decided to give myself a present and sign up. I was very surprised by how easy it was to get up and running. I managed to build a simple "echo" service in about i.8 minutes, following roughly these steps. It was as simple as "launching" a new custom application, waiting for it to become available, cloning the git repository and setting up a simple app. In his case , it's a basic Silex-based app that makes a simple site to greet users with a "Hello world" message. Throw in a basic .htaccess file and the app is all set to push.
2011-12-26 18:23:
Robert Basic has posted a follow up to his
Robert Basic's Blog: Listening to Dbus signals with PHP
Robert Basic has posted a follow up to his
2011-12-26 14:05:
Latest PEAR Releases: Image_Barcode2 0.2.0 Net_DNSBL 1.3.5 Services_Amazon 0.9.0 Net_DNSBL 1.3.6
Community News: Latest PEAR Releases for 12.26.2011
Latest PEAR Releases: Image_Barcode2 0.2.0 Net_DNSBL 1.3.5 Services_Amazon 0.9.0 Net_DNSBL 1.3.6
2011-12-23 18:02:
Stefan Koopmanschap has written up an article on the Leaseweblabs.com blog about migrating a Symfony 1 application to Symfony2 in a (slightly) less painful way that making the move all at once. It is much easier to do a gradual migration. Start with one part of your application, and bit by bit migrate your logic and application. The traditional way of doing such migrations is to create a new project and have parallel development on the old and the new version of the application. The problem with this, though, is that when you make a change to your old application, you have to make the same change in the new codebase, essentially doubling the amount of work for each feature you need to implement. [...] You could wrap your old application into your Symfony2 application, and have different parts of your application be handled by different versions of your codebase. With the help of a bundle he created, IngewikkeldWrapperBundle that handles the rerouting of your requests based on where the requested resource exists (in the Symfony 1 or 2 codebase).
Leasewebs Labs: Painless (well, less painful) migration to Symfony2
Stefan Koopmanschap has written up an article on the Leaseweblabs.com blog about migrating a Symfony 1 application to Symfony2 in a (slightly) less painful way that making the move all at once. It is much easier to do a gradual migration. Start with one part of your application, and bit by bit migrate your logic and application. The traditional way of doing such migrations is to create a new project and have parallel development on the old and the new version of the application. The problem with this, though, is that when you make a change to your old application, you have to make the same change in the new codebase, essentially doubling the amount of work for each feature you need to implement. [...] You could wrap your old application into your Symfony2 application, and have different parts of your application be handled by different versions of your codebase. With the help of a bundle he created, IngewikkeldWrapperBundle that handles the rerouting of your requests based on where the requested resource exists (in the Symfony 1 or 2 codebase).
2011-12-23 17:23:
In this new tutorial Smashing Magazine shows you how to create a mini "Christmas List" application with PHP, HTML and CSS (and a little bit of database help) to display a list of what you or your family wants this holiday. 'Tis the season to be jolly, and how much jollier could we make it than with a helpful Christmas wish list crafted for your family to ensure that you get maximum presentage this holiday? In this article, we will focus on creating a very simple system that allows you to add gift ideas to a Web page, and for your family (or whoever) to view the list. They walk you through the setup of the basic PHP file structure, the HTML template for the list output, CSS to make it look nice and the actual PHP backend - working with a MySQL database to pull out product information and use a simple login method.
Smashing Magazine: Create A Christmas Wish List With PHP (For Beginners)
In this new tutorial Smashing Magazine shows you how to create a mini "Christmas List" application with PHP, HTML and CSS (and a little bit of database help) to display a list of what you or your family wants this holiday. 'Tis the season to be jolly, and how much jollier could we make it than with a helpful Christmas wish list crafted for your family to ensure that you get maximum presentage this holiday? In this article, we will focus on creating a very simple system that allows you to add gift ideas to a Web page, and for your family (or whoever) to view the list. They walk you through the setup of the basic PHP file structure, the HTML template for the list output, CSS to make it look nice and the actual PHP backend - working with a MySQL database to pull out product information and use a simple login method.
2011-12-23 16:56:
In this post to DZone.com today, John Esposito points out a site that compares popular PHP frameworks socially, a collaborative resource to keep track of things like framework features, popularity and their last update. There's this wiki-ish comparison of PHP frameworks from socialcompare.com -- presently incomplete, but already containing quite a few frameworks and interesting details of each. You can add comparison criteria (rows; folksonomically) or update existing criteria -- which currently include, among other details, ORM specifics, cache storage, template system, and testing libraries. Frameworks currently covered include Zend Framework, CakePHP, Fat-Free, Symfony, Yii and Kohana. As it stands now, Yii is the most popular framework with 8 votes and Symfony and Zend Framework are tied for second with 5 points each.
DZone.com: Social Comparison of PHP Frameworks
In this post to DZone.com today, John Esposito points out a site that compares popular PHP frameworks socially, a collaborative resource to keep track of things like framework features, popularity and their last update. There's this wiki-ish comparison of PHP frameworks from socialcompare.com -- presently incomplete, but already containing quite a few frameworks and interesting details of each. You can add comparison criteria (rows; folksonomically) or update existing criteria -- which currently include, among other details, ORM specifics, cache storage, template system, and testing libraries. Frameworks currently covered include Zend Framework, CakePHP, Fat-Free, Symfony, Yii and Kohana. As it stands now, Yii is the most popular framework with 8 votes and Symfony and Zend Framework are tied for second with 5 points each.
2011-12-23 15:27:
Joshua Thijssen has a new post to his blog today about a feature of the upcoming PHP 5.4 release, the built-in web server, and a handy way to reproduce .htaccess functionality with the help of a simple PHP script - htrouter. The problem with the new PHP 5.4 internal web-server is that it isn't Apache. Thus it does not know anything about .htaccess. Even when you have defined your .htaccess to do authentication, the internal PHP web-server will ignore it, while in production, the authentication will be needed (if you will be running Apache, of course). Also, you need to reroute everything manually through your app_dev.php, so your URL's don't really match the way they will be on your production. He introduces the PHP web server quickly, just showing a sample command line call to start it up and to point it at a certain PHP file as a "boostrap". With the help of his htrouter script, though, you can use "modules" similar to those in Apache. He already has the HTTP auth stuff working and more is to come.
Joshua Thijssen's Blog: php 5.4 + htrouter: Your personal Apache 2.2 compatible server
Joshua Thijssen has a new post to his blog today about a feature of the upcoming PHP 5.4 release, the built-in web server, and a handy way to reproduce .htaccess functionality with the help of a simple PHP script - htrouter. The problem with the new PHP 5.4 internal web-server is that it isn't Apache. Thus it does not know anything about .htaccess. Even when you have defined your .htaccess to do authentication, the internal PHP web-server will ignore it, while in production, the authentication will be needed (if you will be running Apache, of course). Also, you need to reroute everything manually through your app_dev.php, so your URL's don't really match the way they will be on your production. He introduces the PHP web server quickly, just showing a sample command line call to start it up and to point it at a certain PHP file as a "boostrap". With the help of his htrouter script, though, you can use "modules" similar to those in Apache. He already has the HTTP auth stuff working and more is to come.
2011-12-23 14:00:
Popular posts from PHPDeveloper.org for the past week:PHPMaster.com: Understanding the Factory Method Design Pattern Nikic's Blog: How big are PHP arrays (and values) really? (Hint: BIG!) Reddit.com: What everyone should know about strip_tags() Zend PHP Certification Blog: PHP Sorting Functions Brian Smithwick's Blog: Software development and the locked box Nelm.io Blog: Composer: Part 2 - Impact Sebastian Bergmann's Blog: Using CLANG/scan-build for Static Analysis of the PHP Interpreter Robert Basic's Blog: Communicating with Pidgin from PHP via D-Bus Phil Sturgeon's Blog: PHP Basher Bashing PHPMaster.com: PHP's Quest for Performance: From C to hhvm
Site News: Popular Posts for the Week of 12.23.2011
Popular posts from PHPDeveloper.org for the past week:PHPMaster.com: Understanding the Factory Method Design Pattern Nikic's Blog: How big are PHP arrays (and values) really? (Hint: BIG!) Reddit.com: What everyone should know about strip_tags() Zend PHP Certification Blog: PHP Sorting Functions Brian Smithwick's Blog: Software development and the locked box Nelm.io Blog: Composer: Part 2 - Impact Sebastian Bergmann's Blog: Using CLANG/scan-build for Static Analysis of the PHP Interpreter Robert Basic's Blog: Communicating with Pidgin from PHP via D-Bus Phil Sturgeon's Blog: PHP Basher Bashing PHPMaster.com: PHP's Quest for Performance: From C to hhvm
2011-12-22 19:05:
On DZone.com John Esposito has a new post sharing two Symfony2 bundle repositories you can look to to improve your development experience with the framework - KnpBundles and Symfohub. If you're using Symfony2, you already know that the framework uses 'bundles', the equivalent of plugins, if the core counted as a plugin too. (The official documentation calls bundles 'first-class citizens' in Symfony2.) So far so great idea, but an ecosystem depends on a community, and a community needs some kind of organization. So how is the Symfony2 bundle community organized, and how do you find existing third-party bundles? KnpBundles provides a larger resource than Symfohub, but both have handy features to help you find what you're looking for - filtering, search recommendations and rankings.
Dzone.com: Two Symfony2 Bundle Repositories
On DZone.com John Esposito has a new post sharing two Symfony2 bundle repositories you can look to to improve your development experience with the framework - KnpBundles and Symfohub. If you're using Symfony2, you already know that the framework uses 'bundles', the equivalent of plugins, if the core counted as a plugin too. (The official documentation calls bundles 'first-class citizens' in Symfony2.) So far so great idea, but an ecosystem depends on a community, and a community needs some kind of organization. So how is the Symfony2 bundle community organized, and how do you find existing third-party bundles? KnpBundles provides a larger resource than Symfohub, but both have handy features to help you find what you're looking for - filtering, search recommendations and rankings.
2011-12-22 18:24:
On DevShed.com today there's the first part of a two-part series showing how to build self-contained validator objects that can be used to test the format of user input for validity. In this two-part tutorial, I show why the use of static helper classes can be detrimental to building robust and scalable object-oriented applications in PHP (though you should take into account that the concept is language agnostic). I also implement a set of instantiable, fine-grained validators, which can be easily tested in isolation, injected into the internals of other objects, and so forth. Their set of "concrete validators" are all based off of a validator interface/abstract class and check things like email formatting, floats, integers and URLs. Also included are a few examples of using the validators in a sample script.
DevShed: Building Concrete Validators
On DevShed.com today there's the first part of a two-part series showing how to build self-contained validator objects that can be used to test the format of user input for validity. In this two-part tutorial, I show why the use of static helper classes can be detrimental to building robust and scalable object-oriented applications in PHP (though you should take into account that the concept is language agnostic). I also implement a set of instantiable, fine-grained validators, which can be easily tested in isolation, injected into the internals of other objects, and so forth. Their set of "concrete validators" are all based off of a validator interface/abstract class and check things like email formatting, floats, integers and URLs. Also included are a few examples of using the validators in a sample script.
2011-12-22 17:53:
As mentioned on DZone.com, there's a video tutorial series from Andrew Perkins about setting up an authentication system in CakePHP-based applications. Here you can find the related articles to my Cakephp videos if you would prefer to read them rather than watch. You will can also download all of the source code for the corresponding videos. [...] They only include the app folder, as we'll never change anything in the other folders, at least not in these tutorials. The videos currently cover installation of the framework and some of the naming conventions to follow. The source has the full authentication system, though - all the way from setting up helper methods to creating the actual authentication component.
Andrew Perkin's Site: Cakephp Video Tutorials (Authentication)
As mentioned on DZone.com, there's a video tutorial series from Andrew Perkins about setting up an authentication system in CakePHP-based applications. Here you can find the related articles to my Cakephp videos if you would prefer to read them rather than watch. You will can also download all of the source code for the corresponding videos. [...] They only include the app folder, as we'll never change anything in the other folders, at least not in these tutorials. The videos currently cover installation of the framework and some of the naming conventions to follow. The source has the full authentication system, though - all the way from setting up helper methods to creating the actual authentication component.
2011-12-22 16:41:
Mike Willbanks has a new post to his blog about a different sort of technique for deploying PHP - building your own RPMs instead of just using the pre-packaged ones. This opens up a whole world of customization options. In the PHP world, one might ask why not just build it from source? Well, an RPM IS built from source and then distributed to many servers - we can ensure that we have the same packages on each, we can maintain the same versions and if you've read my previous post on Pirum you will know that I also like mirroring PEAR packages. He walks you through the structure of an RPM package (the spec file, with examples, and the source), the "%prep", "%build" and "%install" containers as well as where the source needs to live for things to work correctly.
Mike Willbanks' Blog: RPM Packaging - Building and Deploying your own PHP
Mike Willbanks has a new post to his blog about a different sort of technique for deploying PHP - building your own RPMs instead of just using the pre-packaged ones. This opens up a whole world of customization options. In the PHP world, one might ask why not just build it from source? Well, an RPM IS built from source and then distributed to many servers - we can ensure that we have the same packages on each, we can maintain the same versions and if you've read my previous post on Pirum you will know that I also like mirroring PEAR packages. He walks you through the structure of an RPM package (the spec file, with examples, and the source), the "%prep", "%build" and "%install" containers as well as where the source needs to live for things to work correctly.
2011-12-22 15:09:
The Dutch PHP Conference has
Community News: Dutch PHP Conference 2012 Announced (and Call for Papers Opened)
The Dutch PHP Conference has
2011-12-21 18:39:
On the "Zend PHP Certification" blog (study notes), there's
Zend PHP Certification Blog: PHP Sorting Functions
On the "Zend PHP Certification" blog (study notes), there's
2011-12-21 17:06:
In a new press release to their site, Zend teases at some of the results from their Zend Developer Pulse survey. In these results, they share what music developers prefer (according to the survey) for when they're developing. The survey showed that as much as 86% of developers listen to music while coding. Of the major music genres, 42% of developers said they prefer coding to music of the rock/pop variety. The results also included the top artists, some "guilty pleasure" choices and some of the least popular artists. The full results of this survey will be coming out in January 2012, giving a "developer perspective" on the current state of the industry, technology in general and their career.
Zend: Zend Reveals What Music Will Keep Developers Productive (and Happy) This Holiday
In a new press release to their site, Zend teases at some of the results from their Zend Developer Pulse survey. In these results, they share what music developers prefer (according to the survey) for when they're developing. The survey showed that as much as 86% of developers listen to music while coding. Of the major music genres, 42% of developers said they prefer coding to music of the rock/pop variety. The results also included the top artists, some "guilty pleasure" choices and some of the least popular artists. The full results of this survey will be coming out in January 2012, giving a "developer perspective" on the current state of the industry, technology in general and their career.
2011-12-21 16:53:
On the php|architect site today Keith Casey has posted a recording of an interview with Boaz Ziniman of Zend about one of their latest offerings, phpcloud - a platform-as-a-service to provide easy, scalable PHP application hosting. At the tail end of ZendCon 2011 in October, I managed to corner Boaz Ziniman to chat on the launch of their new product phpcloud. We covered features, limitations, design & implementation considerations, and how it's different than most of the other options out there. If you'd like to listen, you can grab the mp3 here. It's about 15 minutes long. You can find out more about Zend's cloud offering on phpcloud.com.
php|architect: A Chat on Zend's phpcloud at ZendCon 2011
On the php|architect site today Keith Casey has posted a recording of an interview with Boaz Ziniman of Zend about one of their latest offerings, phpcloud - a platform-as-a-service to provide easy, scalable PHP application hosting. At the tail end of ZendCon 2011 in October, I managed to corner Boaz Ziniman to chat on the launch of their new product phpcloud. We covered features, limitations, design & implementation considerations, and how it's different than most of the other options out there. If you'd like to listen, you can grab the mp3 here. It's about 15 minutes long. You can find out more about Zend's cloud offering on phpcloud.com.
2011-12-21 15:18:
In a new post to his blog today Phil Sturgeon responds to some comments made in another post about PHP not "being an acceptable COBOL". Anyone who has used PHP for a while knows that it has its ugly parts. Recently I've seen a whole swathe of PHP-bashing articles and that would fine if they were they are making a valid point, but some of it has just been - as I tweeted recently - "absolute drivel". He directly refutes some of the points made in that article, points out a newer post from the same author (which misses some points as well) and finishes it off with a look at why he "still" uses PHP versus something like Closure or NodeJS for his development. Despite known flaws and imperfections I continue to use PHP as my primary language because during all the time I spend worrying about which technology is the neatest, coolest or shiniest I could have built a new application to sell or finished another client site. Be sure to check out the comments for some other thoughts about the language (and Phil's responses).
Phil Sturgeon's Blog: PHP Basher Bashing
In a new post to his blog today Phil Sturgeon responds to some comments made in another post about PHP not "being an acceptable COBOL". Anyone who has used PHP for a while knows that it has its ugly parts. Recently I've seen a whole swathe of PHP-bashing articles and that would fine if they were they are making a valid point, but some of it has just been - as I tweeted recently - "absolute drivel". He directly refutes some of the points made in that article, points out a newer post from the same author (which misses some points as well) and finishes it off with a look at why he "still" uses PHP versus something like Closure or NodeJS for his development. Despite known flaws and imperfections I continue to use PHP as my primary language because during all the time I spend worrying about which technology is the neatest, coolest or shiniest I could have built a new application to sell or finished another client site. Be sure to check out the comments for some other thoughts about the language (and Phil's responses).
2011-12-20 18:02:
In part two of their look at Composer/Packagist, the Nelm.io blog looks at some of the impact they could have if adopted heavily by the PHP community. In this second part I would like to talk about a few things Composer could do for you, and the PHP community at large, once it is broadly adopted. [...] How can [shared] interfaces be distributed in each project that uses or implements them? This is where I see Composer helping. Composer supports advanced relationships between packages, so to solve this issue you would need three parts. The three parts all revolve around a few different packages (for their specific Caching interface example) - psr/cache-interface, psr/cache and the requiring of these into a framework needing the common interface. He talks some about what this sort of structure has to offer: simpler plugin installation, promotion of good standards, promotion of code reuse and a renewed interest in using PHP. Reinventing the package management wheel is another thing that really should stop. Who am I to say this you ask? It is true, we are building a shiny new wheel as well. Yet I take comfort in the fact that we are trying to build a generic solution which will work for everybody.
Nelm.io Blog: Composer: Part 2 - Impact
In part two of their look at Composer/Packagist, the Nelm.io blog looks at some of the impact they could have if adopted heavily by the PHP community. In this second part I would like to talk about a few things Composer could do for you, and the PHP community at large, once it is broadly adopted. [...] How can [shared] interfaces be distributed in each project that uses or implements them? This is where I see Composer helping. Composer supports advanced relationships between packages, so to solve this issue you would need three parts. The three parts all revolve around a few different packages (for their specific Caching interface example) - psr/cache-interface, psr/cache and the requiring of these into a framework needing the common interface. He talks some about what this sort of structure has to offer: simpler plugin installation, promotion of good standards, promotion of code reuse and a renewed interest in using PHP. Reinventing the package management wheel is another thing that really should stop. Who am I to say this you ask? It is true, we are building a shiny new wheel as well. Yet I take comfort in the fact that we are trying to build a generic solution which will work for everybody.
2011-12-20 17:58:
In this new post to Reddit, the author shares a bit of their knowledge on what they think everyone should know about strip_tags and some of the issues that can come with it (including security problems). strip_tags is one of the common go-to functions used for making user input on web pages safe for display. But contrary to what it sounds like it's for, strip_tags is never, ever, ever the right function to use for this and it has a lot of problems. Specific problems mentioned include "eating" of valid text, not preventing typed HTML entities, the whitelist of tags opening holes and character set issues that could have security implications. Other tools are recommended in both the article and the comments like HTML Purifier, the option of BBCode and Markdown.
Reddit.com: What everyone should know about strip_tags()
In this new post to Reddit, the author shares a bit of their knowledge on what they think everyone should know about strip_tags and some of the issues that can come with it (including security problems). strip_tags is one of the common go-to functions used for making user input on web pages safe for display. But contrary to what it sounds like it's for, strip_tags is never, ever, ever the right function to use for this and it has a lot of problems. Specific problems mentioned include "eating" of valid text, not preventing typed HTML entities, the whitelist of tags opening holes and character set issues that could have security implications. Other tools are recommended in both the article and the comments like HTML Purifier, the option of BBCode and Markdown.
2011-12-20 16:11:
In a new post to his blog, Oliver John Tibi has the first part of a series looking at mobile-izing your CakePHP application, making it mobile friendly when a mobile browser is detected. I'll be writing a short series of posts on how to create a mobile version of your CakePHP app. I've always been bragging to my peers how awesome CakePHP is, and so now I'm writing a short tutorial on how to create a mobile-friendly version of a CakePHP app. I promise to make this as easy as possible. In this first part of the series he helps you do two things - set up some custom routes for the mobile version of the site ("/m") and add in browser detection using the RequestHandler's "isMobile()" method.
Oliver John Tibi's Blog: Mobile-ize Your CakePHP Application
In a new post to his blog, Oliver John Tibi has the first part of a series looking at mobile-izing your CakePHP application, making it mobile friendly when a mobile browser is detected. I'll be writing a short series of posts on how to create a mobile version of your CakePHP app. I've always been bragging to my peers how awesome CakePHP is, and so now I'm writing a short tutorial on how to create a mobile-friendly version of a CakePHP app. I promise to make this as easy as possible. In this first part of the series he helps you do two things - set up some custom routes for the mobile version of the site ("/m") and add in browser detection using the RequestHandler's "isMobile()" method.
2011-12-20 15:40:
On PHPMaster.com today there's a new post from Matthew Turland talking about PHP's quest for performance and some of the recent advancements that have made better performing applications even more possible. While it's sufficient for many users, as PHP sees increased use by large sites like Wikipedia and Facebook, the ability to serve more requests on fewer servers becomes increasingly important. Some efforts have been made in this area in the last few years, both within and outside the PHP internals team. However, understanding exactly what's going on requires a bit of background both in history and concepts. He goes through some of the origins of the PHP language (from the early days with Rasmus Lerdorf) to the fact that the PHP language itself is interpreted - complete with some of the overhead that comes with that. He also mentions various projects that have tried to compile PHP back down to C to increase performance like Roadsend, HipHop and, most recently, the HipHop virtual machine from Facebook.
PHPMaster.com: PHP's Quest for Performance: From C to hhvm
On PHPMaster.com today there's a new post from Matthew Turland talking about PHP's quest for performance and some of the recent advancements that have made better performing applications even more possible. While it's sufficient for many users, as PHP sees increased use by large sites like Wikipedia and Facebook, the ability to serve more requests on fewer servers becomes increasingly important. Some efforts have been made in this area in the last few years, both within and outside the PHP internals team. However, understanding exactly what's going on requires a bit of background both in history and concepts. He goes through some of the origins of the PHP language (from the early days with Rasmus Lerdorf) to the fact that the PHP language itself is interpreted - complete with some of the overhead that comes with that. He also mentions various projects that have tried to compile PHP back down to C to increase performance like Roadsend, HipHop and, most recently, the HipHop virtual machine from Facebook.
2011-12-20 14:00:
Latest PECL Releases: mysqlnd_ms 1.2.0 pcsc 0.1 functional 0.6.0 svm 0.1.4
Community News: Latest PECL Releases for 12.20.2011
Latest PECL Releases: mysqlnd_ms 1.2.0 pcsc 0.1 functional 0.6.0 svm 0.1.4
2011-12-19 19:39:
As was mentioned by Patrick Schwisow the Lake County, Illinois/Kenosha County, Wisconsin area has a new PHP user group - the Lake / Kenosha County PHP Users Group. This group allows PHP developers at all levels of expertise get together to discuss various topics in PHP and related web technologies. Events will generally be held in Lake County, Illinois, or Kenosha County, Wisconsin. As of the time of this post, there aren't any meetups scheduled, but there's already been signups to join the group in its future events. If you're in the area and would like to get involved, go sign up on their Meetup page to keep up to date!
Community News: Lake / Kenosha County PHP Users Group
As was mentioned by Patrick Schwisow the Lake County, Illinois/Kenosha County, Wisconsin area has a new PHP user group - the Lake / Kenosha County PHP Users Group. This group allows PHP developers at all levels of expertise get together to discuss various topics in PHP and related web technologies. Events will generally be held in Lake County, Illinois, or Kenosha County, Wisconsin. As of the time of this post, there aren't any meetups scheduled, but there's already been signups to join the group in its future events. If you're in the area and would like to get involved, go sign up on their Meetup page to keep up to date!
2011-12-19 18:30:
php|architect has officially announced the sale of some of the first tickets you can get for this year's php|tek event - the Charter tickets available until the schedule for this year's conference is released. As it is customary, while we work on receiving proposals, rating them, and coming up with a final schedule for php|tek 2012, we are offering "Charter tickets" at 50% off the full price for a "Full Experience" ticket that includes access to both the tutorial day and the main conference - that's four days of learning, networking, and just plain fun for the lowest price we'll ever offer, period. The Charter tickets are $750 USD this year and give you full access to both the tutorial day and full conference days for the rest of the week. There's a limited supply of these pre-schedule tickets, so be sure you pick up yours now to get in on the deal.
Community News: php|tek Charter Tickets on Sale
php|architect has officially announced the sale of some of the first tickets you can get for this year's php|tek event - the Charter tickets available until the schedule for this year's conference is released. As it is customary, while we work on receiving proposals, rating them, and coming up with a final schedule for php|tek 2012, we are offering "Charter tickets" at 50% off the full price for a "Full Experience" ticket that includes access to both the tutorial day and the main conference - that's four days of learning, networking, and just plain fun for the lowest price we'll ever offer, period. The Charter tickets are $750 USD this year and give you full access to both the tutorial day and full conference days for the rest of the week. There's a limited supply of these pre-schedule tickets, so be sure you pick up yours now to get in on the deal.
2011-12-19 17:06:
On the PEAR Group blog there's a new post welcoming all new contributors to the project and pointing out that the PEAR account on Github has officially passed the 200 repository mark in the move from SVN to Git. PEAR is about providing the PHP community with reusable, effective components - this has been our mission since day 1. If there is anything we can do to make that goal happen, to assist you as an individual or company, I would strongly encourage you to let us know - we're here to help. They mention the work of two individuals that have done good work on a specific package, meldra and Gemorroj - perfect examples of how the move to Github has made it simpler to implement changes that have been "waiting in the wings" on the XML_Feed_Parser and Image_Barcode2 packages. If you've had changes you've wanted to make to a PEAR package in the past but haven't ever gotten them submitted, there's not a better time than now.
PEAR Blog: Welcome to new contributors
On the PEAR Group blog there's a new post welcoming all new contributors to the project and pointing out that the PEAR account on Github has officially passed the 200 repository mark in the move from SVN to Git. PEAR is about providing the PHP community with reusable, effective components - this has been our mission since day 1. If there is anything we can do to make that goal happen, to assist you as an individual or company, I would strongly encourage you to let us know - we're here to help. They mention the work of two individuals that have done good work on a specific package, meldra and Gemorroj - perfect examples of how the move to Github has made it simpler to implement changes that have been "waiting in the wings" on the XML_Feed_Parser and Image_Barcode2 packages. If you've had changes you've wanted to make to a PEAR package in the past but haven't ever gotten them submitted, there's not a better time than now.
2011-12-19 16:10:
Robert Basic has put together a new tutorial on his blog showing how he connected PHP and Pidgin (the popular chat client) with the help of the DBus extension. Earlier this week I got an idea of trying to communicate with Pidgin, a chat client, via the terminal. [...] Surely I wasn't the first one to come up with this idea and after a bit of a googling found out that Pidgin's libpurple has a nice API for that, exposed via D-Bus. I first planned to write some scripts for this in Python or C, but when I finally sat down over the weekend to hack on this, realized there is a PHP D-Bus extension, thanks to Derick Rethans! He goes through the whole process you'll need to get it up and working on your system - installing the extension via PECL, creating a DBus proxy to the Pigdin interface and getting a list of the currently connected users. You can find the first versions of this code in his account on github.
Robert Basic's Blog: Communicating with Pidgin from PHP via D-Bus
Robert Basic has put together a new tutorial on his blog showing how he connected PHP and Pidgin (the popular chat client) with the help of the DBus extension. Earlier this week I got an idea of trying to communicate with Pidgin, a chat client, via the terminal. [...] Surely I wasn't the first one to come up with this idea and after a bit of a googling found out that Pidgin's libpurple has a nice API for that, exposed via D-Bus. I first planned to write some scripts for this in Python or C, but when I finally sat down over the weekend to hack on this, realized there is a PHP D-Bus extension, thanks to Derick Rethans! He goes through the whole process you'll need to get it up and working on your system - installing the extension via PECL, creating a DBus proxy to the Pigdin interface and getting a list of the currently connected users. You can find the first versions of this code in his account on github.
2011-12-19 15:50:
Michelangelo van Dam is back with the second part of his series looking at running PHP applications on Azure (the first part
Michaelangelo van Dam' Blog: Configuring Zend Framework apps for Windows Azure
Michelangelo van Dam is back with the second part of his series looking at running PHP applications on Azure (the first part
2011-12-19 14:06:
Latest PEAR Releases: Image_QRCode 0.1.2 PEAR_Frontend_Gtk2 1.1.0 Image_Text 0.6.1 Date 1.5.0a2 PHP_Shell 0.3.2 Text_Highlighter 0.7.3 Validate_DK 0.2.0 PEAR_PackageFileManager_Frontend 0.8.0 Services_ExchangeRates 0.7.0 Console_Color2 0.1.0 Validate 0.8.5
Community News: Latest PEAR Releases for 12.19.2011
Latest PEAR Releases: Image_QRCode 0.1.2 PEAR_Frontend_Gtk2 1.1.0 Image_Text 0.6.1 Date 1.5.0a2 PHP_Shell 0.3.2 Text_Highlighter 0.7.3 Validate_DK 0.2.0 PEAR_PackageFileManager_Frontend 0.8.0 Services_ExchangeRates 0.7.0 Console_Color2 0.1.0 Validate 0.8.5
2011-12-16 19:15:
On PHPMaster.com today there's a new design pattern-focused that introduces you to using the Factory method to create new objects on the fly. The Factory Method pattern is a design pattern used to define a runtime interface for creating an object. It's called a factory because it creates various types of objects without necessarily knowing what kind of object it creates or how to create it. Code is included showing how to make creating "Product_*" classes as simple as calling a "build()" method with the type. A slightly more complex situation is also included - building factories inside of factory methods. For more about the Factory design pattern, check out its Wikipedia page (that includes some common uses and some pitfalls to watch out for).
PHPMaster.com: Understanding the Factory Method Design Pattern
On PHPMaster.com today there's a new design pattern-focused that introduces you to using the Factory method to create new objects on the fly. The Factory Method pattern is a design pattern used to define a runtime interface for creating an object. It's called a factory because it creates various types of objects without necessarily knowing what kind of object it creates or how to create it. Code is included showing how to make creating "Product_*" classes as simple as calling a "build()" method with the type. A slightly more complex situation is also included - building factories inside of factory methods. For more about the Factory design pattern, check out its Wikipedia page (that includes some common uses and some pitfalls to watch out for).
2011-12-16 18:41:
In this recent post to his blog Brian Smithwick talks about the "locked box" that developers can sometimes restrict themselves to - getting to comfortable in the tech they already know and not branching out. Jason Austin gave a great presentation at CodeWorks Raleigh recently about cultivating one's passion for software development through side projects -- safe spaces where we can play with new technologies and techniques. The point's well taken: as developers, we're probably putting most of our energy towards the thing that must be solved, that keeps us employed, that pays our bills. [...] And so all of us, at one time or another, end up in a backwater of our own devising -- a locked box. He also puts an emphasis on collaboration and community as it relates to becoming a better developer. By interacting with other code and other projects' developers, you learn not only more about other ways to develop but are exposed to ideas you may not have come across on your own. I'd add that active participation in the local community is just as important though: the opportunities for exposure to new ideas outside your sphere are greater than your feed reader will probably provide, and the depth of information that you can get in a conversation may be better than any blog post or man page.
Brian Smithwick's Blog: Software development and the locked box
In this recent post to his blog Brian Smithwick talks about the "locked box" that developers can sometimes restrict themselves to - getting to comfortable in the tech they already know and not branching out. Jason Austin gave a great presentation at CodeWorks Raleigh recently about cultivating one's passion for software development through side projects -- safe spaces where we can play with new technologies and techniques. The point's well taken: as developers, we're probably putting most of our energy towards the thing that must be solved, that keeps us employed, that pays our bills. [...] And so all of us, at one time or another, end up in a backwater of our own devising -- a locked box. He also puts an emphasis on collaboration and community as it relates to becoming a better developer. By interacting with other code and other projects' developers, you learn not only more about other ways to develop but are exposed to ideas you may not have come across on your own. I'd add that active participation in the local community is just as important though: the opportunities for exposure to new ideas outside your sphere are greater than your feed reader will probably provide, and the depth of information that you can get in a conversation may be better than any blog post or man page.
2011-12-16 17:28:
In this recent blog post nikic takes an in-depth look at how large PHP arrays really are - how memory is used in the creation and management of these handy PHP variable types. In this post I want to investigate the memory usage of PHP arrays (and values in general) using the following script as an example, which creates 100000 unique integer array elements and measures the resulting memory usage. [...] How much would you expect it to be? [...] Now try and run the above code. You can do it online if you want. This gives me 14649024 bytes. Yes, you heard right, that's 13.97 MB - eightteen times more than we estimated. He goes into the details of PHP's memory management and breaks it down into the different totals (for 64 bit and 32 bit OSes) and details on each - zvalue_value, zvalue, cycles collector, Zend MM allocator and the buckets used to isolate one array (hash table/dictionary) from another. What does this tell us? PHP ain't C. That's all this should tell us. You can't expect that a super dynamic language like PHP has the same highly efficient memory usage that C has. You just can't.
Nikic's Blog: How big are PHP arrays (and values) really? (Hint: BIG!)
In this recent blog post nikic takes an in-depth look at how large PHP arrays really are - how memory is used in the creation and management of these handy PHP variable types. In this post I want to investigate the memory usage of PHP arrays (and values in general) using the following script as an example, which creates 100000 unique integer array elements and measures the resulting memory usage. [...] How much would you expect it to be? [...] Now try and run the above code. You can do it online if you want. This gives me 14649024 bytes. Yes, you heard right, that's 13.97 MB - eightteen times more than we estimated. He goes into the details of PHP's memory management and breaks it down into the different totals (for 64 bit and 32 bit OSes) and details on each - zvalue_value, zvalue, cycles collector, Zend MM allocator and the buckets used to isolate one array (hash table/dictionary) from another. What does this tell us? PHP ain't C. That's all this should tell us. You can't expect that a super dynamic language like PHP has the same highly efficient memory usage that C has. You just can't.
2011-12-16 16:48:
In a new post to his blog Sebastian Bergmann takes a quick look at using a static analyzer, clang and scan-build, to analyze the PHP interpreter (specifically during the compile process). I have been tinkering with CLANG's static analyzer lately. This post summarizes how I installed LLVM and CLANG and performed the analysis of a build of the PHP interpreter. He includes all the commands (unix-based) to get the clang tools/libraries installed in the correct places as well as what to add to your $PATH to get the "scan-build" command to work with the make and make install parts of the PHP compile process.
Sebastian Bergmann's Blog: Using CLANG/scan-build for Static Analysis of the PHP Interpreter
In a new post to his blog Sebastian Bergmann takes a quick look at using a static analyzer, clang and scan-build, to analyze the PHP interpreter (specifically during the compile process). I have been tinkering with CLANG's static analyzer lately. This post summarizes how I installed LLVM and CLANG and performed the analysis of a build of the PHP interpreter. He includes all the commands (unix-based) to get the clang tools/libraries installed in the correct places as well as what to add to your $PATH to get the "scan-build" command to work with the make and make install parts of the PHP compile process.
2011-12-16 15:08:
On the php|architect site today Keith Casey has written up a summary of the eastern leg of the CodeWorks conference tour that just wrapped up in Orlando, Florida. While it will still be a few days weeks until I'm finally recovered, I wanted to share a recap of CodeWorks East 2011 while it was still fresh. If you're looking for the core presenters' slides, attendees will receive them via email but they will not be published publicly until after the West Coast Tour is complete in January 2012. He mentions their sponsor first (Adobe) and then gets into the details of each stop along their way - Madison, Nashville, Baltimore, Raleigh and finally Orlando. Their west coast tour kicks off on January 10th in Seattle (with further stops in Portland, San Francisco, Los Angeles and Austin). You can find out more about the event on the CodeWorks site.
php|architect: CodeWorks East 2011 Recap
On the php|architect site today Keith Casey has written up a summary of the eastern leg of the CodeWorks conference tour that just wrapped up in Orlando, Florida. While it will still be a few days weeks until I'm finally recovered, I wanted to share a recap of CodeWorks East 2011 while it was still fresh. If you're looking for the core presenters' slides, attendees will receive them via email but they will not be published publicly until after the West Coast Tour is complete in January 2012. He mentions their sponsor first (Adobe) and then gets into the details of each stop along their way - Madison, Nashville, Baltimore, Raleigh and finally Orlando. Their west coast tour kicks off on January 10th in Seattle (with further stops in Portland, San Francisco, Los Angeles and Austin). You can find out more about the event on the CodeWorks site.
2011-12-16 14:05:
Popular posts from PHPDeveloper.org for the past week:Nelm.io Blog: Composer: Part 1 - What & Why PHPBuilder.com: PHP Arrays: Advanced Iteration and Manipulation CodeIgniter.com: PHP Framework Usage Survey Devshed: Building a PHP ORM: Deploying a Blog WorkingSoftware Blog: Your templating engine sucks & everything you've written is spaghetti code Watts Martin's Blog: PHP is not an acceptable COBOL DZone.com: Writing Better PHP: Three Guides Michaelangelo van Dam' Blog: Windows Azure for PHP developers Chris Hartjes' Blog: Better HTTP Request/Response in PHP Brian Swan's Blog: Running PHPUnit in Windows Azure
Site News: Popular Posts for the Week of 12.16.2011
Popular posts from PHPDeveloper.org for the past week:Nelm.io Blog: Composer: Part 1 - What & Why PHPBuilder.com: PHP Arrays: Advanced Iteration and Manipulation CodeIgniter.com: PHP Framework Usage Survey Devshed: Building a PHP ORM: Deploying a Blog WorkingSoftware Blog: Your templating engine sucks & everything you've written is spaghetti code Watts Martin's Blog: PHP is not an acceptable COBOL DZone.com: Writing Better PHP: Three Guides Michaelangelo van Dam' Blog: Windows Azure for PHP developers Chris Hartjes' Blog: Better HTTP Request/Response in PHP Brian Swan's Blog: Running PHPUnit in Windows Azure
2011-12-15 19:48:
Henrik Bjørnskov has posted a bit of an in-depth look at Stampie, an abstraction library for sending emails from PHP applications via various service providers (like SendGrid and Mailchimp). So what is Stampie. Stampie is a API wrapper for the most common email sending services. It provides a standard PHP Api to send emails. But mostly it is a project to test TDD and experiment with a couple of different things. Stampie is developed with Dependency Injection and therefore there is a lot of objects. At the start it can be quite cumbersome, but will make a lot of sense if you start to develop and add additional provider. He includes a bit of sample code showing the sending of a message via the SendGrid API backend. Extending the system is simpler thanks to DI and the customizable MailerInterface object type. There's also an AdapterInterface object that can be used to redefine the HTTP connection interface the tool uses. He also points to the HBStampieBundle bundle for the Symfony2 framework that can make dropping it into your current SF2 application simpler.
Henrik Bjørnskov's Blog: Stampie an in depth look
Henrik Bjørnskov has posted a bit of an in-depth look at Stampie, an abstraction library for sending emails from PHP applications via various service providers (like SendGrid and Mailchimp). So what is Stampie. Stampie is a API wrapper for the most common email sending services. It provides a standard PHP Api to send emails. But mostly it is a project to test TDD and experiment with a couple of different things. Stampie is developed with Dependency Injection and therefore there is a lot of objects. At the start it can be quite cumbersome, but will make a lot of sense if you start to develop and add additional provider. He includes a bit of sample code showing the sending of a message via the SendGrid API backend. Extending the system is simpler thanks to DI and the customizable MailerInterface object type. There's also an AdapterInterface object that can be used to redefine the HTTP connection interface the tool uses. He also points to the HBStampieBundle bundle for the Symfony2 framework that can make dropping it into your current SF2 application simpler.
2011-12-15 18:27:
As mentioned on the main PHP.net site, the latest Release Candidate in the PHP 5.4.x series has been released - PHP 5.4.0RC3: The PHP development team is proud to announce the third release candidate of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. THIS IS A RELEASE CANDIDATE - DO NOT USE IT IN PRODUCTION!. This is the third release candidate. The release candidate phase is intended as a period of bug fixing prior to the stable release. No new features should be included before the final version of PHP 5.4.0. Major changes include the introduction of UTS #46 mapping support in the intl extension and the inclusion of SERVER_NAME and SERVER_PORT into the $_SERVER superglobal for CLI. You can find more changes listed in the NEWS file and can download the latest from the PHP.net site (or your favorite mirror): source, Windows binaries.
PHP.net: PHP 5.4.0RC3 Released!
As mentioned on the main PHP.net site, the latest Release Candidate in the PHP 5.4.x series has been released - PHP 5.4.0RC3: The PHP development team is proud to announce the third release candidate of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. THIS IS A RELEASE CANDIDATE - DO NOT USE IT IN PRODUCTION!. This is the third release candidate. The release candidate phase is intended as a period of bug fixing prior to the stable release. No new features should be included before the final version of PHP 5.4.0. Major changes include the introduction of UTS #46 mapping support in the intl extension and the inclusion of SERVER_NAME and SERVER_PORT into the $_SERVER superglobal for CLI. You can find more changes listed in the NEWS file and can download the latest from the PHP.net site (or your favorite mirror): source, Windows binaries.
2011-12-15 17:15:
PHPmaster.com has a new introductory tutorial for those just starting out with PHP (or with programming really) talking about using looping structures for sets of data - for, while/do-while and foreach. A significant advantage of computers is that they can perform repetitive tasks easily and efficiently. Instead of writing repetitive code you can write a set of statements that processes some data and then have the computer execute them repeatedly by using a construct known as a loop. Loops come in several different flavors in PHP: for, while, do-while, and foreach. I'll introduce you to each of them and show you how they can making repetitive tasks straightforward and easy to maintain. The tutorial explains a use case for each of the loop types and includes a bit of sample code showing how to put it into practice. It also shares two special keywords that can be used to bypass or break out of your current loop - break and continue.
PHPMaster.com: Learning Loops
PHPmaster.com has a new introductory tutorial for those just starting out with PHP (or with programming really) talking about using looping structures for sets of data - for, while/do-while and foreach. A significant advantage of computers is that they can perform repetitive tasks easily and efficiently. Instead of writing repetitive code you can write a set of statements that processes some data and then have the computer execute them repeatedly by using a construct known as a loop. Loops come in several different flavors in PHP: for, while, do-while, and foreach. I'll introduce you to each of them and show you how they can making repetitive tasks straightforward and easy to maintain. The tutorial explains a use case for each of the loop types and includes a bit of sample code showing how to put it into practice. It also shares two special keywords that can be used to bypass or break out of your current loop - break and continue.
2011-12-15 16:03:
On the PHPClasses blog today the question is posed "can .NET make PHP run faster than the official PHP implementation?" (relating to the use of the Phalanger tool to compile PHP down to .NET assemblies. Recently Phalanger 3.0 was released introducing numerous improvements in terms of compatibility with the PHP 5.3, interoperability with .NET platform implementations including Mono on Linux, and probably most importantly performance improvements. [...] What motivated this article was that a PHP developer named Rasmus Schultz went on the php.internals mailing list and proposed to switch the official PHP implementation based on Zend for another based on Phalanger. The post includes some benchmarking results of requests made to a WordPress instance running on various PHP platforms. The Phalanger version came in around 2 seconds faster (average, obviously) than the PHP FastCGI setup. Also included are two suggestions for future PHP versions (v6 anyone?) that could help the language perform even better: Thread-safety for running with less memory waste and the inclusion of a JIT (Just in time compiler - of which a few are mentioned specifically.
PHPClasses.org: Can .NET make PHP run faster than the official PHP implementation?
On the PHPClasses blog today the question is posed "can .NET make PHP run faster than the official PHP implementation?" (relating to the use of the Phalanger tool to compile PHP down to .NET assemblies. Recently Phalanger 3.0 was released introducing numerous improvements in terms of compatibility with the PHP 5.3, interoperability with .NET platform implementations including Mono on Linux, and probably most importantly performance improvements. [...] What motivated this article was that a PHP developer named Rasmus Schultz went on the php.internals mailing list and proposed to switch the official PHP implementation based on Zend for another based on Phalanger. The post includes some benchmarking results of requests made to a WordPress instance running on various PHP platforms. The Phalanger version came in around 2 seconds faster (average, obviously) than the PHP FastCGI setup. Also included are two suggestions for future PHP versions (v6 anyone?) that could help the language perform even better: Thread-safety for running with less memory waste and the inclusion of a JIT (Just in time compiler - of which a few are mentioned specifically.
2011-12-15 15:43:
Lineke Kerckhoffs-Willems has a new post to her blog today with an update about their in-progress site that wants to share tech knowledge through video, ProTalk: A lot has happened since my October post announcing ProTalk, the secret project I am working on with my friend, Kim Rowan. So much in fact that now seems the ideal time to update you on our progress! Now, down to business! Since announcing the project in early October we have achieved the [several] project milestones. The milestones include hosting by Combell (who also host Joind.in), a new domain, a commitment from Ibuildings for a design/logo/wireframe set and a new twitter account. ProTalk is a "community resource aiming to provide a central point of access to video and audio content with a PHP focus." For more information and to sign up for details when they launch, check out their new site.
Lineke Kerckhoffs-Willems' Blog: ProTalk update December 2011
Lineke Kerckhoffs-Willems has a new post to her blog today with an update about their in-progress site that wants to share tech knowledge through video, ProTalk: A lot has happened since my October post announcing ProTalk, the secret project I am working on with my friend, Kim Rowan. So much in fact that now seems the ideal time to update you on our progress! Now, down to business! Since announcing the project in early October we have achieved the [several] project milestones. The milestones include hosting by Combell (who also host Joind.in), a new domain, a commitment from Ibuildings for a design/logo/wireframe set and a new twitter account. ProTalk is a "community resource aiming to provide a central point of access to video and audio content with a PHP focus." For more information and to sign up for details when they launch, check out their new site.
2011-12-14 20:34:
In a recent post to his blog Devis Lucato introduces the "Inversion of Control" design pattern and shares an implementation he's created as an illustration - a Service Locator called Select. [In a Service Locator] all the dependencies are provided by a builder, which serves as a registry of dependencies and/or service definitions. The service locator knows how to instantiate each dependency. Such service exposes methods like 'getMailer()', 'getLogger()' etc. A service locator centralises the configuration detailing classes and parameters involved on objects instantiations. He includes some sample code showing the structure of a Select implementation using a "Mailer" identifier and definitions of the classes to load for it. He also includes a bit of documentation of the (simple) API you can use to work with the tool - setting namespaces, replacing class definitions, creating definitions and finding the resource associated with a definition (to name a few).
Devis Lucato's Blog: Select: Inversion of Control
In a recent post to his blog Devis Lucato introduces the "Inversion of Control" design pattern and shares an implementation he's created as an illustration - a Service Locator called Select. [In a Service Locator] all the dependencies are provided by a builder, which serves as a registry of dependencies and/or service definitions. The service locator knows how to instantiate each dependency. Such service exposes methods like 'getMailer()', 'getLogger()' etc. A service locator centralises the configuration detailing classes and parameters involved on objects instantiations. He includes some sample code showing the structure of a Select implementation using a "Mailer" identifier and definitions of the classes to load for it. He also includes a bit of documentation of the (simple) API you can use to work with the tool - setting namespaces, replacing class definitions, creating definitions and finding the resource associated with a definition (to name a few).
2011-12-14 19:03:
In a bit of a ranting post on the WorkingSoftware.com.au blog Iain Dooley shares his opinion about most of the code he's seen, specifically related to templating engines: "Your templating engine sucks and everything you have ever written is spaghetti code (yes, you)". Templating is a real hot button in the web development community. [...] The high horses that people usually get on are that all too familiar TLA MVC (Model/View/Controller) architecture and "separation of presentation and business logic". The poor pedestrians upon which they look down are those who have written "spaghetti code" - templates where presentation logic, markup, business logic, database access configuration and whatever else you might imagine are mixed up in the same file. Well, I've got some news for you: you're all wrong. He points out that, with most of the major templating tools out there, there's most people still put some sort of business logic in their templates. Rarely will you find a "pure" template that only echoes out the data. He gives an example of a Mustache template with "empty" logic in it. He shares a new term his coined too: "Template Animation". This is the separation of the templating process as it is usually done and splitting it so that the output is a modified DOM resource rather than a static template. He talks about some of the advantages of this approach and an example of its use in an example of a logged in user vs not logged in user as well as a brief discussion of Markdown/HAML. The only thing that Template Animation advocates is that the technological barrier between the frontend and the backend is never crossed - that our templates are truly logic-less. There's lots of comments on the post already - everything from support of the idea to systems that already implement this sort of idea to disagreeing opinions.
WorkingSoftware Blog: Your templating engine sucks & everything you've written is spaghetti code
In a bit of a ranting post on the WorkingSoftware.com.au blog Iain Dooley shares his opinion about most of the code he's seen, specifically related to templating engines: "Your templating engine sucks and everything you have ever written is spaghetti code (yes, you)". Templating is a real hot button in the web development community. [...] The high horses that people usually get on are that all too familiar TLA MVC (Model/View/Controller) architecture and "separation of presentation and business logic". The poor pedestrians upon which they look down are those who have written "spaghetti code" - templates where presentation logic, markup, business logic, database access configuration and whatever else you might imagine are mixed up in the same file. Well, I've got some news for you: you're all wrong. He points out that, with most of the major templating tools out there, there's most people still put some sort of business logic in their templates. Rarely will you find a "pure" template that only echoes out the data. He gives an example of a Mustache template with "empty" logic in it. He shares a new term his coined too: "Template Animation". This is the separation of the templating process as it is usually done and splitting it so that the output is a modified DOM resource rather than a static template. He talks about some of the advantages of this approach and an example of its use in an example of a logged in user vs not logged in user as well as a brief discussion of Markdown/HAML. The only thing that Template Animation advocates is that the technological barrier between the frontend and the backend is never crossed - that our templates are truly logic-less. There's lots of comments on the post already - everything from support of the idea to systems that already implement this sort of idea to disagreeing opinions.
2011-12-14 18:15:
On DZone.com today John Esposito has posted about three guides that want to help you improve your PHP development skills (including a forum post and two articles). Sometimes, then, improving your generic 'programming brain' will help you improve your facility with a particular language. At other times, it's more important to learn the nuances of a language, paying close attention to the kind of applications the language is used for. [...] For improving your PHP, then, you can do two things: become a better programmer; and understand PHP more finely, more deeply. The three guides share a lot of the same concepts in common - naming conventions, separation of functionality, DRY (don't repeat yourself), testing code, etc.
DZone.com: Writing Better PHP: Three Guides
On DZone.com today John Esposito has posted about three guides that want to help you improve your PHP development skills (including a forum post and two articles). Sometimes, then, improving your generic 'programming brain' will help you improve your facility with a particular language. At other times, it's more important to learn the nuances of a language, paying close attention to the kind of applications the language is used for. [...] For improving your PHP, then, you can do two things: become a better programmer; and understand PHP more finely, more deeply. The three guides share a lot of the same concepts in common - naming conventions, separation of functionality, DRY (don't repeat yourself), testing code, etc.
2011-12-14 17:20:
The Ibuildings techPortal has posted the latest episode of their recordings from this year's Dutch PHP Conference - Derick Rethans' talk "Profiling PHP Applications". The web is full of useful advice focussed on pushing out the last bit of performance of your code. They mention trivial changes. like changing every occurrence of print with echo even suggesting to use for instead of foreach. These optimisations help, but you are not going to notice it unless they're in a tight loop with many iterations. It is also a wrong approach for tackling performance issues. You can listen to this latest episode either through the in-page player, by downloading the mp3 or subscribing to their feed. You can also page through his slides as you listen.
Ibuildings techPortal: DPC Radio: Profiling PHP Applications
The Ibuildings techPortal has posted the latest episode of their recordings from this year's Dutch PHP Conference - Derick Rethans' talk "Profiling PHP Applications". The web is full of useful advice focussed on pushing out the last bit of performance of your code. They mention trivial changes. like changing every occurrence of print with echo even suggesting to use for instead of foreach. These optimisations help, but you are not going to notice it unless they're in a tight loop with many iterations. It is also a wrong approach for tackling performance issues. You can listen to this latest episode either through the in-page player, by downloading the mp3 or subscribing to their feed. You can also page through his slides as you listen.
2011-12-14 16:51:
In a recent post to his blog Chris Hartjes looks at the idea of better HTTP Request/Response functionality in PHP, more than just the superglobal handling and PECL HTTP extension it has now. I think the fact that we have $_POST and $_GET lulls some of us into the false sense that we should have $_PUT and $_DELETE objects, since that would map to the commonly-desired set of HTTP verbs that REST likes to use. But what should be inside those things, or should we be moving towards a more Pythonesque solution where a Request object, as part of core or via a only-really-for-the-brave- PECL extension? He mentions opinions from other PHP community members (Laura Thompson and Elizabeth Smith) and a bit about what he (and I'm sure other developers) are looking for in a more full-featured request/response handling feature.
Chris Hartjes' Blog: Better HTTP Request/Response in PHP
In a recent post to his blog Chris Hartjes looks at the idea of better HTTP Request/Response functionality in PHP, more than just the superglobal handling and PECL HTTP extension it has now. I think the fact that we have $_POST and $_GET lulls some of us into the false sense that we should have $_PUT and $_DELETE objects, since that would map to the commonly-desired set of HTTP verbs that REST likes to use. But what should be inside those things, or should we be moving towards a more Pythonesque solution where a Request object, as part of core or via a only-really-for-the-brave- PECL extension? He mentions opinions from other PHP community members (Laura Thompson and Elizabeth Smith) and a bit about what he (and I'm sure other developers) are looking for in a more full-featured request/response handling feature.
2011-12-14 15:31:
The CICONF (CodeIgniter conference) group has made a new post about the lineup for their next event including people like Adam Griffiths, Alex Bilbie, Alexis Serneels, Harrow "WanWizard" Verton, Nick Jackson and Tyler Flint. The chances are if you are using a library, addon, Spark or tutorial for your CodeIgniter projects it will have been written by one of these guys. Adam Griffiths wrote the book, Alex Bilbie has made some amazing OAuth 2 and Mongo code, WanWizard wrote DataMapper ORM - the most popular ORM used with CodeIgniter - and I've [Phil Sturgeon] released a few blogs about CI over the years. They'll be doing the double-event conferences this year again - this time they'll be in London (February 18th-19th and San Francisco at a yet to be determined date). If you'd like to attend the London sessions, you can already purchase your tickets - a student pass for £35 and a standard ticket for £45.
Community News: CICONF '12 Speaker List
The CICONF (CodeIgniter conference) group has made a new post about the lineup for their next event including people like Adam Griffiths, Alex Bilbie, Alexis Serneels, Harrow "WanWizard" Verton, Nick Jackson and Tyler Flint. The chances are if you are using a library, addon, Spark or tutorial for your CodeIgniter projects it will have been written by one of these guys. Adam Griffiths wrote the book, Alex Bilbie has made some amazing OAuth 2 and Mongo code, WanWizard wrote DataMapper ORM - the most popular ORM used with CodeIgniter - and I've [Phil Sturgeon] released a few blogs about CI over the years. They'll be doing the double-event conferences this year again - this time they'll be in London (February 18th-19th and San Francisco at a yet to be determined date). If you'd like to attend the London sessions, you can already purchase your tickets - a student pass for £35 and a standard ticket for £45.
2011-12-13 21:05:
John Conde has shared his multi-part guide to getting your application integrated with the popular payment service Authorize.net. As an Authorize.Net blogger, I decided to write a series of articles that outlined not only the basics of handling an ecommerce transaction, but also included some best practices as well. These were demonstrated using a web-based payment form that when complete forms a real-world, production ready solution. Since there was a lot of ground to cover, I broke the tutorial into eleven parts. Parts of the series cover topics like: reading/sanitizing data handling validation errors preventing duplicate submissions preventing automated form submissions For those that want to jump straight into the code, he also links to his sample payment form and the Authorize.net PHP SDK.
John Conde's Blog: Handling Online Payments With PHP And Authorize.Net
John Conde has shared his multi-part guide to getting your application integrated with the popular payment service Authorize.net. As an Authorize.Net blogger, I decided to write a series of articles that outlined not only the basics of handling an ecommerce transaction, but also included some best practices as well. These were demonstrated using a web-based payment form that when complete forms a real-world, production ready solution. Since there was a lot of ground to cover, I broke the tutorial into eleven parts. Parts of the series cover topics like: reading/sanitizing data handling validation errors preventing duplicate submissions preventing automated form submissions For those that want to jump straight into the code, he also links to his sample payment form and the Authorize.net PHP SDK.
2011-12-13 20:16:
Chris Hartjes and Ed Finkler (two well-known PHP community members) have started up a podcast where they talk about, basically, whatever they want in their "piss-and-moan-driven-development" style. In their first episode, they talk about what they hate about PHP. Listen to a couple old dudes complain that they don't like PHP anymore. Yes, I know, this sounds pretty compelling. They specifically mention the PUT method support in PHP. You can download the mp3 (about an hour and a half long) and check out the two hosts on Twitter: Chris and Ed.
Community News: "Developer Hell" Podcast
Chris Hartjes and Ed Finkler (two well-known PHP community members) have started up a podcast where they talk about, basically, whatever they want in their "piss-and-moan-driven-development" style. In their first episode, they talk about what they hate about PHP. Listen to a couple old dudes complain that they don't like PHP anymore. Yes, I know, this sounds pretty compelling. They specifically mention the PUT method support in PHP. You can download the mp3 (about an hour and a half long) and check out the two hosts on Twitter: Chris and Ed.
2011-12-13 19:10:
New on PHPMaster.com there's a tutorial from Lukas White about targeting users using geolocation based on the Geonames web service and a latitude/longitude. His example makes a call to find the closest "place" to the given coordinates. Location-aware applications rely on being able to locate where you are, and this is what geolocation is all about. After all, once the application knows your location, it can go on to find the nearest store, guide you through the appropriate route to a destination, or target relevant advertisements to you. Geolocation, then, is simply the mechanism for identifying your geographical location. He mentions two challenges associated with geolocation - finding where someone is and describing the location. With Geonames, he shows how to call the service's "findNearbyPlaceName" method to find the closest "place" to a given latitude/longitude combination. Included is a bit of sample PHP to connect to the service and Javascript to request the user's current location.
PHPMaster.com: Targeted Geolocation with Geonames
New on PHPMaster.com there's a tutorial from Lukas White about targeting users using geolocation based on the Geonames web service and a latitude/longitude. His example makes a call to find the closest "place" to the given coordinates. Location-aware applications rely on being able to locate where you are, and this is what geolocation is all about. After all, once the application knows your location, it can go on to find the nearest store, guide you through the appropriate route to a destination, or target relevant advertisements to you. Geolocation, then, is simply the mechanism for identifying your geographical location. He mentions two challenges associated with geolocation - finding where someone is and describing the location. With Geonames, he shows how to call the service's "findNearbyPlaceName" method to find the closest "place" to a given latitude/longitude combination. Included is a bit of sample PHP to connect to the service and Javascript to request the user's current location.
2011-12-13 18:49:
DevShed.com has a new tutorial posted today looking at how to sanitize data in your application, specifically data coming from the user, when calling shell commands. Neglecting to sanitize user input that may subsequently be passed to system-level functions could allow attackers to do massive internal damage to your information store and operating system, deface or delete Web files, and otherwise gain unrestricted access to your server. And that's only the beginning. He starts with a "real world" example of non-filtered data that could pass through a "rm" command and erase your entire drive. He offers two solutions for preventing this sort of hack using the escapeshellcmd and escapeshellarg functions.
DevShed: Sanitizing Input with PHP
DevShed.com has a new tutorial posted today looking at how to sanitize data in your application, specifically data coming from the user, when calling shell commands. Neglecting to sanitize user input that may subsequently be passed to system-level functions could allow attackers to do massive internal damage to your information store and operating system, deface or delete Web files, and otherwise gain unrestricted access to your server. And that's only the beginning. He starts with a "real world" example of non-filtered data that could pass through a "rm" command and erase your entire drive. He offers two solutions for preventing this sort of hack using the escapeshellcmd and escapeshellarg functions.
2011-12-13 17:09:
Phil Sturgeon (an expert in all things related to the Fuel PHP framework) has written up a tutorial for NetTuts.com about creating a basic admin panel for your application based on the framework. This is the second part of a series looking at Fuel, building on the topics from the first. In the first part of this series, we took a look at the basics of the FuelPHP framework. In this second-part, we'll be stepping it up a gear and move onto some more advanced topics! We'll be creating an admin panel for our application, cover the common uses of the ORM and use the Authentication package to restrict access. He walks you through setting up Oil (the command-line tool that comes bundled with Fuel) and using it to create a new application. There's a few steps of configuration to connect to a database and setting up a few access groups (like "Banned", "Guests" and "Administrators"). Oil is used again to create users in the database and to auto-generate a lot of the controller/view code you'll need for the admin tool. He then gets into the more technical parts - updating the current code to be able to do things like using the ORM to fetch database results and being able to add comments to posts.
NetTuts.com: Build an Admin Panel with the Fuel PHP Framework
Phil Sturgeon (an expert in all things related to the Fuel PHP framework) has written up a tutorial for NetTuts.com about creating a basic admin panel for your application based on the framework. This is the second part of a series looking at Fuel, building on the topics from the first. In the first part of this series, we took a look at the basics of the FuelPHP framework. In this second-part, we'll be stepping it up a gear and move onto some more advanced topics! We'll be creating an admin panel for our application, cover the common uses of the ORM and use the Authentication package to restrict access. He walks you through setting up Oil (the command-line tool that comes bundled with Fuel) and using it to create a new application. There's a few steps of configuration to connect to a database and setting up a few access groups (like "Banned", "Guests" and "Administrators"). Oil is used again to create users in the database and to auto-generate a lot of the controller/view code you'll need for the admin tool. He then gets into the more technical parts - updating the current code to be able to do things like using the ORM to fetch database results and being able to add comments to posts.
2011-12-13 16:56:
Continuing on with his webcast series looking at using the Slim microframework to create a RESTful web service with JSON Output, John Lebensold takes the code from the previous tutorials (part one, two, three) and adds handling for DELETE to remove values from the data. This tutorial will show you how to add jQuery RESTful calls for using the DELETE verb when deleting items via a JSON REST interface. You'll definitely need to check out either the previous tutorials in the series to follow along with the code or grab the current source to see how everything's structured.
ZendCasts.com: RESTful Delete with SLIM, jQuery and JSON
Continuing on with his webcast series looking at using the Slim microframework to create a RESTful web service with JSON Output, John Lebensold takes the code from the previous tutorials (part one, two, three) and adds handling for DELETE to remove values from the data. This tutorial will show you how to add jQuery RESTful calls for using the DELETE verb when deleting items via a JSON REST interface. You'll definitely need to check out either the previous tutorials in the series to follow along with the code or grab the current source to see how everything's structured.
2011-12-13 15:23:
Bradley Holt has a new post to his blog announcing the Boston PHP Northwest Conference happening in August (2012) in Cambridge, Massachusetts: I'm excited to be able to announce that the first ever Boston PHP Northeast Conference will be taking place on Saturday, August 11th and Sunday, August 12th at Microsoft's NERD Center in Cambridge, MA. This regional event is intended for PHP beginners, enthusiasts, and professionals alike. The conference will not just cover PHP but also general web development topics with a dash of user experience thrown in. Three regional groups are hosting the event: BostonPHP, Burlington, VT user group and the Atlantic Canadian PHP user group.
Bradley Holt's Blog: Boston PHP Northeast Conference
Bradley Holt has a new post to his blog announcing the Boston PHP Northwest Conference happening in August (2012) in Cambridge, Massachusetts: I'm excited to be able to announce that the first ever Boston PHP Northeast Conference will be taking place on Saturday, August 11th and Sunday, August 12th at Microsoft's NERD Center in Cambridge, MA. This regional event is intended for PHP beginners, enthusiasts, and professionals alike. The conference will not just cover PHP but also general web development topics with a dash of user experience thrown in. Three regional groups are hosting the event: BostonPHP, Burlington, VT user group and the Atlantic Canadian PHP user group.
2011-12-13 14:03:
Latest PECL Releases: gearman 0.8.1
Community News: Latest PECL Releases for 12.13.2011
Latest PECL Releases: gearman 0.8.1
2011-12-12 19:34:
As is mentioned on CodeIgniter.com, they've set up a survey to find out more information about how PHP are using frameworks. The anonymous survey is very brief - just seven questions - and should take no more than five minutes or so to complete. The survey is open immediately and will remain open over the weekend. The seven questions on the survey include questions about framework usage, sets of how you feel about different framework-related topics, what editor you usually use (and for how long), how you usually interact with Git/Github. Go and voice your opinion now!
CodeIgniter.com: PHP Framework Usage Survey
As is mentioned on CodeIgniter.com, they've set up a survey to find out more information about how PHP are using frameworks. The anonymous survey is very brief - just seven questions - and should take no more than five minutes or so to complete. The survey is open immediately and will remain open over the weekend. The seven questions on the survey include questions about framework usage, sets of how you feel about different framework-related topics, what editor you usually use (and for how long), how you usually interact with Git/Github. Go and voice your opinion now!
2011-12-12 18:06:
In this new post from Watts Martin he suggests that "PHP is not an acceptable COBOL" - the language, while popular and useful now, may not age as well in the future (say 10 or 15 years). PHP is to the web what Visual Basic is to Windows, but even more so: a powerful enough language to do nearly anything you want, ubiquitous, easy to get up and running (on many web hosts it's pre-installed), and forgiving of shitty code. [...] While I'm happy to see PHP start getting "modern" language bits (you Lisp hackers, stop snickering), the more I'm exposed to modern PHP in practice the more I think it's doomed. [...] A friend compared PHP to the COBOL of the web, and indeed, that seems to be COBOL's philosophy, too. He also mentions some of the things available for PHP - frameworks, dependency management, PEAR, PECL - and some of his struggles with each. There's plenty of feedback on the post with some good interaction back from the post's author.
Watts Martin's Blog: PHP is not an acceptable COBOL
In this new post from Watts Martin he suggests that "PHP is not an acceptable COBOL" - the language, while popular and useful now, may not age as well in the future (say 10 or 15 years). PHP is to the web what Visual Basic is to Windows, but even more so: a powerful enough language to do nearly anything you want, ubiquitous, easy to get up and running (on many web hosts it's pre-installed), and forgiving of shitty code. [...] While I'm happy to see PHP start getting "modern" language bits (you Lisp hackers, stop snickering), the more I'm exposed to modern PHP in practice the more I think it's doomed. [...] A friend compared PHP to the COBOL of the web, and indeed, that seems to be COBOL's philosophy, too. He also mentions some of the things available for PHP - frameworks, dependency management, PEAR, PECL - and some of his struggles with each. There's plenty of feedback on the post with some good interaction back from the post's author.
2011-12-12 17:42:
On PHPMaster.com today Callum Hopkins has written up an introduction to the php.ini, the heart and soul of any PHP installation. With configuration options for just about everything, it can be confusing. This tutorial hits some of the highs and most commonly updated settings. Anyone who has a server using PHP has undoubtedly heard of php.ini - it's the configuration file used to control and customize PHP's run-time behavior. It provides a simple way to configure settings. [...] In this article I'll give an overview of some important settings I believe you should be concerned with when tweaking your own php.ini file. The tutorial's broken up into a few different topics: the PHP engine Short tags Output buffering Automatic headers and footers Handling errors Time zones
PHPMaster.com: A Tour of PHP.INI
On PHPMaster.com today Callum Hopkins has written up an introduction to the php.ini, the heart and soul of any PHP installation. With configuration options for just about everything, it can be confusing. This tutorial hits some of the highs and most commonly updated settings. Anyone who has a server using PHP has undoubtedly heard of php.ini - it's the configuration file used to control and customize PHP's run-time behavior. It provides a simple way to configure settings. [...] In this article I'll give an overview of some important settings I believe you should be concerned with when tweaking your own php.ini file. The tutorial's broken up into a few different topics: the PHP engine Short tags Output buffering Automatic headers and footers Handling errors Time zones
2011-12-12 16:17:
In a new post to his blog, Michelangelo van Dam starts off a series looking at Windows Azure for PHP developer, an introduction to the service and what sorts of features it has to offer. I'm a developer and I don't want to fiddle with setting up and maintaining an operating system, basically since I don't have the time for it. [...] I was completely sold when Josh Holmes came to Brussels in 2009 and told us more about what Windows Azure has to offer and how perfectly it is to build applications consuming these cloud services, without having to deal with setting up and maintaining the platform the run on. He points out just a few of the features of an Azure instance - pre-installed OS (similar to Windows 2008 Server + IIS7), the five types of storage available (including Queue, SQL Azure and Blob storage). He also mentions working with file uploads, sessions, caching, database interaction and a brief comparison of cloud versus non-cloud scaling methods. In the next part of his series, he'll get more practical and show how to set up a Zend Framework application on an Azure instance.
Michaelangelo van Dam' Blog: Windows Azure for PHP developers
In a new post to his blog, Michelangelo van Dam starts off a series looking at Windows Azure for PHP developer, an introduction to the service and what sorts of features it has to offer. I'm a developer and I don't want to fiddle with setting up and maintaining an operating system, basically since I don't have the time for it. [...] I was completely sold when Josh Holmes came to Brussels in 2009 and told us more about what Windows Azure has to offer and how perfectly it is to build applications consuming these cloud services, without having to deal with setting up and maintaining the platform the run on. He points out just a few of the features of an Azure instance - pre-installed OS (similar to Windows 2008 Server + IIS7), the five types of storage available (including Queue, SQL Azure and Blob storage). He also mentions working with file uploads, sessions, caching, database interaction and a brief comparison of cloud versus non-cloud scaling methods. In the next part of his series, he'll get more practical and show how to set up a Zend Framework application on an Azure instance.
2011-12-12 15:58:
Andrew Johnstone has a new post to his blog with a look at using Vagrant for continuous deployment of a PHP-based application. Vagrant is simply a wrapper around Virtualbox headless that allows for provisioning virtual machines with support for puppet, chef-solo, chef, and bash. This allows you to automate the deployment and sandboxing of development sites. Additional base box images can be found at vagrantbox.es. He walks you through the full process of setting up a first deployment - getting Vagrant installed, updating the config for a squeeze64.box image, configuring a virtualhost on the Apache web server and setting up a "preinstall" script to configure things like MySQL and install a long list of packages (via apt-get).
Andrew Johnstone's Blog: Vagrant, Automating PHP/MySQL Installation with bash/slack
Andrew Johnstone has a new post to his blog with a look at using Vagrant for continuous deployment of a PHP-based application. Vagrant is simply a wrapper around Virtualbox headless that allows for provisioning virtual machines with support for puppet, chef-solo, chef, and bash. This allows you to automate the deployment and sandboxing of development sites. Additional base box images can be found at vagrantbox.es. He walks you through the full process of setting up a first deployment - getting Vagrant installed, updating the config for a squeeze64.box image, configuring a virtualhost on the Apache web server and setting up a "preinstall" script to configure things like MySQL and install a long list of packages (via apt-get).
2011-12-12 14:02:
Latest PEAR Releases: Net_DNS2 1.2.0 Validate_ES 0.6.1 Tree 0.3.5 Image_Barcode 1.1.2 Image_Barcode2 0.1.0 DB_ldap 1.2.1 Services_Weather 1.4.6 Services_Blogging 0.2.4 Text_Highlighter 0.7.2 Net_FTP 1.4.0a3 Numbers_Words 0.16.3 pearweb_qa 1.0.3 XML_FastCreate 1.0.4 XML_SVG 1.1.0 File_Sitemap 0.1.4 HTML_Progress2 2.4.2 I18N_UnicodeString 0.3.0 Validate_AR 0.1.2 HTTP_WebDAV_Client 1.0.2 Benchmark 1.2.9 PHP_DocBlockGenerator 1.1.2
Community News: Latest PEAR Releases for 12.12.2011
Latest PEAR Releases: Net_DNS2 1.2.0 Validate_ES 0.6.1 Tree 0.3.5 Image_Barcode 1.1.2 Image_Barcode2 0.1.0 DB_ldap 1.2.1 Services_Weather 1.4.6 Services_Blogging 0.2.4 Text_Highlighter 0.7.2 Net_FTP 1.4.0a3 Numbers_Words 0.16.3 pearweb_qa 1.0.3 XML_FastCreate 1.0.4 XML_SVG 1.1.0 File_Sitemap 0.1.4 HTML_Progress2 2.4.2 I18N_UnicodeString 0.3.0 Validate_AR 0.1.2 HTTP_WebDAV_Client 1.0.2 Benchmark 1.2.9 PHP_DocBlockGenerator 1.1.2
2011-12-09 20:14:
On the Nelm.io blog today there's a new post (part one of a series) about using Composer and Packagist to manage PHP applications as packages. You may have heard about Composer and Packagist lately. In short, Composer is a new package manager for PHP libraries. Quite a few people have been complaining about the lack of information, or just seemed confused as to what it was, or why the hell we would do such a thing. This is my attempt at clarifying things. The briefly explains what the tool(s) do and shows how to set up the configuration on both sides - Composer to manage the packages and the package definition configurations (including meta about the project and any dependencies). He also answers several "why" questions about the need for a package manager, using this versus PEAR, the choice of JSON for config definition and a current status of the project.
Nelm.io Blog: Composer: Part 1 - What & Why
On the Nelm.io blog today there's a new post (part one of a series) about using Composer and Packagist to manage PHP applications as packages. You may have heard about Composer and Packagist lately. In short, Composer is a new package manager for PHP libraries. Quite a few people have been complaining about the lack of information, or just seemed confused as to what it was, or why the hell we would do such a thing. This is my attempt at clarifying things. The briefly explains what the tool(s) do and shows how to set up the configuration on both sides - Composer to manage the packages and the package definition configurations (including meta about the project and any dependencies). He also answers several "why" questions about the need for a package manager, using this versus PEAR, the choice of JSON for config definition and a current status of the project.
2011-12-09 19:50:
In this new tutorial from PHPBuilder.com, Jason Gilmore shows you some of the more advanced things you can do with arrays in PHP (specifically in the areas of iterating through them and manipulating their contents). Sporting more than 70 native array-related functions, PHP's array manipulation capabilities have long been one of the language's most attractive features. [...] There are however many array-related tasks which ask a bit more of the developer than merely knowing what part of the manual one needs to consult. Many such tasks require a somewhat more in-depth understanding of the native features, or are possible only when a bit of imagination is applied to the problem. In his examples he shows how to do things like sorting a multi-dimensional array, iterating recursively (with the help of a RecursiveArrayIterator), converting an object to an array and doing "natural" sorting on an array's contents.
PHPBuilder.com: PHP Arrays: Advanced Iteration and Manipulation
In this new tutorial from PHPBuilder.com, Jason Gilmore shows you some of the more advanced things you can do with arrays in PHP (specifically in the areas of iterating through them and manipulating their contents). Sporting more than 70 native array-related functions, PHP's array manipulation capabilities have long been one of the language's most attractive features. [...] There are however many array-related tasks which ask a bit more of the developer than merely knowing what part of the manual one needs to consult. Many such tasks require a somewhat more in-depth understanding of the native features, or are possible only when a bit of imagination is applied to the problem. In his examples he shows how to do things like sorting a multi-dimensional array, iterating recursively (with the help of a RecursiveArrayIterator), converting an object to an array and doing "natural" sorting on an array's contents.
2011-12-09 18:13:
DevShed concludes their three-part series about building an ORM in PHP with this latest article. It introduces the idea of dependency injection into the mix, showing how it can be used in the relationships between entities. if you've already read the two installments that precede this one, it's probable that you're familiar with the inner workings of this sample ORM. In those chapters I implemented the ORM's data access and mapping layers, along with a simple domain model. To be frank, the development of this last tier is entirely optional; however, it's useful for demonstrating the ORM's actual functionality in the deployment of a blog program, which naturally will handle some "typical" domain objects, namely blog entries, comments and authors. They share the code for creating proxy objects and, using a "poor man's dependency injection container" made from a factory method, interfaces and service classes to handle the results.
Devshed: Building a PHP ORM: Deploying a Blog
DevShed concludes their three-part series about building an ORM in PHP with this latest article. It introduces the idea of dependency injection into the mix, showing how it can be used in the relationships between entities. if you've already read the two installments that precede this one, it's probable that you're familiar with the inner workings of this sample ORM. In those chapters I implemented the ORM's data access and mapping layers, along with a simple domain model. To be frank, the development of this last tier is entirely optional; however, it's useful for demonstrating the ORM's actual functionality in the deployment of a blog program, which naturally will handle some "typical" domain objects, namely blog entries, comments and authors. They share the code for creating proxy objects and, using a "poor man's dependency injection container" made from a factory method, interfaces and service classes to handle the results.
2011-12-09 17:08:
Brian Swan has a recent post to his MSDN blog about setting up PHPUnit for testing on a Windows Azure platform (as installed via PEAR). After figuring out how to run PHPUnit from the command line in a Windows Azure instance, I did find that a bit more configuration work than I anticipated was necessary. I'm not 100% certain that this is the best way to run PHPUnit in Windows Azure, but it is one way. I'd be interested in hearing better ways to do this. He breaks it up into a few different steps: Building the application with your tests locally Package the application up for Azure deployment Enable RDP access on your Azure instance Find your PHP and PEAR install on your instance and, logged in via RDP, add their locations to your current path Edit the phpunit.bat file to point to the right PHP location Execute the tests! For other options for testing Azure-based applications, see Brian's previous post.
Brian Swan's Blog: Running PHPUnit in Windows Azure
Brian Swan has a recent post to his MSDN blog about setting up PHPUnit for testing on a Windows Azure platform (as installed via PEAR). After figuring out how to run PHPUnit from the command line in a Windows Azure instance, I did find that a bit more configuration work than I anticipated was necessary. I'm not 100% certain that this is the best way to run PHPUnit in Windows Azure, but it is one way. I'd be interested in hearing better ways to do this. He breaks it up into a few different steps: Building the application with your tests locally Package the application up for Azure deployment Enable RDP access on your Azure instance Find your PHP and PEAR install on your instance and, logged in via RDP, add their locations to your current path Edit the phpunit.bat file to point to the right PHP location Execute the tests! For other options for testing Azure-based applications, see Brian's previous post.
2011-12-09 16:40:
On the VG Tech blog today there's another post related to unit testing (here's one from before) but this time they're talking about mocking the filesystem with vfsStream, a powerful tool that lets you interact with PHP streams as a virtual file system. This article is about how to mock the file system when writing unit tests, and it will be rather code-heavy. [...] PHPUnit is the de-facto standard for unit testing in PHP projects, and this is what we will be using together with vfsStream in this article. The include the code for a simple storage driver (VGF_Storage_Driver_Filesystem) to use with vfsStream with "store", "delete" and "get" methods. Also included are examples of using vfsStream to check things like directory existence, if a file exists, or if a file can be read. A few simple assertions are set up in their sample test to check the methods in their "VGF_Storage_Driver_Filesystem" class.
VG Tech Blog: Mocking the File System Using PHPUnit and vfsStream
On the VG Tech blog today there's another post related to unit testing (here's one from before) but this time they're talking about mocking the filesystem with vfsStream, a powerful tool that lets you interact with PHP streams as a virtual file system. This article is about how to mock the file system when writing unit tests, and it will be rather code-heavy. [...] PHPUnit is the de-facto standard for unit testing in PHP projects, and this is what we will be using together with vfsStream in this article. The include the code for a simple storage driver (VGF_Storage_Driver_Filesystem) to use with vfsStream with "store", "delete" and "get" methods. Also included are examples of using vfsStream to check things like directory existence, if a file exists, or if a file can be read. A few simple assertions are set up in their sample test to check the methods in their "VGF_Storage_Driver_Filesystem" class.
2011-12-09 15:52:
Josh Adell recently attended to Raleigh, North Carolina arm of the CodeWorks conference and has posted about some of his experience there (and specifics on each presentation). I had a great time at CodeWorks 2011 in Raleigh this week, put on by the great folks at php|architect. Here is a rundown of the presentations, with some of my thoughts. [...] To all the conference speakers, organizers and attendees, I want to say thank you for a fun and educational experience. The sessions for this stop on the tour were: "CI:IRL" by Beth Tucker Long "How Beer Made Me a Better Developer" by Jason Austin "What's new in PHP 5.4" by Cal Evans "Refactoring and Other Small Animals" by Marco Tabini "jQuery Mobile and Phonegap" by Terry Ryan "REST Best Practices" by Keith Casey
Josh Adell's Blog: Codeworks '11 Raleigh Rundown
Josh Adell recently attended to Raleigh, North Carolina arm of the CodeWorks conference and has posted about some of his experience there (and specifics on each presentation). I had a great time at CodeWorks 2011 in Raleigh this week, put on by the great folks at php|architect. Here is a rundown of the presentations, with some of my thoughts. [...] To all the conference speakers, organizers and attendees, I want to say thank you for a fun and educational experience. The sessions for this stop on the tour were: "CI:IRL" by Beth Tucker Long "How Beer Made Me a Better Developer" by Jason Austin "What's new in PHP 5.4" by Cal Evans "Refactoring and Other Small Animals" by Marco Tabini "jQuery Mobile and Phonegap" by Terry Ryan "REST Best Practices" by Keith Casey
2011-12-09 14:03:
Popular posts from PHPDeveloper.org for the past week:Joshua Thijssen's Blog: Compatible code: starting with symfony2 NetTuts.com: Wrangling with the Facebook Graph API Jake Smith's Blog: Callback Filter Iterator in PHP 5.3/5.4 DZone.com: Codeigniter and Object-Oriented PHP: Two Guides PHPClasses.org: Lately in PHP Podcast Episode 18 - The Debate on Remote Work for Web Developers DevArticles.com: Singletons in PHP Elizabeth Naramore's Blog: PHP Internals, Let's Chat About the Future! Reddit.com: Should I be doing just about everything using REST? Lukas Smith's Blog: Loose interface coupling Community News: PHP Advent 2011
Site News: Popular Posts for the Week of 12.09.2011
Popular posts from PHPDeveloper.org for the past week:Joshua Thijssen's Blog: Compatible code: starting with symfony2 NetTuts.com: Wrangling with the Facebook Graph API Jake Smith's Blog: Callback Filter Iterator in PHP 5.3/5.4 DZone.com: Codeigniter and Object-Oriented PHP: Two Guides PHPClasses.org: Lately in PHP Podcast Episode 18 - The Debate on Remote Work for Web Developers DevArticles.com: Singletons in PHP Elizabeth Naramore's Blog: PHP Internals, Let's Chat About the Future! Reddit.com: Should I be doing just about everything using REST? Lukas Smith's Blog: Loose interface coupling Community News: PHP Advent 2011
2011-12-08 19:59:
If you've ever wanted to start from scratch and wanted to build your own PHP framework, you might want to take a look at this list. It's a set of thirteen good resources to help you get started and introduce you to some of the basic framework concepts. Frameworks serve as basics for developing a theory, condition and design in broader sense but in the world of web site development, framework means applications that help you in creating something new or something most popular around the web. We have listed top php framework tutorials for your convenience so that you can have a good idea of how to create a framework if you are not satisfied with one listed by us. Tutorials in the list include: A three-part series on NetTuts.com A Framework in an Hour Tiny MVC Boilerplate with PHP Write your own PHP5 MVC framework
Wokay.com: 12+ Tutorials for creating PHP5 MVC Framework
If you've ever wanted to start from scratch and wanted to build your own PHP framework, you might want to take a look at this list. It's a set of thirteen good resources to help you get started and introduce you to some of the basic framework concepts. Frameworks serve as basics for developing a theory, condition and design in broader sense but in the world of web site development, framework means applications that help you in creating something new or something most popular around the web. We have listed top php framework tutorials for your convenience so that you can have a good idea of how to create a framework if you are not satisfied with one listed by us. Tutorials in the list include: A three-part series on NetTuts.com A Framework in an Hour Tiny MVC Boilerplate with PHP Write your own PHP5 MVC framework
2011-12-08 18:22:
On PHPMaster.com today there's a new tutorial that wants to help you "untangle MVC" with the help of the CodeIgniter framework. The tutorial is an introduction to the Model/View/Controller design pattern and how it's implemented in this popular framework. If you want to develop applications with sell-structured, readable code that you can quickly diagnose problems in, then MVC is for you. In this article I'll untangle the mysteries of MVC for you using CodeIgniter, a PHP framework based on the MVC pattern. I'll first present a high level overview of MVC, what it is and how it can help you to become a better programmer, and then guide you through writing a simple web form the CodeIgniter way so you can see how the pattern looks in action. They briefly describe MVC (favoring instead for showing it later in the CodeIgniter examples) and help you get a copy of the framework installed. They show you how to create a first controller, the corresponding view and make a model that extends the base and inserts address information into a database table.
PHPMaster.com: Untangling MVC with CodeIgniter
On PHPMaster.com today there's a new tutorial that wants to help you "untangle MVC" with the help of the CodeIgniter framework. The tutorial is an introduction to the Model/View/Controller design pattern and how it's implemented in this popular framework. If you want to develop applications with sell-structured, readable code that you can quickly diagnose problems in, then MVC is for you. In this article I'll untangle the mysteries of MVC for you using CodeIgniter, a PHP framework based on the MVC pattern. I'll first present a high level overview of MVC, what it is and how it can help you to become a better programmer, and then guide you through writing a simple web form the CodeIgniter way so you can see how the pattern looks in action. They briefly describe MVC (favoring instead for showing it later in the CodeIgniter examples) and help you get a copy of the framework installed. They show you how to create a first controller, the corresponding view and make a model that extends the base and inserts address information into a database table.
2011-12-08 17:01:
In a new post to his blog Ilia Alshanetsky takes a look at PHP's output buffering feature and some interesting things he found when testing some recent code (hint: it has to do with PHP's "interesting" management of the buffer). While profiling our application I came across a a rather strange memory usage by the ob_start() function. We do use ob_start() quite a bit to defer output of data, which is a common thing in many applications. What was unusual is that 16 calls to ob_start() up chewing through almost 700kb of memory, given that the data being buffered rarely exceeds 1-2kb, this was quite unusual. Through a bit more testing he found that, if a buffer provided for content isn't enough, PHP automatically bumps it up by 10kb each time - a waste of resources if you only need a small subset of that. He includes a small patch he made to the PHP core API that allows for defining a custom buffer size and, if it's not enough, bumps up the buffer size by 1kb instead of 10kb.
Ilia Alshanetsky's Blog: PHP's Output Buffering
In a new post to his blog Ilia Alshanetsky takes a look at PHP's output buffering feature and some interesting things he found when testing some recent code (hint: it has to do with PHP's "interesting" management of the buffer). While profiling our application I came across a a rather strange memory usage by the ob_start() function. We do use ob_start() quite a bit to defer output of data, which is a common thing in many applications. What was unusual is that 16 calls to ob_start() up chewing through almost 700kb of memory, given that the data being buffered rarely exceeds 1-2kb, this was quite unusual. Through a bit more testing he found that, if a buffer provided for content isn't enough, PHP automatically bumps it up by 10kb each time - a waste of resources if you only need a small subset of that. He includes a small patch he made to the PHP core API that allows for defining a custom buffer size and, if it's not enough, bumps up the buffer size by 1kb instead of 10kb.
2011-12-08 16:13:
On the VG Tech blog today there's a new post from André Roaldseth about using PHPUnit to test PHP streams, basing the assertions on the data rather than the functionality itself. Using the memory/temporary stream provided by php:// stream wrapper you can create a stream with read and write access directly to RAM or to a temporary file [using "php://memory"]. This gives you the possibilty to write unit tests that does not rely on a specific file, resource or stream, but rather on data provided by the test itself. There's no specific code examples here, but you can refer to the stream wrappers section of the PHP manual for more details on this and other handy built-in streams. Once created, it can then be used just as any other stream resource can. This could be useful to provide mocks in your testing, replacing any other stream-able resource with a "memory" or "temp" placeholder.
VG Tech Blog: Unit Testing with Streams in PHP
On the VG Tech blog today there's a new post from André Roaldseth about using PHPUnit to test PHP streams, basing the assertions on the data rather than the functionality itself. Using the memory/temporary stream provided by php:// stream wrapper you can create a stream with read and write access directly to RAM or to a temporary file [using "php://memory"]. This gives you the possibilty to write unit tests that does not rely on a specific file, resource or stream, but rather on data provided by the test itself. There's no specific code examples here, but you can refer to the stream wrappers section of the PHP manual for more details on this and other handy built-in streams. Once created, it can then be used just as any other stream resource can. This could be useful to provide mocks in your testing, replacing any other stream-able resource with a "memory" or "temp" placeholder.
2011-12-08 15:48:
Volker Dusch has posted his review of a recent release from SitePoint Press - "PHP Masters - Write Cutting Edge Code". The book is solid, well written and covers the most important topics that people need to think about when starting off with PHP. It is one of the few PHP book on the market that you can pass on to your trainees/junior developers without having to "unteach" them half of the taught bad practices afterwards. This is a great achievement in my mind and I'd definitely recommend checking it out and passing it on to your trainees and 'junior developers' ... maybe read it first yourself and rip out a few pages in chapter 4. His "long version" gets into a more complete list of his thoughts on each of the individual chapters (including "object oriented programming", "APIs", "design patterns" and "security"). Overall, he found the book good, but pointed out a few areas where it was lacking. You can find more detail about the book here (or on Amazon here)
Volker Dusch's Blog: Book Review: PHP Masters
Volker Dusch has posted his review of a recent release from SitePoint Press - "PHP Masters - Write Cutting Edge Code". The book is solid, well written and covers the most important topics that people need to think about when starting off with PHP. It is one of the few PHP book on the market that you can pass on to your trainees/junior developers without having to "unteach" them half of the taught bad practices afterwards. This is a great achievement in my mind and I'd definitely recommend checking it out and passing it on to your trainees and 'junior developers' ... maybe read it first yourself and rip out a few pages in chapter 4. His "long version" gets into a more complete list of his thoughts on each of the individual chapters (including "object oriented programming", "APIs", "design patterns" and "security"). Overall, he found the book good, but pointed out a few areas where it was lacking. You can find more detail about the book here (or on Amazon here)
2011-12-07 21:44:
php|architect has officially announced their php|tek conference for 2012 and have opened their Call for Papers: The simple answer is to the question "What topics are you looking for" is: anything that helps inspire PHP developers to do their jobs better, more easily, and more efficiently. [...] Most importantly, we do not necessarily look for talks that are about PHP. Some of the most successful presentations over the years have been on products built on PHP (like frameworks) and on technologies that are tangential to it (e.g.: Apache, JavaScript, databases, and so on). The deadline to submit is December 31st for the two types of sessions - tutorials (3 or 6 hours long) and regular talks (50 minutes). You can manage your proposals via the php|architect website.
Community News: php|archtect Announces php|tek 2012 (and Call for Papers)
php|architect has officially announced their php|tek conference for 2012 and have opened their Call for Papers: The simple answer is to the question "What topics are you looking for" is: anything that helps inspire PHP developers to do their jobs better, more easily, and more efficiently. [...] Most importantly, we do not necessarily look for talks that are about PHP. Some of the most successful presentations over the years have been on products built on PHP (like frameworks) and on technologies that are tangential to it (e.g.: Apache, JavaScript, databases, and so on). The deadline to submit is December 31st for the two types of sessions - tutorials (3 or 6 hours long) and regular talks (50 minutes). You can manage your proposals via the php|architect website.
2011-12-07 19:41:
In this new post to Reddit.com, the question is asked "Should I be doing just about everything using REST?" - wondering if their new applications should all sit on top of a web service for their functionality. I'm pretty new to server-side programming, and actually started out with Python/mod-wsgi. From the ground up, mod-wsgi made a lot of sense. The server gets a request, you route the request. It feels like that's where I should start, so that's pretty much what I'm trying to create with PHP (a REST router - for learning purposes, I know frameworks exist). I'm trying to think of a situation where I wouldn't use a REST interface, but I can't seem to think of one (even for simple cases). Would it be safe to say that using REST is a pretty safe bet, most of the time? There's some good discussion and answers to his question touching on things like Service Oriented Architectures, some implications of having a web service power an entire application (or applications) and a few comments with some personal experience. A comment about SOA sums it up well: You learn to write for your platform in the way developers/partners will have to, so you produce a good quality usable API which encourages development and consumption of your platform.
Reddit.com: Should I be doing just about everything using REST?
In this new post to Reddit.com, the question is asked "Should I be doing just about everything using REST?" - wondering if their new applications should all sit on top of a web service for their functionality. I'm pretty new to server-side programming, and actually started out with Python/mod-wsgi. From the ground up, mod-wsgi made a lot of sense. The server gets a request, you route the request. It feels like that's where I should start, so that's pretty much what I'm trying to create with PHP (a REST router - for learning purposes, I know frameworks exist). I'm trying to think of a situation where I wouldn't use a REST interface, but I can't seem to think of one (even for simple cases). Would it be safe to say that using REST is a pretty safe bet, most of the time? There's some good discussion and answers to his question touching on things like Service Oriented Architectures, some implications of having a web service power an entire application (or applications) and a few comments with some personal experience. A comment about SOA sums it up well: You learn to write for your platform in the way developers/partners will have to, so you produce a good quality usable API which encourages development and consumption of your platform.
2011-12-07 18:35:
If you're a regular reader of PHPDeveloper.org, you know that there's a few articles posted here (almost) daily about what's happening in the PHP world. Unfortunately, this only scratches the surface of the quality content that's out there. In an effort to provide more PHP goodness to the community as a whole, PHP Quick Fix has been launched - a service linking to stories that don't make it on PHPDeveloper.org. All of the stories on PHP Quick Fix (you can also follow it on twitter) are still hand-selected out of the mounds of PHP content that shows every day to ensure the best quality. There's no automatic syndication here - just more good, useful PHP (and related topics) to add to your day. Additionally, if you're interested to see how it all works (thanks to a GimmeBar backend) check out this post on blog.phpdeveloper.org.
Community News: Packing more PHP News in your day with PHP Quick Fix
If you're a regular reader of PHPDeveloper.org, you know that there's a few articles posted here (almost) daily about what's happening in the PHP world. Unfortunately, this only scratches the surface of the quality content that's out there. In an effort to provide more PHP goodness to the community as a whole, PHP Quick Fix has been launched - a service linking to stories that don't make it on PHPDeveloper.org. All of the stories on PHP Quick Fix (you can also follow it on twitter) are still hand-selected out of the mounds of PHP content that shows every day to ensure the best quality. There's no automatic syndication here - just more good, useful PHP (and related topics) to add to your day. Additionally, if you're interested to see how it all works (thanks to a GimmeBar backend) check out this post on blog.phpdeveloper.org.
2011-12-07 17:19:
Over on the Mayflower blog, the group has set up their own series of "advent calendar" posts on a wide range of topics. Here's their list (updated as new items are posted): Cloud Transformation Model PHP 5.3 Features in Real Life (German) Setting up a QA environment for Javascript Generating PDFs in PHP (German) Doctrine 2 Doctrine 2 - Zend Framework Integration One-click Deployment They're a mix of English and German articles, but with a handy translator you can follow along pretty well.
Mayflower Blog: Advent Calendar Articles
Over on the Mayflower blog, the group has set up their own series of "advent calendar" posts on a wide range of topics. Here's their list (updated as new items are posted): Cloud Transformation Model PHP 5.3 Features in Real Life (German) Setting up a QA environment for Javascript Generating PDFs in PHP (German) Doctrine 2 Doctrine 2 - Zend Framework Integration One-click Deployment They're a mix of English and German articles, but with a handy translator you can follow along pretty well.
2011-12-07 16:56:
If you're new to the PHP language and are looking for the full scoop on working with the string datatype, look no further than this new post from Mrinmoy Ghoshal. It's an excellent (and quite complete) resource for just about everything involving strings in PHP. A string is series of characters, where a character is the same as a byte. This means that PHP only supports a 256-character set, and hence does not offer native Unicode support. See details of the string type. The tutorial is broken up into different sections for easier consumption: Single quoted Double quoted Heredoc Nowdoc Variable parsing String access and modification by character Useful functions and operators Converting to string String conversion to numbers Details of the String Type
Mrinmoy Ghoshal's Blog: Concept of Strings:PHP
If you're new to the PHP language and are looking for the full scoop on working with the string datatype, look no further than this new post from Mrinmoy Ghoshal. It's an excellent (and quite complete) resource for just about everything involving strings in PHP. A string is series of characters, where a character is the same as a byte. This means that PHP only supports a 256-character set, and hence does not offer native Unicode support. See details of the string type. The tutorial is broken up into different sections for easier consumption: Single quoted Double quoted Heredoc Nowdoc Variable parsing String access and modification by character Useful functions and operators Converting to string String conversion to numbers Details of the String Type
2011-12-07 15:42:
PHPFog, the PHP-centric platform as a service has made a new post to this blog about two new "gifts" they're providing to developers: I want to thank you for your interest in PHP Fog. Thanks to you and tens of thousands of developers like you, we have grown massively in the last year and a half. As a sign of my gratitude, I'd like to give you two free gifts. Their gifts to the community are a conversion of the 6 month applications over to a free-for-life product and you can now deploy three of these "free forever" applications instead of just the one. You can signup here for the service with offerings of installed software like PyroCMS, Drupal 7, MediaWiki and Slim. For more information, you can attend this webinar.
Community News: PHPFog Gifts Free-for-Life Applications
PHPFog, the PHP-centric platform as a service has made a new post to this blog about two new "gifts" they're providing to developers: I want to thank you for your interest in PHP Fog. Thanks to you and tens of thousands of developers like you, we have grown massively in the last year and a half. As a sign of my gratitude, I'd like to give you two free gifts. Their gifts to the community are a conversion of the 6 month applications over to a free-for-life product and you can now deploy three of these "free forever" applications instead of just the one. You can signup here for the service with offerings of installed software like PyroCMS, Drupal 7, MediaWiki and Slim. For more information, you can attend this webinar.
2011-12-06 18:02:
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". Option 3) doesn't exist today and is what this blog post is about. He introduces the idea of a "spl_register_compatible_interface" method that would let you compare interfaces to see if they'd mesh. There'd still have to be a lot of communication between developers to make things match, though. He suggests three "practical issues" that libraries/tools would have to overcome to use a system like this - each framework has their own interface setup, the lead time for collaboration could be too much to be worthwhile, a lack of interest from some about collaboration and the idea of competing interface methods. He's looking for feedback from the community on the idea(s) though, so go and leave a comment with your thoughts!
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". Option 3) doesn't exist today and is what this blog post is about. He introduces the idea of a "spl_register_compatible_interface" method that would let you compare interfaces to see if they'd mesh. There'd still have to be a lot of communication between developers to make things match, though. He suggests three "practical issues" that libraries/tools would have to overcome to use a system like this - each framework has their own interface setup, the lead time for collaboration could be too much to be worthwhile, a lack of interest from some about collaboration and the idea of competing interface methods. He's looking for feedback from the community on the idea(s) though, so go and leave a comment with your thoughts!
2011-12-06 17:17:
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. This is simply an elegant masquerade for creating a global access point (which in most cases is mutable as well) throughout an entire application. And we all know that global, mutable access is unquestionably a bad thing that must be avoided at all costs. In this first part (of two) of the series they introduce the Singleton pattern and show how, via an example of using a database adapter interface to work with a MySQL database, in a tightly coupled example. In the second part of the series, they'll show how to break these apart using dependency injection.
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. This is simply an elegant masquerade for creating a global access point (which in most cases is mutable as well) throughout an entire application. And we all know that global, mutable access is unquestionably a bad thing that must be avoided at all costs. In this first part (of two) of the series they introduce the Singleton pattern and show how, via an example of using a database adapter interface to work with a MySQL database, in a tightly coupled example. In the second part of the series, they'll show how to break these apart using dependency injection.
2011-12-06 16:56:
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: Codeigniter for the absolute beginner Developing dynamic Web sites with CodeIgniter The second tutorial is a little older, but the functionality of the framework hasn't changed dramatically since then so most of it should still apply.
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: Codeigniter for the absolute beginner Developing dynamic Web sites with CodeIgniter The second tutorial is a little older, but the functionality of the framework hasn't changed dramatically since then so most of it should still apply.
2011-12-06 15:28:
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 normal iterator you'd have to define standard functions (like valid, rewind or key). Using the IteratorAggregate you can push items into an internal array (like chapters in a book) and call a "getIterator" method to get this set. He also takes it one step further and shows implementing the "Count" interface to make it easier to get a total count of the items in the iterator. Sample code is included to help clarify.
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 normal iterator you'd have to define standard functions (like valid, rewind or key). Using the IteratorAggregate you can push items into an internal array (like chapters in a book) and call a "getIterator" method to get this set. He also takes it one step further and shows implementing the "Count" interface to make it easier to get a total count of the items in the iterator. Sample code is included to help clarify.
2011-12-06 14:09:
Latest PECL Releases: intl 2.0.0b1 gearman 1.0.0 gmagick 1.0.10b1 functional 0.0.5 gearman 1.0.1
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
2011-12-05 20:56:
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 your opinion in a friendly panel discussion about where you'd like to see PHP in 5 years, then I'd love to chat with you and include you in the discussion. So, if you've worked on the internals of the language and would like to be in on the discussion, let Elizabeth know by dropping her an email that you're interested!
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 your opinion in a friendly panel discussion about where you'd like to see PHP in 5 years, then I'd love to chat with you and include you in the discussion. So, if you've worked on the internals of the language and would like to be in on the discussion, let Elizabeth know by dropping her an email that you're interested!
2011-12-05 19:26:
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 PHPUnit on our servers we were no longer able to test our Zend Framework applications. One option was to downgrade PHPUnit, but since we were already using some of the new features this was not going to happen. He method uses the "installroot" option that can be passed in to the PHPUnit installation process to point it to someplace other than the default PEAR install location. A small change is needed to the "phpunit" executable to have it correctly set the include path. Then it's just a matter of making a symlink to your "/usr/bin" directory pointing to the specific version.
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 PHPUnit on our servers we were no longer able to test our Zend Framework applications. One option was to downgrade PHPUnit, but since we were already using some of the new features this was not going to happen. He method uses the "installroot" option that can be passed in to the PHPUnit installation process to point it to someplace other than the default PEAR install location. A small change is needed to the "phpunit" executable to have it correctly set the include path. Then it's just a matter of making a symlink to your "/usr/bin" directory pointing to the specific version.
2011-12-05 18:48:
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 and configured in an instant. My recipe basically follows Christer's instructions and because I distribute phpunit's command along with it, editing of the file is no longer required: when the chef run completes, phpunit34 is installed and ready to be used. He includes the configuration needed to create a recipe for PHPUnit installation including how to use chef-solo to automate the install. It uses a "cookbook" from Till's collection on github to do some of the work for you. You can find out more about Chef on the OpsCode site.
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 and configured in an instant. My recipe basically follows Christer's instructions and because I distribute phpunit's command along with it, editing of the file is no longer required: when the chef run completes, phpunit34 is installed and ready to be used. He includes the configuration needed to create a recipe for PHPUnit installation including how to use chef-solo to automate the install. It uses a "cookbook" from Till's collection on github to do some of the work for you. You can find out more about Chef on the OpsCode site.
2011-12-05 17:03:
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 lets you enjoy the speed of unit tests after the initial warmup: if you always use the same data, no duplicate requests will be made to the external resource. He includes example code for creating a test (with PHPUnit) that loads in the information from the Google Maps web service and caches it into a private variable inside the Fake. His test fails the first time checking for a difference in the time between fetching the real version and the cached version (fails the first time, but passes after the cache is implemented).
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 lets you enjoy the speed of unit tests after the initial warmup: if you always use the same data, no duplicate requests will be made to the external resource. He includes example code for creating a test (with PHPUnit) that loads in the information from the Google Maps web service and caches it into a private variable inside the Fake. His test fails the first time checking for a difference in the time between fetching the real version and the cached version (fails the first time, but passes after the cache is implemented).
2011-12-05 16:15:
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 downloading the mp3 directly to listen at your leisure.
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 downloading the mp3 directly to listen at your leisure.
2011-12-05 15:50:
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 beautiful, eye-catching data. The library is free for non-profit use and for inclusion in GPL distributed software; licensing plans for other uses start at just 50 Euro. In this article I'll take you through installing pChart and using it to generate a basic chart, line chart and plot graph. He walks you through the download and installation of the tool as well as showing the code you'll need to include to get started with a first script. Their examples show how to create both single- and three-series charts with some sample data and some screenshots of output.
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 beautiful, eye-catching data. The library is free for non-profit use and for inclusion in GPL distributed software; licensing plans for other uses start at just 50 Euro. In this article I'll take you through installing pChart and using it to generate a basic chart, line chart and plot graph. He walks you through the download and installation of the tool as well as showing the code you'll need to include to get started with a first script. Their examples show how to create both single- and three-series charts with some sample data and some screenshots of output.
2011-12-05 14:02:
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
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
2011-12-02 20:37:
On the NetTuts.com site today they have a (very complete) guide to help you wrangle the Facebook Graph API and make it useful for your application. It makes use of the official Facebook PHP SDK to interface with the Graph API. Have you ever wanted to learn how to make your applications more social with Facebook? It's much easier than you think! In this tutorial, we'll be building an application that reads and publishes data to and from Facebook using Facebook's Graph API. The tutorial helps you get signed up on the Facebook developer site, create a first sample application, set up the SDK and make a simple page (with an added bonus of using the Twitter Boostrap for look/feed). There's a section covering permissions, what kind of data you can expect publicly for both users and posts. They wrap it up with an example of posting back to Facebook though the API and updating the status on your account. The complete code for the tutorial is also available for download.
NetTuts.com: Wrangling with the Facebook Graph API
On the NetTuts.com site today they have a (very complete) guide to help you wrangle the Facebook Graph API and make it useful for your application. It makes use of the official Facebook PHP SDK to interface with the Graph API. Have you ever wanted to learn how to make your applications more social with Facebook? It's much easier than you think! In this tutorial, we'll be building an application that reads and publishes data to and from Facebook using Facebook's Graph API. The tutorial helps you get signed up on the Facebook developer site, create a first sample application, set up the SDK and make a simple page (with an added bonus of using the Twitter Boostrap for look/feed). There's a section covering permissions, what kind of data you can expect publicly for both users and posts. They wrap it up with an example of posting back to Facebook though the API and updating the status on your account. The complete code for the tutorial is also available for download.
2011-12-02 19:55:
On the PHPClasses.org site they've posted the latest episode of their "Lately in PHP" podcast. This time the focus is on a recent article that was posted to the site about finding good developers by looking in the right place. The recently published article on attracting talented Web developers by offering remote job positions raised an interesting debate on the challenges, advantages and disadvantages of this way of working. This debate was the main topic of discussion of the episode 18 of the Lately in PHP podcast with Manuel Lemos and Ernani Joppert, who were joined by César Rodas. César is a top PHPClasses contributor that has been working remotely for several years for companies around the world. You can listen to this latest episode either via the in-page player, by direct download or by subscribing to their feed.
PHPClasses.org: Lately in PHP Podcast Episode 18 - The Debate on Remote Work for Web Developers
On the PHPClasses.org site they've posted the latest episode of their "Lately in PHP" podcast. This time the focus is on a recent article that was posted to the site about finding good developers by looking in the right place. The recently published article on attracting talented Web developers by offering remote job positions raised an interesting debate on the challenges, advantages and disadvantages of this way of working. This debate was the main topic of discussion of the episode 18 of the Lately in PHP podcast with Manuel Lemos and Ernani Joppert, who were joined by César Rodas. César is a top PHPClasses contributor that has been working remotely for several years for companies around the world. You can listen to this latest episode either via the in-page player, by direct download or by subscribing to their feed.
2011-12-02 18:02:
It's that time of year again and this year's PHP Advent has kicked off with the first article posted yesterday. Below is a list of the articles for this year's advent calendar, to be updated as each new one is released: Because It's Fun! by Derek Sivers More Than Just Style by Laura Beth Denker Reduced-Friction Deployment by Chris Hartjes Better Than the Rest by Rob Allen Check back for the growing list as this year's advent gets more great content every day!
Community News: PHP Advent 2011
It's that time of year again and this year's PHP Advent has kicked off with the first article posted yesterday. Below is a list of the articles for this year's advent calendar, to be updated as each new one is released: Because It's Fun! by Derek Sivers More Than Just Style by Laura Beth Denker Reduced-Friction Deployment by Chris Hartjes Better Than the Rest by Rob Allen Check back for the growing list as this year's advent gets more great content every day!
2011-12-02 17:04:
Kevin Schroeder has a method in one of his latest posts for hooking your linux-based system into Zend's phpcloud platform, complete with an automatic upload (so you're not constantly sftp-ing). Connecting with the Zend DevCloud in Linux is actually quite easy if you know how to use SFTP. [...] But, as I said in a previous post, I hate having to do command line stuff for each and every file or commit. I like things to work seamlessly. So what I did was write a PHP script that connects to the DevCloud (or any SSH-based endpoint for that matter) and then monitors all of the files and directories for changes, such as a creation, modification or deletion event. His script (available on github) uses the PECL inotify package to work, but once its set up, you can have the PHP process running the script in the background, pointed at your web root, and have it upload automatically.
Kevin Schroeder's Blog: Setting up a connection to the Zend Developer Cloud on Linux
Kevin Schroeder has a method in one of his latest posts for hooking your linux-based system into Zend's phpcloud platform, complete with an automatic upload (so you're not constantly sftp-ing). Connecting with the Zend DevCloud in Linux is actually quite easy if you know how to use SFTP. [...] But, as I said in a previous post, I hate having to do command line stuff for each and every file or commit. I like things to work seamlessly. So what I did was write a PHP script that connects to the DevCloud (or any SSH-based endpoint for that matter) and then monitors all of the files and directories for changes, such as a creation, modification or deletion event. His script (available on github) uses the PECL inotify package to work, but once its set up, you can have the PHP process running the script in the background, pointed at your web root, and have it upload automatically.
2011-12-02 16:22:
In a new post to his blog, Joshua Thijssen documents some of his first steps into the world of the Symfony2 framework (as a developer who has lived mostly in a Zend Framework/CodeIgniter world). His post doesn't compare the frameworks, it's just his discovery along the way. A friend of mine who is a big supporter of Symfony told me to give Symfony1 a shot. Off course I was skeptical since I knew less about symfony1 than I did on Zend_Tool. That, plus the fact we needed to autoload, bootstrap and get two frameworks up and running simultaneously. What could possibly go wrong! Conclusion: I've got my tool up and running about a 45 minutes later... He talks about the process he went through to download, setup and configure the framework and start using a "task" to create a simple executable script. He also briefly compares Symfony1 to Symfony2, noting that SF2 is a bit more "out-out-of-the-box friendly" than SF1. The overall experience was a positive one, though. You can find out more about Symfony1 here and Symfony2 here.
Joshua Thijssen's Blog: Compatible code: starting with symfony2
In a new post to his blog, Joshua Thijssen documents some of his first steps into the world of the Symfony2 framework (as a developer who has lived mostly in a Zend Framework/CodeIgniter world). His post doesn't compare the frameworks, it's just his discovery along the way. A friend of mine who is a big supporter of Symfony told me to give Symfony1 a shot. Off course I was skeptical since I knew less about symfony1 than I did on Zend_Tool. That, plus the fact we needed to autoload, bootstrap and get two frameworks up and running simultaneously. What could possibly go wrong! Conclusion: I've got my tool up and running about a 45 minutes later... He talks about the process he went through to download, setup and configure the framework and start using a "task" to create a simple executable script. He also briefly compares Symfony1 to Symfony2, noting that SF2 is a bit more "out-out-of-the-box friendly" than SF1. The overall experience was a positive one, though. You can find out more about Symfony1 here and Symfony2 here.
2011-12-02 15:44:
Jake Smith has a new post to his blog today about a feature included in PHP's Standard PHP Library that you might have overlooked - the FilterIterator's callback functionality. The Filter Iterator is probably my second favorite iterator, next to Directory Iterator. There are many great use cases for the Filter Iterator, and when you do filter the original data is left untouched. A Filter Iterator is really simple to use, create a class that extends FilterIterator and adjust the accept method to meet your criteria. This is great and all, but having the ability to create filter iterators on the fly, ones that won't be used application wide, without having to create a class is even better. He includes a bit of code defining a FilterCallbackIterator class with a "callback" parameter passed into the constructor (in his case, a closure). Also included is some sample code of it in use - handling an array (well, ArrayIterator) with a simple true/false check on the current array value. You can find out more about this functionality in the PHP manual.
Jake Smith's Blog: Callback Filter Iterator in PHP 5.3/5.4
Jake Smith has a new post to his blog today about a feature included in PHP's Standard PHP Library that you might have overlooked - the FilterIterator's callback functionality. The Filter Iterator is probably my second favorite iterator, next to Directory Iterator. There are many great use cases for the Filter Iterator, and when you do filter the original data is left untouched. A Filter Iterator is really simple to use, create a class that extends FilterIterator and adjust the accept method to meet your criteria. This is great and all, but having the ability to create filter iterators on the fly, ones that won't be used application wide, without having to create a class is even better. He includes a bit of code defining a FilterCallbackIterator class with a "callback" parameter passed into the constructor (in his case, a closure). Also included is some sample code of it in use - handling an array (well, ArrayIterator) with a simple true/false check on the current array value. You can find out more about this functionality in the PHP manual.
2011-12-02 14:08:
Popular posts from PHPDeveloper.org for the past week:PHPMaster.com: Localizing PHP Applications "The Right Way", Part 5 AjaxRay.com: The first Kohana book : Kohana 3.0 Beginner's Guide Volker Dusch's Blog: Textual code coverage information for PHPUnit Richard Miller's Blog: Symfony2: Integrating elasticsearch Gonzalo Ayuso's Blog: Playing with the new PHP5.4 features DZone.com: Speed Up Your PHP Like Facebook Karsten Deubert's Blog: Zend_MVC, Controller Plugins and Annotations PHPMaster.com: Introduction to Git, Part 1 NetTuts.com: Easy Package Management for CodeIgniter with Sparks Tom Schlick's Blog: Wrench for FuelPHP
Site News: Popular Posts for the Week of 12.02.2011
Popular posts from PHPDeveloper.org for the past week:PHPMaster.com: Localizing PHP Applications "The Right Way", Part 5 AjaxRay.com: The first Kohana book : Kohana 3.0 Beginner's Guide Volker Dusch's Blog: Textual code coverage information for PHPUnit Richard Miller's Blog: Symfony2: Integrating elasticsearch Gonzalo Ayuso's Blog: Playing with the new PHP5.4 features DZone.com: Speed Up Your PHP Like Facebook Karsten Deubert's Blog: Zend_MVC, Controller Plugins and Annotations PHPMaster.com: Introduction to Git, Part 1 NetTuts.com: Easy Package Management for CodeIgniter with Sparks Tom Schlick's Blog: Wrench for FuelPHP
2011-12-01 19:55:
Andrew Eddie has posted a helpful tutorial for Eclipse users out there showing how to get the most our of code assist in Eclipse PDT/Zend Studio. One of the powerful features of an IDE like Eclipse is the ability for it to "read" your code and give you some assistance about your API as you type. This could include things like class property or methods names, constants, functions, argument lists, and so on. Eclipse/PDT and ZendStudio do this by parsing a PHP class directly, but they also look at your docblocks and some other special comments where the raw PHP is not enough. This article is a bag of tricks that help you get the most out of code assistance using Eclipse/PDT or Zend Studio in those awkward corners of your code that you might have through previously inaccessible. Among his tips are things like adding "@var" declarations to help with code completion, type hinting on methods/functions, using the "@property" annotation and using a "this" trick to override what class the IDE sees as the local object. ,/p>
Andrew Eddie's Blog: Making the most out of Code Assist in Eclipse/PDT and Zend Studio for PHP
Andrew Eddie has posted a helpful tutorial for Eclipse users out there showing how to get the most our of code assist in Eclipse PDT/Zend Studio. One of the powerful features of an IDE like Eclipse is the ability for it to "read" your code and give you some assistance about your API as you type. This could include things like class property or methods names, constants, functions, argument lists, and so on. Eclipse/PDT and ZendStudio do this by parsing a PHP class directly, but they also look at your docblocks and some other special comments where the raw PHP is not enough. This article is a bag of tricks that help you get the most out of code assistance using Eclipse/PDT or Zend Studio in those awkward corners of your code that you might have through previously inaccessible. Among his tips are things like adding "@var" declarations to help with code completion, type hinting on methods/functions, using the "@property" annotation and using a "this" trick to override what class the IDE sees as the local object. ,/p>
2011-12-01 18:28:
PHPBuilder.com has a new tutorial posted about interfacing with GitHub in PHP, using their API to hook into and pull down information about users and repositories. The Git-based project hosting service GitHub is certainly the belle of today's technology ball, having attracted more than 1 million registered users and amassed more than 2 million hosted projects in less than three years. [...] GitHub High Scores and GitHub Badges are two examples of third-party services created using the GitHub API, which is capable of carrying out any task you might wish to perform via GitHub.com. With it you can create, edit and search repositories, learn more about fellow GitHub users, and manage repository issues. Jason shows how to use the php-github-api library to connect to the API, search repository information, get user details, finding their repositories and accessing restricted resources (things only available for the authenticated user like updating your account or working with your own repositories).
PHPBuilder.com: Talking to GitHub with PHP
PHPBuilder.com has a new tutorial posted about interfacing with GitHub in PHP, using their API to hook into and pull down information about users and repositories. The Git-based project hosting service GitHub is certainly the belle of today's technology ball, having attracted more than 1 million registered users and amassed more than 2 million hosted projects in less than three years. [...] GitHub High Scores and GitHub Badges are two examples of third-party services created using the GitHub API, which is capable of carrying out any task you might wish to perform via GitHub.com. With it you can create, edit and search repositories, learn more about fellow GitHub users, and manage repository issues. Jason shows how to use the php-github-api library to connect to the API, search repository information, get user details, finding their repositories and accessing restricted resources (things only available for the authenticated user like updating your account or working with your own repositories).
2011-12-01 17:09:
DevShed has posted the fifth part of their "handling files in PHP" tutorial series today (excerpted from the book "Beginning PHP and PostgreSQL 8: From Novice to Professional") with a focus on read from multiple places in a file to get to different data. In this fifth part of an eight-part series on working with file and operating systems with PHP, you'll learn how to read data from a file and move the file pointer. Example code is included showing how to use the file, file_get_contents, fgetc, fgetcsv, readfile and fscanf (among several others). Also included is code showing how to use the fseek method to move around in a file.
DevShed: Handling File Data with PHP (Reading & Seeking)
DevShed has posted the fifth part of their "handling files in PHP" tutorial series today (excerpted from the book "Beginning PHP and PostgreSQL 8: From Novice to Professional") with a focus on read from multiple places in a file to get to different data. In this fifth part of an eight-part series on working with file and operating systems with PHP, you'll learn how to read data from a file and move the file pointer. Example code is included showing how to use the file, file_get_contents, fgetc, fgetcsv, readfile and fscanf (among several others). Also included is code showing how to use the fseek method to move around in a file.
2011-12-01 16:56:
On the Tales of a Coder blog there's a recent post about DocBlox, an alternative to the usual phpDocumentor for generating automatic documentation, and how it made it "pain free" for his current project. Want to generate documentation for your PHP project, but keep putting it off? Can't be bothered wading thigh deep in documentation, screaming WHY WON'T IT WORK as you try to set it up? Look no further. DocBlox is pain free and you'll be up and running, literally in a few minutes. He includes a guide to getting the latest DocBlox installed and configured to work with your project. The configuration is a straight-forward XML file, so changing the settings to match your needs is easy (more on the config here). Once this is configured, building your documentation is one command away. For more details on DocBlox, check out the project's website.
Tales of a Coder: DocBlox - Pain Free Documentation
On the Tales of a Coder blog there's a recent post about DocBlox, an alternative to the usual phpDocumentor for generating automatic documentation, and how it made it "pain free" for his current project. Want to generate documentation for your PHP project, but keep putting it off? Can't be bothered wading thigh deep in documentation, screaming WHY WON'T IT WORK as you try to set it up? Look no further. DocBlox is pain free and you'll be up and running, literally in a few minutes. He includes a guide to getting the latest DocBlox installed and configured to work with your project. The configuration is a straight-forward XML file, so changing the settings to match your needs is easy (more on the config here). Once this is configured, building your documentation is one command away. For more details on DocBlox, check out the project's website.
2011-12-01 15:38:
PHPMaster.com has a new article for those new to the PHP language posted this morning - an introduction to using functions and making your code more reusable. Let's start by defining the word "function." A function is a self-contained piece of code which carries out a particular task (or function!). A key benefit of using functions is that they are reusable; if you have a task that needs to be performed a number of times, a function is an ideal solution. They can be either defined by you or by PHP (PHP has a rich collection of built-in functions). This article will focus on programmer-defined functions but will touch briefly on PHP's functions to complete the picture. They include a few code snippets showing the syntax of functions (including their name, arguments and returning a value). They suggest grouping your functions together in your code for easier maintenance and share a handy tip on making a function accept a varying number of arguments.
PHPMaster.com: Defining and Using Functions in PHP
PHPMaster.com has a new article for those new to the PHP language posted this morning - an introduction to using functions and making your code more reusable. Let's start by defining the word "function." A function is a self-contained piece of code which carries out a particular task (or function!). A key benefit of using functions is that they are reusable; if you have a task that needs to be performed a number of times, a function is an ideal solution. They can be either defined by you or by PHP (PHP has a rich collection of built-in functions). This article will focus on programmer-defined functions but will touch briefly on PHP's functions to complete the picture. They include a few code snippets showing the syntax of functions (including their name, arguments and returning a value). They suggest grouping your functions together in your code for easier maintenance and share a handy tip on making a function accept a varying number of arguments.
2011-11-30 21:02:
The ConFoo conference has officially announced the opening of Early Bird registrations for their 2012 event (happening in Montreal February 29th through March 2nd). When? February 29 - March 02, 2012. Where? Hilton Bonaventure Hotel, Montreal downtown. How much? $600 (instead of $800). This rate is valid if you order before January 13, 2012. You can order your ticket today in a variety of flavors - just a conference pass or conference plus a tutorial - either Advanced PHP, Security (both in French and English versions), Symfony2 or HTML5. Ticket prices range from $700 CAD to $400 CAD, depending on which tutorial is selected (or if it's selected at all).
Community News: ConFoo 2012 Early Bird Tickets On Sale!
The ConFoo conference has officially announced the opening of Early Bird registrations for their 2012 event (happening in Montreal February 29th through March 2nd). When? February 29 - March 02, 2012. Where? Hilton Bonaventure Hotel, Montreal downtown. How much? $600 (instead of $800). This rate is valid if you order before January 13, 2012. You can order your ticket today in a variety of flavors - just a conference pass or conference plus a tutorial - either Advanced PHP, Security (both in French and English versions), Symfony2 or HTML5. Ticket prices range from $700 CAD to $400 CAD, depending on which tutorial is selected (or if it's selected at all).
2011-11-30 19:40:
Tom Schlick has a new post to his blog talking about a tool he's written for FuelPHP-based applications called Wrench. It's a command-line tool to make taking your site "offline" simpler. If you have been following what I've been up to lately you would see that many of my recent projects are based on FuelPHP. Since Fuel is so awesome and allows you to create "packages" that can be dropped into your application, I have created a few that help me quickly piece together apps. The first package I'm "releasing" is called Wrench. The tool works with the oil command-line tool already included in the framework to swap out the default action with a "Down for Maintenance" message. It will look at the current state of the app and switch it to the opposite when run, but you can also define "start" and "finish" manually if you'd like. You can find the source for the package on Tom's github account.
Tom Schlick's Blog: Wrench for FuelPHP
Tom Schlick has a new post to his blog talking about a tool he's written for FuelPHP-based applications called Wrench. It's a command-line tool to make taking your site "offline" simpler. If you have been following what I've been up to lately you would see that many of my recent projects are based on FuelPHP. Since Fuel is so awesome and allows you to create "packages" that can be dropped into your application, I have created a few that help me quickly piece together apps. The first package I'm "releasing" is called Wrench. The tool works with the oil command-line tool already included in the framework to swap out the default action with a "Down for Maintenance" message. It will look at the current state of the app and switch it to the opposite when run, but you can also define "start" and "finish" manually if you'd like. You can find the source for the package on Tom's github account.
2011-11-30 18:04:
The Developer Drive blog has the latest post in their "PHP User Survey" series focusing on setting up admin functionality for the poll managers to use. In Part I of this series, we started the process of creating user polls for a business web site. Part I gave the layout of the data layer and began the construction of the class file. In this part we will continue with adding methods to the class file that will enable the administrator to set the variable values and read from the database tables. Code is included for setting the poll and answer ID values (setters), grabbing the number of polls currently defined, finding the active ones and pulling out poll data along with its answers. If you need to catch up, you can find the other parts here: part one, part two.
Developer Drive: PHP User Survey: Setting Variable Values and Reading from Tables
The Developer Drive blog has the latest post in their "PHP User Survey" series focusing on setting up admin functionality for the poll managers to use. In Part I of this series, we started the process of creating user polls for a business web site. Part I gave the layout of the data layer and began the construction of the class file. In this part we will continue with adding methods to the class file that will enable the administrator to set the variable values and read from the database tables. Code is included for setting the poll and answer ID values (setters), grabbing the number of polls currently defined, finding the active ones and pulling out poll data along with its answers. If you need to catch up, you can find the other parts here: part one, part two.
2011-11-30 17:14:
Recently a site called The Twelve Factor App surfaced as a guideline for web applications to be at their best. Bradley Holt has taken these suggestions and has applied them to PHP applications in a few quick comments to each point. If you develop web apps, I encourage you to check out The Twelve-Factor App. This is an excellent resource for anyone building and deploying software-as-a-service. PHP has great support for many of the twelve-factors. I want to take a look at specifically how each factor may be applied to a PHP application. Some of the points the Twelve-Factor App makes aren't entirely relevant to PHP (like "Backing Services") but Bradley gets into details on others, providing technology that can be used to fill the need.
Bradley Holt's Blog: The Twelve-Factor App Applied to PHP
Recently a site called The Twelve Factor App surfaced as a guideline for web applications to be at their best. Bradley Holt has taken these suggestions and has applied them to PHP applications in a few quick comments to each point. If you develop web apps, I encourage you to check out The Twelve-Factor App. This is an excellent resource for anyone building and deploying software-as-a-service. PHP has great support for many of the twelve-factors. I want to take a look at specifically how each factor may be applied to a PHP application. Some of the points the Twelve-Factor App makes aren't entirely relevant to PHP (like "Backing Services") but Bradley gets into details on others, providing technology that can be used to fill the need.
2011-11-30 16:57:
A new post on the PHPClasses blog today suggests that good, talented web developers are actually pretty easy to find, you just have to look in the right places. Once in a while, we hear company managers and recruiters complaining about how hard is to find talented Web developers that are willing work for them. The problem is that they are not looking right. Not only there are plenty of talented Web developers out there, they are easy to find, and many of them are available for hire. The key point in his "easy to find developers" argument is simple - be open to telecommuting. Too many companies shun it because of the lack of control it brings to a group, but it also shuts down so many possibilities. He offers a few of his own reasons for the hesitation: the need to see the employee frequently, security concerns and trust issues. He also includes a few of the success stories of PHP community members who telecommute including Eli White, Ernani Joppert and Arturs Sosins.
PHPClasses.org: Talented Web Developers Are Easy to Hire, Employers Are Just Not Looking Right
A new post on the PHPClasses blog today suggests that good, talented web developers are actually pretty easy to find, you just have to look in the right places. Once in a while, we hear company managers and recruiters complaining about how hard is to find talented Web developers that are willing work for them. The problem is that they are not looking right. Not only there are plenty of talented Web developers out there, they are easy to find, and many of them are available for hire. The key point in his "easy to find developers" argument is simple - be open to telecommuting. Too many companies shun it because of the lack of control it brings to a group, but it also shuts down so many possibilities. He offers a few of his own reasons for the hesitation: the need to see the employee frequently, security concerns and trust issues. He also includes a few of the success stories of PHP community members who telecommute including Eli White, Ernani Joppert and Arturs Sosins.
2011-11-30 15:29:
Miro has submitted some information about the latest meeting of the Zagreb PHP User Group happening December 13th at 6pm in the Multimedia Institute: Although Zagreb PHP Meetup started only 3 months ago with monthly meetups (up to 30 developers coming), our next meeting will be first meetup with organized talks. December meetup will have 5 talks with themes like 'How to write readable code?', 'Flex & PHP development' , 'Introduction to test driven development' && 'MySQL - explain explained'. We would like to invite all interested PHP and non-PHP developers that would like to listen to some of best Croatian PHP devs (and understand Croatian language) to come on December 13th from 6PM to Mama, Preradoviceva 18 in Zagreb. Unfortunately we are limited with number of available seats so please signup at http://zgphp.eventbrite.com/. Due to space limitations, there's only 12 seats available so hurry and reserve your spot if you'd like to attend (it's free)! Have a user group meeting you'd like announced? Let us know!
Community News: Zagreb PHP User Group December 2011 Meeting - 13th @ 6pm
Miro has submitted some information about the latest meeting of the Zagreb PHP User Group happening December 13th at 6pm in the Multimedia Institute: Although Zagreb PHP Meetup started only 3 months ago with monthly meetups (up to 30 developers coming), our next meeting will be first meetup with organized talks. December meetup will have 5 talks with themes like 'How to write readable code?', 'Flex & PHP development' , 'Introduction to test driven development' && 'MySQL - explain explained'. We would like to invite all interested PHP and non-PHP developers that would like to listen to some of best Croatian PHP devs (and understand Croatian language) to come on December 13th from 6PM to Mama, Preradoviceva 18 in Zagreb. Unfortunately we are limited with number of available seats so please signup at http://zgphp.eventbrite.com/. Due to space limitations, there's only 12 seats available so hurry and reserve your spot if you'd like to attend (it's free)! Have a user group meeting you'd like announced? Let us know!
2011-11-30 14:22:
The PHP.net site has officially announced the availability of the latest Release Candidate for the PHP 5.4.x series - PHP 5.4 RC2: The PHP development team is proud to announce the second release candidate of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. THIS IS A RELEASE CANDIDATE - DO NOT USE IT IN PRODUCTION!. This is the second release candidate. The release candidate phase is intended as a period of bug fixing prior to the stable release. No new features should be included before the final version of PHP 5.4.0. Fixes in this new version include updates to the built-in web server, PHP-FPM no longer being marked as experimental and changes to the Zend Engine, Core and various extensions. See the NEWS file for complete details. You can download this latest release from the downloads page (and here for Windows users).
PHP.net: PHP 5.4 RC2 released
The PHP.net site has officially announced the availability of the latest Release Candidate for the PHP 5.4.x series - PHP 5.4 RC2: The PHP development team is proud to announce the second release candidate of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. THIS IS A RELEASE CANDIDATE - DO NOT USE IT IN PRODUCTION!. This is the second release candidate. The release candidate phase is intended as a period of bug fixing prior to the stable release. No new features should be included before the final version of PHP 5.4.0. Fixes in this new version include updates to the built-in web server, PHP-FPM no longer being marked as experimental and changes to the Zend Engine, Core and various extensions. See the NEWS file for complete details. You can download this latest release from the downloads page (and here for Windows users).
2011-11-29 21:55:
The PHP North West conference has posted a video from this year's event - the keynote from Ian Barber of his "How to Stand on the Shoulders of Giants" session. As software engineers, we all have the potential to navigate the history of our industry, tease out the genius from what has come before, and build a platform for our own ideas. By doing so, we can see that little bit further and in turn provide the foundations for others to build on what we have done. In this session we'll look at how the history of the web itself is rooted in sharing information and how modern giants like Google and Facebook are founded on what came before them, while being driven forwards by the ecosystems they helped build. We'll see how successful open source projects leverage the past, and how by following some simple principles we can make use of the information, projects and people around us to improve ourselves and our careers. You cab view other videos from the 2010 event on the PHPNW video channel on blip.tv.
Community News: PHP North West Video - "How to Stand on the Shoulders of Giants"
The PHP North West conference has posted a video from this year's event - the keynote from Ian Barber of his "How to Stand on the Shoulders of Giants" session. As software engineers, we all have the potential to navigate the history of our industry, tease out the genius from what has come before, and build a platform for our own ideas. By doing so, we can see that little bit further and in turn provide the foundations for others to build on what we have done. In this session we'll look at how the history of the web itself is rooted in sharing information and how modern giants like Google and Facebook are founded on what came before them, while being driven forwards by the ecosystems they helped build. We'll see how successful open source projects leverage the past, and how by following some simple principles we can make use of the information, projects and people around us to improve ourselves and our careers. You cab view other videos from the 2010 event on the PHPNW video channel on blip.tv.
2011-11-29 18:05:
The PHPBenelux conference has officially announced their list of speakers for their 2012 event (January 27th and 28th in Antwerp): We are happy and proud to announce the speaker line-up for the 2012 edition of the PHPBenelux Conference. We already released our tutorials on November 16th, but this is the real deal. Speaker bio's, talk abstracts and schedule will be added later. Please note that this list is subject to change. Sessions for this year's event include: Tobias Schlitt: Writing testable code Sebastian Marek: Magic Behind the Numbers - Software Metrics In Practice Nick Belhomme: PHP traits, treat or threat? Jordi Boggiano: Redis - Your advanced in-memory key-value store Stephan Hochdörfer: The state of DI in PHP Craig Kitterman: Enterprise Class Cloud for the Average Joe Tickets are still at their Early Bird prices (but only until December 16th!) and you can get a pass for both the tutorial day and main conference day for just 260 Euro. If you just want to attend the conference, that ticket is only 135 Euro. You can order them here. If you want to attend one of the tutorials, you'll need to specify that by ordering the related ticket.
Community News: PHPBenelux 2012 Anouncement - Full Speaker List Posted
The PHPBenelux conference has officially announced their list of speakers for their 2012 event (January 27th and 28th in Antwerp): We are happy and proud to announce the speaker line-up for the 2012 edition of the PHPBenelux Conference. We already released our tutorials on November 16th, but this is the real deal. Speaker bio's, talk abstracts and schedule will be added later. Please note that this list is subject to change. Sessions for this year's event include: Tobias Schlitt: Writing testable code Sebastian Marek: Magic Behind the Numbers - Software Metrics In Practice Nick Belhomme: PHP traits, treat or threat? Jordi Boggiano: Redis - Your advanced in-memory key-value store Stephan Hochdörfer: The state of DI in PHP Craig Kitterman: Enterprise Class Cloud for the Average Joe Tickets are still at their Early Bird prices (but only until December 16th!) and you can get a pass for both the tutorial day and main conference day for just 260 Euro. If you just want to attend the conference, that ticket is only 135 Euro. You can order them here. If you want to attend one of the tutorials, you'll need to specify that by ordering the related ticket.
2011-11-29 17:13:
On DZone.com John Esposito reminds you about another technology Facebook has introduced to the world of PHP (besides HipHop) - XHProf, a PHP profiler. Facebook did more for PHP: they also created XHProf, a PHP profiler with a (supposedly) easy-to-use HTML interface, designed to pinpoint exactly where your bottlenecks are appearing, so that you can optimize at every stage in the pipeline. [...] If you haven't tried XHProf, you might want to look into it. Installation apparently requires a little nudging, but Nick Lewis just posted a full, practical guide to benchmarking and performance tuning your PHP and MySQL, using XHProf (as well as other techniques) -- a very nice overview of many common bottlenecks and how to open them up. There's also a link to some Drupal 6 benchmarks that shows how it has helped that project (including both small and large improvements).
DZone.com: Speed Up Your PHP Like Facebook
On DZone.com John Esposito reminds you about another technology Facebook has introduced to the world of PHP (besides HipHop) - XHProf, a PHP profiler. Facebook did more for PHP: they also created XHProf, a PHP profiler with a (supposedly) easy-to-use HTML interface, designed to pinpoint exactly where your bottlenecks are appearing, so that you can optimize at every stage in the pipeline. [...] If you haven't tried XHProf, you might want to look into it. Installation apparently requires a little nudging, but Nick Lewis just posted a full, practical guide to benchmarking and performance tuning your PHP and MySQL, using XHProf (as well as other techniques) -- a very nice overview of many common bottlenecks and how to open them up. There's also a link to some Drupal 6 benchmarks that shows how it has helped that project (including both small and large improvements).
2011-11-29 16:44:
If you haven't gotten a chance to try out git for your version control system, now's the perfect time. PHPMaster has an introduction to using git for a simple PHP project. It introduces you to some of the basics and gets you up to speed quickly. Some of the more commonly used version control systems that you have likely heard about are CVS and Subversion. This tutorial will take a "forget everything you know about CVS or Subversion" approach. As someone who has used all three of these systems in the professional realm, I can testify that some knowledge of CVS or Subversion can be useful when approaching Git, but it is not necessary. The best way to learn Git is to start using Git for what Git is. They break it up into a few different sections - why use git, how to create a new repository, adding/staging files for commit, viewing the project history and viewing diffs for different versions. This is the first part in a series, so keep tuned for future parts touching on branching, merging and working with remote repositories.
PHPMaster.com: Introduction to Git, Part 1
If you haven't gotten a chance to try out git for your version control system, now's the perfect time. PHPMaster has an introduction to using git for a simple PHP project. It introduces you to some of the basics and gets you up to speed quickly. Some of the more commonly used version control systems that you have likely heard about are CVS and Subversion. This tutorial will take a "forget everything you know about CVS or Subversion" approach. As someone who has used all three of these systems in the professional realm, I can testify that some knowledge of CVS or Subversion can be useful when approaching Git, but it is not necessary. The best way to learn Git is to start using Git for what Git is. They break it up into a few different sections - why use git, how to create a new repository, adding/staging files for commit, viewing the project history and viewing diffs for different versions. This is the first part in a series, so keep tuned for future parts touching on branching, merging and working with remote repositories.
2011-11-29 15:39:
As Brian Swan has mentioned in his latest blog post, the ODBC database driver for SQL Server on Linux has been released. This is a huge step forward for directly connecting linux-based systems (and programming languages) to this popular Microsoft product. The first beta release of the SQL Server ODBC Driver for Linux is available for download! As announced in October, the "Multiplatform Team" (a.k.a. the "MPlat Team") has released a preview version of a driver that will provide first-class access to SQL Server from applications running on Linux operating systems. The team is looking for feedback on this release to incorporate into their production-ready release, so try it out and let us know what you think. He links to a few resources about the release - more details, a link to download the driver and the official documentation.
Brian Swan's Blog: The SQL Server ODBC Driver for Linux is Available!
As Brian Swan has mentioned in his latest blog post, the ODBC database driver for SQL Server on Linux has been released. This is a huge step forward for directly connecting linux-based systems (and programming languages) to this popular Microsoft product. The first beta release of the SQL Server ODBC Driver for Linux is available for download! As announced in October, the "Multiplatform Team" (a.k.a. the "MPlat Team") has released a preview version of a driver that will provide first-class access to SQL Server from applications running on Linux operating systems. The team is looking for feedback on this release to incorporate into their production-ready release, so try it out and let us know what you think. He links to a few resources about the release - more details, a link to download the driver and the official documentation.
2011-11-29 14:00:
Latest PECL Releases: expect 0.3.1 CUBRID 8.3.1.0008 CUBRID 8.4.0.0005 CUBRID 8.4.1.0001 lua 0.9.1 hidef 0.1.10 solr 1.0.2
Community News: Latest PECL Releases for 11.29.2011
Latest PECL Releases: expect 0.3.1 CUBRID 8.3.1.0008 CUBRID 8.4.0.0005 CUBRID 8.4.1.0001 lua 0.9.1 hidef 0.1.10 solr 1.0.2
2011-11-28 19:02:
Karsten Deubert has a recent post to his blog looking at annotations in Zend Framework applications to enhance functionality already in the framework. Recently I had the idea to influence Controller Actions with annotations but discarded it with thoughts like "In PHP I will have to use reflection and some black magic to get this working which will have insane performance hits for my applications"... until I set everything up to see that it costs just 1-2ms in average per request without any form of caching. He includes a few bits of code to show a simple annotation example (setting a layout) and the controller plugin that performs the translation. In his case, it's hard-coded to look for the "@layout" annotation in the docblock comment, but it'd be relatively trivial to extend it to a more full-featured version.
Karsten Deubert's Blog: Zend_MVC, Controller Plugins and Annotations
Karsten Deubert has a recent post to his blog looking at annotations in Zend Framework applications to enhance functionality already in the framework. Recently I had the idea to influence Controller Actions with annotations but discarded it with thoughts like "In PHP I will have to use reflection and some black magic to get this working which will have insane performance hits for my applications"... until I set everything up to see that it costs just 1-2ms in average per request without any form of caching. He includes a few bits of code to show a simple annotation example (setting a layout) and the controller plugin that performs the translation. In his case, it's hard-coded to look for the "@layout" annotation in the docblock comment, but it'd be relatively trivial to extend it to a more full-featured version.
2011-11-28 18:40:
Richard Miller has been posting a series of articles to his blog recently that look at integrating the ElasticSearch tool with a Symfony2-based application. Elasticsearch is built on top of Lucene and indexes data as JSON documents in a similar way to the way MongoDB stores data. This means as with Mongo that it is schemaless and creates fields on the fly. It is queried over HTTP using queries which are themselves defined in JSON. [...] What I want to do is look at how you can avoid having to deal with issuing JSON queries over HTTP from a Symfony2 app and actually get started using elasticsearch in a very simple way. He uses the Elastica PHP library to do some of the "heavy lifting" in the three posts so far: Symfony2: Integrating elasticsearch Symfony2: improving elasticsearch results Symfony2: elasticsearch custom analyzers
Richard Miller's Blog: Symfony2: Integrating elasticsearch
Richard Miller has been posting a series of articles to his blog recently that look at integrating the ElasticSearch tool with a Symfony2-based application. Elasticsearch is built on top of Lucene and indexes data as JSON documents in a similar way to the way MongoDB stores data. This means as with Mongo that it is schemaless and creates fields on the fly. It is queried over HTTP using queries which are themselves defined in JSON. [...] What I want to do is look at how you can avoid having to deal with issuing JSON queries over HTTP from a Symfony2 app and actually get started using elasticsearch in a very simple way. He uses the Elastica PHP library to do some of the "heavy lifting" in the three posts so far: Symfony2: Integrating elasticsearch Symfony2: improving elasticsearch results Symfony2: elasticsearch custom analyzers
2011-11-28 17:16:
The South Florida PHP User Group has announced their December 2011 meeting - happening on the 14th at 7pm - with a look at how far PHP has come in 2011 and some of the things coming up. Rasmus Lerdorf will be presenting. For our "FREE" (yes, all of our meetups are free) December meetup we have a special guest, Rasmus Lerdorf, visiting to talk about "PHP in 2011". Rasmus Lerdorf, the inventor of PHP, will talk to us and give his perspective on the prospects of his brainchild. "PHP in 2011": A look at the state of PHP in 2011 and how it fits into the current technology stack followed by an overview of what you should and shouldn't be doing along with a summary of new and upcoming features in PHP 5.3 and PHP 5.4. This will be a 90 minute talk with an extensive Q&A session will follow. To RSVP for the event (held at Nova Southeastern University), head to their Meetup page. There's already about 40 people signed up, so be sure and get your name in quickly to reserve your spot! If you're a PHP user group leader (or member for that matter) and would like to have your group's upcoming meetups posted here, send us the information! We love to share!
Community News: South Florida PHP User Group Dec 2011 Meetup - PHP in 2011 (with Rasmus Lerdorf)
The South Florida PHP User Group has announced their December 2011 meeting - happening on the 14th at 7pm - with a look at how far PHP has come in 2011 and some of the things coming up. Rasmus Lerdorf will be presenting. For our "FREE" (yes, all of our meetups are free) December meetup we have a special guest, Rasmus Lerdorf, visiting to talk about "PHP in 2011". Rasmus Lerdorf, the inventor of PHP, will talk to us and give his perspective on the prospects of his brainchild. "PHP in 2011": A look at the state of PHP in 2011 and how it fits into the current technology stack followed by an overview of what you should and shouldn't be doing along with a summary of new and upcoming features in PHP 5.3 and PHP 5.4. This will be a 90 minute talk with an extensive Q&A session will follow. To RSVP for the event (held at Nova Southeastern University), head to their Meetup page. There's already about 40 people signed up, so be sure and get your name in quickly to reserve your spot! If you're a PHP user group leader (or member for that matter) and would like to have your group's upcoming meetups posted here, send us the information! We love to share!
2011-11-28 16:50:
Chris Hartjes has a reminder posted to his blog today in the form of this recent post that "scope is not a mouthwash" - personal experience from his recent development where he forgot about something as simple as scoping (and it caused him all sorts of headaches). For [a chapter in my book on dependency injection] I am using Pimple, an incredibly small but effective dependency injection container. Easy to use, simple and effective documentation, just what I was looking for. I also noticed that Pimple supported the use of closures (or anonymous functions) as a way of storing a dependency. Then things got stupid. He shares a bit of code showing how he added it to his bootstrap but was given a "cannot find class" error when he tried to use the tool. He walks through the steps he followed to track down the problem - looking closer at Pimple, investigating closures and, the ultimate problem, namespace scoping. He was missing a "" to start his namespace and closures work slightly differently: So why does it behave differently inside closures? I am not 100% sure, but if I had to make an educated guess I would say that when trying to resolve namespaces inside a closure, the interpretor doesn't assume that it is already inside the global namespace, that it is in a namespace of it's own.
Chris Hartjes' Blog: Scope Is Not a Mouthwash
Chris Hartjes has a reminder posted to his blog today in the form of this recent post that "scope is not a mouthwash" - personal experience from his recent development where he forgot about something as simple as scoping (and it caused him all sorts of headaches). For [a chapter in my book on dependency injection] I am using Pimple, an incredibly small but effective dependency injection container. Easy to use, simple and effective documentation, just what I was looking for. I also noticed that Pimple supported the use of closures (or anonymous functions) as a way of storing a dependency. Then things got stupid. He shares a bit of code showing how he added it to his bootstrap but was given a "cannot find class" error when he tried to use the tool. He walks through the steps he followed to track down the problem - looking closer at Pimple, investigating closures and, the ultimate problem, namespace scoping. He was missing a "" to start his namespace and closures work slightly differently: So why does it behave differently inside closures? I am not 100% sure, but if I had to make an educated guess I would say that when trying to resolve namespaces inside a closure, the interpretor doesn't assume that it is already inside the global namespace, that it is in a namespace of it's own.
2011-11-28 15:10:
Gonzalo Ayuso has a new post to his blog today showing some of the experimentation he's done with PHP 5.4 features like the short array syntax, calling methods through arrays and traits. PHP5.4 it's close and it's time to start playing with the new cool features. I've created a new Virtual Machine to play with the new features available within PHP5.4. I wrote a post with the most exciting features (at least for me) when I saw the feature list in the alpha version. Now the Release Candidate is with us, so it's the time of start playing with them. I also discover really cool features that I pass over in my first review. Code snippets are included for each example for: Class member access on instantiation Short array syntax Support for Class::{expr}() syntax Indirect method call through array Callable typehint Traits Array dereferencing support He points to this other post for a complete list of what's been added in 5.4.
Gonzalo Ayuso's Blog: Playing with the new PHP5.4 features
Gonzalo Ayuso has a new post to his blog today showing some of the experimentation he's done with PHP 5.4 features like the short array syntax, calling methods through arrays and traits. PHP5.4 it's close and it's time to start playing with the new cool features. I've created a new Virtual Machine to play with the new features available within PHP5.4. I wrote a post with the most exciting features (at least for me) when I saw the feature list in the alpha version. Now the Release Candidate is with us, so it's the time of start playing with them. I also discover really cool features that I pass over in my first review. Code snippets are included for each example for: Class member access on instantiation Short array syntax Support for Class::{expr}() syntax Indirect method call through array Callable typehint Traits Array dereferencing support He points to this other post for a complete list of what's been added in 5.4.
2011-11-25 23:11:
In a new post to his blog Volker Dusch points out a new feature in a recent release of PHPUnit, the popular unit testing framework for PHP - textual code coverage details. Three weeks ago PHPUnit 3.6 was released and it has a little new feature you might have missed until now. PHPUnit can now show you code coverage information on the command line. Options for the report output include: colorizing, writing the output to a file, including a project summary, namespace separation and package (using the @package phpdoc tag) information. He includes a use case he's found for it - small projects where you can cover the whole codebase quickly (with a "watch" command example filtering based on a certain class).
Volker Dusch's Blog: Textual code coverage information for PHPUnit
In a new post to his blog Volker Dusch points out a new feature in a recent release of PHPUnit, the popular unit testing framework for PHP - textual code coverage details. Three weeks ago PHPUnit 3.6 was released and it has a little new feature you might have missed until now. PHPUnit can now show you code coverage information on the command line. Options for the report output include: colorizing, writing the output to a file, including a project summary, namespace separation and package (using the @package phpdoc tag) information. He includes a use case he's found for it - small projects where you can cover the whole codebase quickly (with a "watch" command example filtering based on a certain class).
2011-11-25 21:58:
PHPMaster.com has posted the fifth part of their "Localizing PHP Applications 'The Right Way'" series, this time with a focus on extracting data from the .pot template files to define in your PHP. (This is the final part of the series.) In Part 4 you learned how to use gettext for one of the most complex aspects of localization a developer can face, plural forms. In this, the final part of the five-part series, I'll teach you how you to automate part of the localization process by extracting msgids and generating a PO template file (.pot) from your application's PHP code. They show how to use the xgettext command-line tool to pull out strings from your source and automatically make them into a domain template. They help you set up three sample PHP files and run the xgettext command on them to pull out messages defined in the text of the files to set up keys in the template. Screenshots are included showing how to use Poedit to use these templates for your new translations.
PHPMaster.com: Localizing PHP Applications "The Right Way", Part 5
PHPMaster.com has posted the fifth part of their "Localizing PHP Applications 'The Right Way'" series, this time with a focus on extracting data from the .pot template files to define in your PHP. (This is the final part of the series.) In Part 4 you learned how to use gettext for one of the most complex aspects of localization a developer can face, plural forms. In this, the final part of the five-part series, I'll teach you how you to automate part of the localization process by extracting msgids and generating a PO template file (.pot) from your application's PHP code. They show how to use the xgettext command-line tool to pull out strings from your source and automatically make them into a domain template. They help you set up three sample PHP files and run the xgettext command on them to pull out messages defined in the text of the files to set up keys in the template. Screenshots are included showing how to use Poedit to use these templates for your new translations.
2011-11-25 20:06:
On the AjaxRay site today there's a new review of an introductory book from Packt Publishing about
AjaxRay.com: The first Kohana book : Kohana 3.0 Beginner's Guide
On the AjaxRay site today there's a new review of an introductory book from Packt Publishing about
2011-11-25 18:00:
On NetTuts.com today there's a new tutorial showing off a package management system for the CodeIgniter framework, Sparks, that makes installing and using packages similar to Ruby's gems. Sparks is a new package-management system for CodeIgniter that extends the core with support for gem-like sparks. This tutorial interweaves an entry-level overview of the architecture and usage of the sparks system with the creation of dovecote-a simple spark for managing RSS data. The tutorial introduces you to the Sparks system and helps you get it installed and configured to work with a first basic package - a dovecote example. He helps organize and write the first spark as well as set up any dependencies and autoloading it might need. He follows this by adding some functionality to the package to make pushing output to the view simpler. You can download the source for the complete tutorial's code.
NetTuts.com: Easy Package Management for CodeIgniter with Sparks
On NetTuts.com today there's a new tutorial showing off a package management system for the CodeIgniter framework, Sparks, that makes installing and using packages similar to Ruby's gems. Sparks is a new package-management system for CodeIgniter that extends the core with support for gem-like sparks. This tutorial interweaves an entry-level overview of the architecture and usage of the sparks system with the creation of dovecote-a simple spark for managing RSS data. The tutorial introduces you to the Sparks system and helps you get it installed and configured to work with a first basic package - a dovecote example. He helps organize and write the first spark as well as set up any dependencies and autoloading it might need. He follows this by adding some functionality to the package to make pushing output to the view simpler. You can download the source for the complete tutorial's code.
2011-11-25 14:01:
Popular posts from PHPDeveloper.org for the past week:DevShed: Building an ORM in PHP ZetaCode.com: PHP GTK tutorial Johannes Schlüter's Blog: High Performance PHP Session Storage on Scale DevShed: Building an ORM in PHP: Domain Modeling Henrik Bjørnskov's Blog: Travis & Composer sitting in a tree K-I-S-S-I-N-G Lorna Mitchell's Blog: POSTing JSON Data With PHP cURL DZone.com: Creating a virtual server with Vagrant: a practical walkthrough Ibuildings techPortal: DPC Radio: Distributed Couch Apps - Embracing eventual consistency php|architect: Transactional Emails for Fun and Profit Engine Yard: The Future of PHP: PEAR and Pyrus Webcast Recording
Site News: Popular Posts for the Week of 11.25.2011
Popular posts from PHPDeveloper.org for the past week:DevShed: Building an ORM in PHP ZetaCode.com: PHP GTK tutorial Johannes Schlüter's Blog: High Performance PHP Session Storage on Scale DevShed: Building an ORM in PHP: Domain Modeling Henrik Bjørnskov's Blog: Travis & Composer sitting in a tree K-I-S-S-I-N-G Lorna Mitchell's Blog: POSTing JSON Data With PHP cURL DZone.com: Creating a virtual server with Vagrant: a practical walkthrough Ibuildings techPortal: DPC Radio: Distributed Couch Apps - Embracing eventual consistency php|architect: Transactional Emails for Fun and Profit Engine Yard: The Future of PHP: PEAR and Pyrus Webcast Recording
2011-11-24 01:05:
If you missed out on the Future of PEAR/Pyrus webcast event put on by Engine Yard, you're in luck - they've posted a recording of the event. In this panel discussion, we tackle topics including the direction PEAR and Pyrus will be going in the next few years, obstacles that may be on the horizon, and more. PEAR is the package library of standardized packages for a variety of common development tasks. Pyrus is a new package manager to make installing and maintaining PEAR packages simpler. Engine Yard's next webcast will cover the Lithium framework with core contributors Nate Abele, Garrett Woodworth, and John Anderson on December 1st.
Engine Yard: The Future of PHP: PEAR and Pyrus Webcast Recording
If you missed out on the Future of PEAR/Pyrus webcast event put on by Engine Yard, you're in luck - they've posted a recording of the event. In this panel discussion, we tackle topics including the direction PEAR and Pyrus will be going in the next few years, obstacles that may be on the horizon, and more. PEAR is the package library of standardized packages for a variety of common development tasks. Pyrus is a new package manager to make installing and maintaining PEAR packages simpler. Engine Yard's next webcast will cover the Lithium framework with core contributors Nate Abele, Garrett Woodworth, and John Anderson on December 1st.
2011-11-24 00:52:
On NetTuts there's a new tutorial showing how to take data from a MySQL database and translate it into a usable Excel file with the help of some simple PHP. A CSV (Comma Separated Value) file is usually sufficient for exporting MySQL data as an Excel Spreadsheet. These CSV files are data only though. A real Excel spreadsheet has formatting, formulas and perhaps even graphics - the difference between a simple method of data transfer and a professional report. This tutorial shows how to use open source PHP components to create "real" Excel spreadsheets from MySQL SELECT statements. With the help of the PHPExcel tool, making Excel-formatted files is a simple process. They show how to label columns, pull data out with a "quick and dirty" SQL statement, formatting the results to something a bit more clean and iterate through the pages of data to push them into the spreadsheet (including formulas). You can download the full source to get everything in one shot.
NetTuts.com: How to Generate a Complete Excel Spreadsheet From MySQL
On NetTuts there's a new tutorial showing how to take data from a MySQL database and translate it into a usable Excel file with the help of some simple PHP. A CSV (Comma Separated Value) file is usually sufficient for exporting MySQL data as an Excel Spreadsheet. These CSV files are data only though. A real Excel spreadsheet has formatting, formulas and perhaps even graphics - the difference between a simple method of data transfer and a professional report. This tutorial shows how to use open source PHP components to create "real" Excel spreadsheets from MySQL SELECT statements. With the help of the PHPExcel tool, making Excel-formatted files is a simple process. They show how to label columns, pull data out with a "quick and dirty" SQL statement, formatting the results to something a bit more clean and iterate through the pages of data to push them into the spreadsheet (including formulas). You can download the full source to get everything in one shot.
2011-11-23 23:23:
In the fourth part of their series looking at working with the filesystem in PHP, DevShed has posted a new tutorial focusing on security and permission handling for files/resources. These days, security is paramount to any server installation, large or small. Most modern operating systems have embraced the concept of the separation of file rights via a user/group ownership paradigm, which, when properly configured, offers a wonderfully convenient and powerful means for securing data. In this section, you'll learn how to use PHP's built-in functionality to review and manage these permissions. They introduce functions like: chown chgrp fileperms isexecutable umask Sample code is also included to show how to open and close a file.
DevShed: File Security and Resources with PHP
In the fourth part of their series looking at working with the filesystem in PHP, DevShed has posted a new tutorial focusing on security and permission handling for files/resources. These days, security is paramount to any server installation, large or small. Most modern operating systems have embraced the concept of the separation of file rights via a user/group ownership paradigm, which, when properly configured, offers a wonderfully convenient and powerful means for securing data. In this section, you'll learn how to use PHP's built-in functionality to review and manage these permissions. They introduce functions like: chown chgrp fileperms isexecutable umask Sample code is also included to show how to open and close a file.
2011-11-23 22:12:
In this new post on DZone.com today John Esposito talks about an interesting PHP framework that has come to light lately - the Yet Another Framework, an oddly named PHP extension that provides some of the basics to build a framework-based application. Why care about another PHP framework? especially one that's actually called Yet Another Framework? Because Yaf isn't just a framework. It's a PHP extension (listed on PECL), so it's written in C -- so it's very, very fast. How fast? Here's a benchmark (requests/sec). The only framework (of the list he compared) that came in faster was MicroMVC and that's not as full-featured as the Yaf functionality is. Disregarding that, it has a huge requests/second difference between even the next on the list, CodeIgniter.
DZone.com: PHP Yaf (Yet Another Framework) Is Very Fast
In this new post on DZone.com today John Esposito talks about an interesting PHP framework that has come to light lately - the Yet Another Framework, an oddly named PHP extension that provides some of the basics to build a framework-based application. Why care about another PHP framework? especially one that's actually called Yet Another Framework? Because Yaf isn't just a framework. It's a PHP extension (listed on PECL), so it's written in C -- so it's very, very fast. How fast? Here's a benchmark (requests/sec). The only framework (of the list he compared) that came in faster was MicroMVC and that's not as full-featured as the Yaf functionality is. Disregarding that, it has a huge requests/second difference between even the next on the list, CodeIgniter.
2011-11-23 21:27:
On PHPMaster.com today there's a new tutorial that shares a few regular expression tips about doing some search and replace in your content. So how can you practice using regex if you are limited to just using them in your code? The answer is to use a utility, of which there are many, that uses regex for performing search and replace. I'm sure everyone is familiar with the standard "find x and replace it with y" type of search and replace. Most IDEs and text editors have built in regex engines to handle search and replace. In this article I'd like to walk through a series of exercises to help you practice using regex. His examples are based on Netbeans but can be used in just about any IDE that supports regex (or even just your code). He shows how to match word boundaries, do some grouping, work with back references and doing some search/replace based on multiple groupings.
PHPMaster.com: Practicing Regular Expressions with Search and Replace
On PHPMaster.com today there's a new tutorial that shares a few regular expression tips about doing some search and replace in your content. So how can you practice using regex if you are limited to just using them in your code? The answer is to use a utility, of which there are many, that uses regex for performing search and replace. I'm sure everyone is familiar with the standard "find x and replace it with y" type of search and replace. Most IDEs and text editors have built in regex engines to handle search and replace. In this article I'd like to walk through a series of exercises to help you practice using regex. His examples are based on Netbeans but can be used in just about any IDE that supports regex (or even just your code). He shows how to match word boundaries, do some grouping, work with back references and doing some search/replace based on multiple groupings.
2011-11-23 01:06:
On her blog today Lorna Mitchell has a quick tip for anyone having an issue sending POSTed JSON data with the curl functionality that can be built into PHP. The trick to her method is sending things with the right header. We can't send post fields, because we want to send JSON, not pretend to be a form (the merits of an API which accepts POST requests with data in form-format is an interesting debate). Instead, we create the correct JSON data, set that as the body of the POST request, and also set the headers correctly so that the server that receives this request will understand what we sent. She includes a code example (about ten lines) showing the POSTing process that sets up options using curl's curl_setopt. Be sure to set up the headers to send as "application/json" - that's the trick to letting the remote end know the format.
Lorna Mitchell's Blog: POSTing JSON Data With PHP cURL
On her blog today Lorna Mitchell has a quick tip for anyone having an issue sending POSTed JSON data with the curl functionality that can be built into PHP. The trick to her method is sending things with the right header. We can't send post fields, because we want to send JSON, not pretend to be a form (the merits of an API which accepts POST requests with data in form-format is an interesting debate). Instead, we create the correct JSON data, set that as the body of the POST request, and also set the headers correctly so that the server that receives this request will understand what we sent. She includes a code example (about ten lines) showing the POSTing process that sets up options using curl's curl_setopt. Be sure to set up the headers to send as "application/json" - that's the trick to letting the remote end know the format.
2011-11-23 00:58:
On the php|architect site there's a recent tutorial from Cal Evans about building a transactional email system with the help of a simple library and the SES system from Amazon. I love APIs. A well-defined API can make short work of a complex problem. It's even more fun when you find a cool API with a great wrapper to make it simple to use. That's what I found when I started playing with Amazon's Simple Email Service; a tool that was easy to work with, solved a problem I needed solved, and had a simple to use PHP wrapper. Based on the SES library by Dan Meyers, he includes the code to pull in a simple email template and populate it with the values you want, log in to the Amazon SES service and send the email via the remote service.
php|architect: Transactional Emails for Fun and Profit
On the php|architect site there's a recent tutorial from Cal Evans about building a transactional email system with the help of a simple library and the SES system from Amazon. I love APIs. A well-defined API can make short work of a complex problem. It's even more fun when you find a cool API with a great wrapper to make it simple to use. That's what I found when I started playing with Amazon's Simple Email Service; a tool that was easy to work with, solved a problem I needed solved, and had a simple to use PHP wrapper. Based on the SES library by Dan Meyers, he includes the code to pull in a simple email template and populate it with the values you want, log in to the Amazon SES service and send the email via the remote service.
2011-11-22 23:46:
Continuing on from the first part of their series, DevShed has posted part two of their "Building an ORM in PHP" series. This latest tutorial focuses on domain modeling (and collection handling). In that first part, I implemented the ORM's data access and mapping layers. And as you'll surely recall, the entire implementation process was pretty straightforward and easy to follow. Of course, in its current state the ORM is still far from a fully-functional structure. We need to add some additional components to it, such as a domain model and the classes responsible for handling collections of entities (remember that the ORM relies heavily on the data mapper pattern to do its business properly). He stays with his "simple blog" example and shows domain models (based on an abstract entity) for Entries, Comments and Authors. His containers extend the Countable, IteratorAggregate and ArrayAccess interfaces to give them some extra abilities.
DevShed: Building an ORM in PHP: Domain Modeling
Continuing on from the first part of their series, DevShed has posted part two of their "Building an ORM in PHP" series. This latest tutorial focuses on domain modeling (and collection handling). In that first part, I implemented the ORM's data access and mapping layers. And as you'll surely recall, the entire implementation process was pretty straightforward and easy to follow. Of course, in its current state the ORM is still far from a fully-functional structure. We need to add some additional components to it, such as a domain model and the classes responsible for handling collections of entities (remember that the ORM relies heavily on the data mapper pattern to do its business properly). He stays with his "simple blog" example and shows domain models (based on an abstract entity) for Entries, Comments and Authors. His containers extend the Countable, IteratorAggregate and ArrayAccess interfaces to give them some extra abilities.
2011-11-22 22:31:
On PHPMaster.com there's a new post by Michelle Sanver about The PHP People, a.k.a the PHP community, and some of the great resources you can use to get help on a problem or just reach out and meet some other PHP-ers in your area (or at a national conference!) If you're ever stuck on a problem, Google it and you'll find a swarm of users have most likely experienced the same issue and have already shared their solution. If it's not out there, ask in a public forum and people will help you find the answer. And if you've managed to solve it yourself, then write about it! That way you'll be contributing to helping others the same way others are willing to help you. That's one part of the PHP community that makes it really stand out - people share their knowledge and are more than willing to help others along their journey with PHP. Some resources/places to meet like-minded developers include: StackOverflow Conferences like PFCongres 2011 or PHPNW 11 Groups like PHPWomen or local user groups The community in PHP is huge and is growing every day, and it's all about sharing. If you see someone in need and you're able to help, offer him guidance. If you see an open-source project that's great; contribute and help it grow.
PHPMaster.com: The PHP People
On PHPMaster.com there's a new post by Michelle Sanver about The PHP People, a.k.a the PHP community, and some of the great resources you can use to get help on a problem or just reach out and meet some other PHP-ers in your area (or at a national conference!) If you're ever stuck on a problem, Google it and you'll find a swarm of users have most likely experienced the same issue and have already shared their solution. If it's not out there, ask in a public forum and people will help you find the answer. And if you've managed to solve it yourself, then write about it! That way you'll be contributing to helping others the same way others are willing to help you. That's one part of the PHP community that makes it really stand out - people share their knowledge and are more than willing to help others along their journey with PHP. Some resources/places to meet like-minded developers include: StackOverflow Conferences like PFCongres 2011 or PHPNW 11 Groups like PHPWomen or local user groups The community in PHP is huge and is growing every day, and it's all about sharing. If you see someone in need and you're able to help, offer him guidance. If you see an open-source project that's great; contribute and help it grow.
2011-11-22 21:54:
On Developer Drive today they've posted the most recent article in a tutorial series showing you how to create a user survey that stores the results to a database table. In this latest tutorial, they show how to hook the current code into a MySQL backend. In the first two parts of this series, we created the data layer that will hold the polling data and established methods for setting the variable values and reading from the database tables. In this part, we will build the methods that will write new polls and answers to the tables. They include the code for an "addPoll" method that inserts the questions and answers for the polls. Their "editPoll" method updates the poll questions/answers and the "addVote" method does exactly like it sounds - adding a vote to one of the poll options. Also included are "deletePoll", "activatePoll" and "deactivatePoll".
Developer Drive: Creating a PHP User Survey: Writing to Database Tables
On Developer Drive today they've posted the most recent article in a tutorial series showing you how to create a user survey that stores the results to a database table. In this latest tutorial, they show how to hook the current code into a MySQL backend. In the first two parts of this series, we created the data layer that will hold the polling data and established methods for setting the variable values and reading from the database tables. In this part, we will build the methods that will write new polls and answers to the tables. They include the code for an "addPoll" method that inserts the questions and answers for the polls. Their "editPoll" method updates the poll questions/answers and the "addVote" method does exactly like it sounds - adding a vote to one of the poll options. Also included are "deletePoll", "activatePoll" and "deactivatePoll".
2011-11-21 19:12:
On the Ibuildings techPortal today they've posted the latest episode of their DPC Radio series of podcasts, recordings of sessions from this year's Dutch PHP Conference. In this new episode they share the presentation by Kore Nordmann "Distributed Couch Apps - Embracing eventual consistency". CouchDB is a prominent representative of the NoSQL movement. Using its integrated web server and eventual consistent replication you can not only distribute data, but also full application code. This even works for clients which are not always connected to the internet, like e.g. mobile devices. This session gives you an insight Couch apps, their beauty and pitfalls. You can either listen via the in-page player, by downloading the mp3 or by subscribing to their feed. You can find his slides over on talks.qafoo.com.
Ibuildings techPortal: DPC Radio: Distributed Couch Apps - Embracing eventual consistency
On the Ibuildings techPortal today they've posted the latest episode of their DPC Radio series of podcasts, recordings of sessions from this year's Dutch PHP Conference. In this new episode they share the presentation by Kore Nordmann "Distributed Couch Apps - Embracing eventual consistency". CouchDB is a prominent representative of the NoSQL movement. Using its integrated web server and eventual consistent replication you can not only distribute data, but also full application code. This even works for clients which are not always connected to the internet, like e.g. mobile devices. This session gives you an insight Couch apps, their beauty and pitfalls. You can either listen via the in-page player, by downloading the mp3 or by subscribing to their feed. You can find his slides over on talks.qafoo.com.
2011-11-21 18:26:
On PHPBuilder.com there's a recent post showing you how to connect your application with Facebook's graph API and grabbing the current user's public profile information. In recent years, [Facebook's] influence has dramatically grown thanks to the Facebook Platform, a set of APIs which third-parties can use to create or extend applications which tightly integrate with Facebook.com's features and users. [...] PHP-minded developers are particularly fortunate, as the Facebook PHP SDK doesn't only provide users a powerful solution for interacting with the social graph, but because it's actively maintained by the Facebook development team is often the first of several available APIs to offer the latest features and bug fixes. He points out the github repostory for grabbing the Facebook SDK, the information you'd get (at a minimum) from the API and the sort of detail you can expect from a user logged into your application. Sample code is included for this last example.
PHPBuilder.com: Talking to Facebook's Social Graph with PHP
On PHPBuilder.com there's a recent post showing you how to connect your application with Facebook's graph API and grabbing the current user's public profile information. In recent years, [Facebook's] influence has dramatically grown thanks to the Facebook Platform, a set of APIs which third-parties can use to create or extend applications which tightly integrate with Facebook.com's features and users. [...] PHP-minded developers are particularly fortunate, as the Facebook PHP SDK doesn't only provide users a powerful solution for interacting with the social graph, but because it's actively maintained by the Facebook development team is often the first of several available APIs to offer the latest features and bug fixes. He points out the github repostory for grabbing the Facebook SDK, the information you'd get (at a minimum) from the API and the sort of detail you can expect from a user logged into your application. Sample code is included for this last example.
2011-11-21 17:58:
In the latest installment of their "Localizing PHP Applications 'The Right Way'" tutorial series (part four), they show off a feature of gettext that makes it simpler to deal with singular versus plural versions of your translations. In Part 3 you learned some of the more important aspects of real-world localizing your application, such as using a default fallback locale and separating messages into multiple domain files depending on their usage. In this part I'll show you what is arguably the most powerful feature of gettext - handling plural forms. The plural forms feature of gettext you enable you to localize your application perfectly and professionally. The simple example they give is the difference between things like "1 file" versus "2 files". English is simpler than some other languages but gettext has special handling you can add to your translation files to help. A rule placed at the top of your file defines where to start the singular vs plural switch.
PHPMaster.com: Localizing PHP Applications "The Right Way", Part 4
In the latest installment of their "Localizing PHP Applications 'The Right Way'" tutorial series (part four), they show off a feature of gettext that makes it simpler to deal with singular versus plural versions of your translations. In Part 3 you learned some of the more important aspects of real-world localizing your application, such as using a default fallback locale and separating messages into multiple domain files depending on their usage. In this part I'll show you what is arguably the most powerful feature of gettext - handling plural forms. The plural forms feature of gettext you enable you to localize your application perfectly and professionally. The simple example they give is the difference between things like "1 file" versus "2 files". English is simpler than some other languages but gettext has special handling you can add to your translation files to help. A rule placed at the top of your file defines where to start the singular vs plural switch.
2011-11-21 16:15:
A few days ago Kevin Schroeder showed how to connect the Zend cloud services with the Zend Studio IDE. In this new post he shows how to connect another popular IDE - PHPStorm. Just because you want to use the Zend Developer Cloud at phpcloud.com doesn't mean that you necessarily use Zend Studio. While I may wonder why you don't use Zend Studio ( :-) ) I know there are a lot of other good IDE's on the market and an IDE like PHPStorm might suit how you do your development. He walks you through the whole process, complete with screenshots - creating the project on phpcloud, cloning your git repo there, configure PHPStorm for deployment (via SFTP) and set up a little path mapping.
Kevin Schroeder's Blog: Connecting to the Zend Developer Cloud with PHPStorm
A few days ago Kevin Schroeder showed how to connect the Zend cloud services with the Zend Studio IDE. In this new post he shows how to connect another popular IDE - PHPStorm. Just because you want to use the Zend Developer Cloud at phpcloud.com doesn't mean that you necessarily use Zend Studio. While I may wonder why you don't use Zend Studio ( :-) ) I know there are a lot of other good IDE's on the market and an IDE like PHPStorm might suit how you do your development. He walks you through the whole process, complete with screenshots - creating the project on phpcloud, cloning your git repo there, configure PHPStorm for deployment (via SFTP) and set up a little path mapping.
2011-11-21 15:35:
In a new post from Derick Rethans he talks about an extension version of Twig, the popular templating engine from the creators of the Symfony framework. A while ago, Fabien asked me to have a look at porting one of Twig's slowest methods, TwigTemplate::getAttribute(), into a PHP extension. It is a complex method that does a lot of different checks and look-ups. Fabien's benchmarks showed that this method was responsible for quite a large amount of time. On top of that, it didn't seem that it could be optimised any further as PHP code itself. He points to the twig-ext extension that's a reworked version of the "getAttribute" method from the tool and the performance gain (about 15%) it gives. Compiled templates will automatically call this new method in the extension. This update has already been merged into the main Twig repo.
Derick Rethans' Blog: Twig extension
In a new post from Derick Rethans he talks about an extension version of Twig, the popular templating engine from the creators of the Symfony framework. A while ago, Fabien asked me to have a look at porting one of Twig's slowest methods, TwigTemplate::getAttribute(), into a PHP extension. It is a complex method that does a lot of different checks and look-ups. Fabien's benchmarks showed that this method was responsible for quite a large amount of time. On top of that, it didn't seem that it could be optimised any further as PHP code itself. He points to the twig-ext extension that's a reworked version of the "getAttribute" method from the tool and the performance gain (about 15%) it gives. Compiled templates will automatically call this new method in the extension. This update has already been merged into the main Twig repo.
2011-11-21 14:01:
Latest PEAR Releases: Net_IPv6 1.2.2b
Community News: Latest PEAR Releases for 11.21.2011
Latest PEAR Releases: Net_IPv6 1.2.2b
2011-11-18 19:41:
Jan Bodnar has pointed out a great PHP-GTK tutorial on ZetaCode.com that walks you through some of the major points of this graphical frontend for PHP: This tutorial will teach you the basics of GUI programming with the PHP GTK. The tutorial has 8 chapters which cover the first steps with the library, menus, toolbars, dialogs and various widgets. It has some examples for drawing with Cairo library. The final chapter presents a small computer game; The Nibbles. Each of the topics has sample code and screenshots of the resulting output for each. Also included is information on layouts and "painting" with Cairo - drawing shapes, rectangles, text, etc.
ZetaCode.com: PHP GTK tutorial
Jan Bodnar has pointed out a great PHP-GTK tutorial on ZetaCode.com that walks you through some of the major points of this graphical frontend for PHP: This tutorial will teach you the basics of GUI programming with the PHP GTK. The tutorial has 8 chapters which cover the first steps with the library, menus, toolbars, dialogs and various widgets. It has some examples for drawing with Cairo library. The final chapter presents a small computer game; The Nibbles. Each of the topics has sample code and screenshots of the resulting output for each. Also included is information on layouts and "painting" with Cairo - drawing shapes, rectangles, text, etc.
2011-11-18 18:03:
Henrik Bjørnskov has a quick new post today showing how to combine two powerful technologies into a simple, configurable autoload system in a Symfony Travis-CI build with Composer. To integrate your project with travis the only thing necesarry is to have a .travis.yml file and a working PHPUnit test setup like http://github.com/simplethings/SimpleThingsFormExtraBundle. Where the Tests/vendors.php script is executed before the tests are perfomed. But it would be way cooler to just have Composer handle the autoloading and dependencies. A sample .travis.yml file is included in the post (also here) as well as instructions for grabbing dependencies and including the autoload process in your application's bootstrap.
Henrik Bjørnskov's Blog: Travis & Composer sitting in a tree K-I-S-S-I-N-G
Henrik Bjørnskov has a quick new post today showing how to combine two powerful technologies into a simple, configurable autoload system in a Symfony Travis-CI build with Composer. To integrate your project with travis the only thing necesarry is to have a .travis.yml file and a working PHPUnit test setup like http://github.com/simplethings/SimpleThingsFormExtraBundle. Where the Tests/vendors.php script is executed before the tests are perfomed. But it would be way cooler to just have Composer handle the autoloading and dependencies. A sample .travis.yml file is included in the post (also here) as well as instructions for grabbing dependencies and including the autoload process in your application's bootstrap.
2011-11-18 17:13:
In this new post to his blog, Johannes Schlüter looks at a high-performance solution to the usual storing PHP session information via a memcache frontend with a MySQL Cluster backend. Unfortunately even such a system [using MySQL and InnoDB tables] has limits and unfortunately replication is no good solution here to scale further as we will always need a master for writing the updated session data. By using replication we can take some load from it and we can configure a slave which can be promoted to master to keep session alive if the primary master machine fails but at some point in time we need another solution ... but, happy news, again: One doesn't have to look far as MySQL cluster will be happy to help. MySQL Cluster "is a high-availability, high-redundancy version of MySQL adapted for the distributed computing environment," as the MySQL documentation states. He describes the setup (after pointing to this post about installing MySQL Cluster for memcache) and includes some sample code/SQL/ini settings you'll need to use to get PHP's memcached functionality to cooperate with it.
Johannes Schlüter's Blog: High Performance PHP Session Storage on Scale
In this new post to his blog, Johannes Schlüter looks at a high-performance solution to the usual storing PHP session information via a memcache frontend with a MySQL Cluster backend. Unfortunately even such a system [using MySQL and InnoDB tables] has limits and unfortunately replication is no good solution here to scale further as we will always need a master for writing the updated session data. By using replication we can take some load from it and we can configure a slave which can be promoted to master to keep session alive if the primary master machine fails but at some point in time we need another solution ... but, happy news, again: One doesn't have to look far as MySQL cluster will be happy to help. MySQL Cluster "is a high-availability, high-redundancy version of MySQL adapted for the distributed computing environment," as the MySQL documentation states. He describes the setup (after pointing to this post about installing MySQL Cluster for memcache) and includes some sample code/SQL/ini settings you'll need to use to get PHP's memcached functionality to cooperate with it.
2011-11-18 16:45:
On DevShed today there's a new tutorial showing you how to build a basic ORM layer on top of a MySQL database. It includes all the code you'll need (cut&paste-able, not as a download). Obviously, with so many ORMs at one's disposal for free, it seems pretty pointless to develop a custom one; are we trying to reinvent the wheel? No, of course not. But if you need to create a simple application that performs a few CRUD operations on some related domain objects and don't want to climb the learning curve of a third-party library, then implementing a custom ORM might make sense. There's alos the educational aspect of the process (yes, learning one or two things never hurts). They start you off with the creation of the "data persistence layer" (an interface first) to connect to the database, building a MySQL-specific one on top of it. Next up is the data mapper layer making things like "fetch by ID" and the insert/update/delete possible. Their simple example doesn't include anything about ORM relationships, though - just fetching simple rows.
DevShed: Building an ORM in PHP
On DevShed today there's a new tutorial showing you how to build a basic ORM layer on top of a MySQL database. It includes all the code you'll need (cut&paste-able, not as a download). Obviously, with so many ORMs at one's disposal for free, it seems pretty pointless to develop a custom one; are we trying to reinvent the wheel? No, of course not. But if you need to create a simple application that performs a few CRUD operations on some related domain objects and don't want to climb the learning curve of a third-party library, then implementing a custom ORM might make sense. There's alos the educational aspect of the process (yes, learning one or two things never hurts). They start you off with the creation of the "data persistence layer" (an interface first) to connect to the database, building a MySQL-specific one on top of it. Next up is the data mapper layer making things like "fetch by ID" and the insert/update/delete possible. Their simple example doesn't include anything about ORM relationships, though - just fetching simple rows.
2011-11-18 15:18:
On DZone.com there's a new post from Giorgio Sironi looking at how to automate a build of a virtual server with Vagrant, setting up a LAMP-based development instance. Vagrant ia a tool for building virtual machines (in VirtualBox's format) that conforms to a specification. It's written in Ruby, but it makes really no assumptions over the environments that you're gonna build; in this article, we will setup a virtual server for PHP applications running inside Apache. The end result is a virtual machine based on VirtualBox images and can be built in a few easy steps: install the vagrant gems on the build system add a new virtual box instance pointed to a .box file create the Vagrant config (including the commands to run post-create) set up a little port forawrding creating a phpinfo file and starting up Apache One suggested place for grabbing images (some with pre-defined software) is Bitnami's "Stacks" repository.
DZone.com: Creating a virtual server with Vagrant: a practical walkthrough
On DZone.com there's a new post from Giorgio Sironi looking at how to automate a build of a virtual server with Vagrant, setting up a LAMP-based development instance. Vagrant ia a tool for building virtual machines (in VirtualBox's format) that conforms to a specification. It's written in Ruby, but it makes really no assumptions over the environments that you're gonna build; in this article, we will setup a virtual server for PHP applications running inside Apache. The end result is a virtual machine based on VirtualBox images and can be built in a few easy steps: install the vagrant gems on the build system add a new virtual box instance pointed to a .box file create the Vagrant config (including the commands to run post-create) set up a little port forawrding creating a phpinfo file and starting up Apache One suggested place for grabbing images (some with pre-defined software) is Bitnami's "Stacks" repository.
2011-11-18 14:09:
Popular posts from PHPDeveloper.org for the past week:PHPMaster.com: PHP Master: Writing Cutting-Edge Code php|architect: Finding Exactly Where You Are PHPBuilder.com: Building RESTful Web Services with the Zend Framework Community News: Zend Framework 2 Development - CLA Not Required! PHP.net: PHP 5.4 RC 1 Released Learncomputer.com: PHP Profilers Compared (PHP Quick Profiler & XDebug) Court Ewing's Blog: Follow-up: How PHP is Broken and How It Can Be Fixed Robert Basic's Blog: Benchmarking pages behind a login with ab PHPMaster.com: Getting Started with PHPUnit PHPMaster.com: Localizing PHP Applications "The Right Way", Part 3
Site News: Popular Posts for the Week of 11.18.2011
Popular posts from PHPDeveloper.org for the past week:PHPMaster.com: PHP Master: Writing Cutting-Edge Code php|architect: Finding Exactly Where You Are PHPBuilder.com: Building RESTful Web Services with the Zend Framework Community News: Zend Framework 2 Development - CLA Not Required! PHP.net: PHP 5.4 RC 1 Released Learncomputer.com: PHP Profilers Compared (PHP Quick Profiler & XDebug) Court Ewing's Blog: Follow-up: How PHP is Broken and How It Can Be Fixed Robert Basic's Blog: Benchmarking pages behind a login with ab PHPMaster.com: Getting Started with PHPUnit PHPMaster.com: Localizing PHP Applications "The Right Way", Part 3
2011-11-17 19:07:
As is mentioned on Michelangelo van Dam's blog, the PHPBenelux conference for 2012 has been announced and tickets are now on sale. The PHPBenelux team only announced the names of tutorial speakers, but with names like Ivo Jansch, Torsten Rhinne, Fabien Potencier and Matthew Weier O'Phinney you know it's going to rock! And that's tutorials only. It's all happening on January 27 and 28, so make sure you block those days in your calendar, because the center of Europe is going to buzz PHP like it never had before! The tickets can be purchased here for the Early Bird rates (until December 16th) of 260 Euro for the full event (conference+tutorials) and 135 Euro for just the conference.
Community News: PHPBenelux 2012 Announcement - Tutorial Speakers & Ticket Sales
As is mentioned on Michelangelo van Dam's blog, the PHPBenelux conference for 2012 has been announced and tickets are now on sale. The PHPBenelux team only announced the names of tutorial speakers, but with names like Ivo Jansch, Torsten Rhinne, Fabien Potencier and Matthew Weier O'Phinney you know it's going to rock! And that's tutorials only. It's all happening on January 27 and 28, so make sure you block those days in your calendar, because the center of Europe is going to buzz PHP like it never had before! The tickets can be purchased here for the Early Bird rates (until December 16th) of 260 Euro for the full event (conference+tutorials) and 135 Euro for just the conference.
2011-11-17 18:57:
In a new post to his blog Sameer Borate shows how to create a lexer and parser in PHP to work directly with the tokens of a PHP script. After looking around for a while [for a good resource on compilers] I settled for Terence Parr's Language Implementation Patterns. This is exactly what I needed - bit sized patterns on compiler and parser design with working code. The book provides a recipe style approach, gradually moving from simple to complex compiler/parser design issues. As I primarily work with PHP, I thought of porting some code to PHP to see how it works. He shows examples using his custom tool to show a basic lexer output for a list and a complete listing of the code involved. Ultimately, though, he finds that PHP isn't overly suited to the task - anything more than his simple example could be more trouble than it's worth.
Sameer Borate's Blog: Building a simple Parser and Lexer in PHP
In a new post to his blog Sameer Borate shows how to create a lexer and parser in PHP to work directly with the tokens of a PHP script. After looking around for a while [for a good resource on compilers] I settled for Terence Parr's Language Implementation Patterns. This is exactly what I needed - bit sized patterns on compiler and parser design with working code. The book provides a recipe style approach, gradually moving from simple to complex compiler/parser design issues. As I primarily work with PHP, I thought of porting some code to PHP to see how it works. He shows examples using his custom tool to show a basic lexer output for a list and a complete listing of the code involved. Ultimately, though, he finds that PHP isn't overly suited to the task - anything more than his simple example could be more trouble than it's worth.
2011-11-17 17:19:
On PHPMaster.com today there's a new introductory tutorial for those trying to figure out sessions in PHP. Sessions can be one of the most powerful tools at your disposal and handling them correctly can sometimes be a little tricky. $_SESSION is a special array used to store information across the page requests a user makes during his visit to your website or web application. The most fundamental way to explain what a sessions is like is to imagine the following scenario: You are working with an application. You open it, make some changes, and then you close it. That is a session in it's simplest form. They start with a basic "how to use them" example of setting a username value to the current session and pulling the value back out. They also show the use of the session_unset and session_destroy methods for ending the session. Some security tips are mentioned too - timeouts, regenerating the session ID, destroying them correctly and using a more permanent storage option (by default, they store on the local disk).
PHPMaster.com: PHP Sessions
On PHPMaster.com today there's a new introductory tutorial for those trying to figure out sessions in PHP. Sessions can be one of the most powerful tools at your disposal and handling them correctly can sometimes be a little tricky. $_SESSION is a special array used to store information across the page requests a user makes during his visit to your website or web application. The most fundamental way to explain what a sessions is like is to imagine the following scenario: You are working with an application. You open it, make some changes, and then you close it. That is a session in it's simplest form. They start with a basic "how to use them" example of setting a username value to the current session and pulling the value back out. They also show the use of the session_unset and session_destroy methods for ending the session. Some security tips are mentioned too - timeouts, regenerating the session ID, destroying them correctly and using a more permanent storage option (by default, they store on the local disk).
2011-11-17 16:47:
On the Symfony Blog today they have an update on their latest community offering, SensioLabs Connect, a service connecting Symfony developers all around the world. It's been one week since the release and there's already some changes happening. To celebrate our 1000th user on SensioLabs Connect in a week, we have just rolled out a new version that takes into account some of the feedback we had from the community after the launch. Changes include updates to use Gravatar images if you choose not to upload a photo, fixes for a bug with email confirmations and a few new badges added to the system - "first 100 users", "attendees of SymfonyLive" and ones based on seniority in the community. A public API is in the works, but you can grab a profile in json by adding ".json" to the end of a profile URL (like Fabien's).
Symfony Blog: SensioLabs Connect, a week later
On the Symfony Blog today they have an update on their latest community offering, SensioLabs Connect, a service connecting Symfony developers all around the world. It's been one week since the release and there's already some changes happening. To celebrate our 1000th user on SensioLabs Connect in a week, we have just rolled out a new version that takes into account some of the feedback we had from the community after the launch. Changes include updates to use Gravatar images if you choose not to upload a photo, fixes for a bug with email confirmations and a few new badges added to the system - "first 100 users", "attendees of SymfonyLive" and ones based on seniority in the community. A public API is in the works, but you can grab a profile in json by adding ".json" to the end of a profile URL (like Fabien's).
2011-11-17 15:30:
On SitePoint today there's a new post from Eran Galperin (of Binpress) about how, if you're jumping immediately to custom software development, you're probably doing it wrong. Code reuse is largely accepted as "best practice" in our industry. Code reuse has many advantages, such as a smaller code-base which is easier to grok for developers. It's easier to maintain and optimize, since you can make less changes in order to achieve the desired results. Many modern techniques and tools were created in order to better reuse and modularize code. But while we're reusing code, we're duplicating effort. The same code is being written over and over in different places, wasting time and money. He suggests that custom development should always be a last resort for software development, that there's plenty of other (open source) software out there that meets many of the needs businesses have. In his opinion, component-based development is the future of the industry - pieces that fit together with common interfaces and are larger than the sum of their parts. He sees a "commercial open source" model emerging from the current state of things. This model could result in more well maintained OS projects and more functionality being released as a part of it. What we have currently is increasing noise, as more and more people have easier access to start programming and publishing their projects. We need to streamline the process and add that missing financial element that makes it sustainable and repeatable.
SitePoint.com: Software Development? We're Doing it Wrong.
On SitePoint today there's a new post from Eran Galperin (of Binpress) about how, if you're jumping immediately to custom software development, you're probably doing it wrong. Code reuse is largely accepted as "best practice" in our industry. Code reuse has many advantages, such as a smaller code-base which is easier to grok for developers. It's easier to maintain and optimize, since you can make less changes in order to achieve the desired results. Many modern techniques and tools were created in order to better reuse and modularize code. But while we're reusing code, we're duplicating effort. The same code is being written over and over in different places, wasting time and money. He suggests that custom development should always be a last resort for software development, that there's plenty of other (open source) software out there that meets many of the needs businesses have. In his opinion, component-based development is the future of the industry - pieces that fit together with common interfaces and are larger than the sum of their parts. He sees a "commercial open source" model emerging from the current state of things. This model could result in more well maintained OS projects and more functionality being released as a part of it. What we have currently is increasing noise, as more and more people have easier access to start programming and publishing their projects. We need to streamline the process and add that missing financial element that makes it sustainable and repeatable.
2011-11-16 19:10:
On the CloudSpring site today there's the continuation of a previous article about RackSpace's CloudFiles API. In this new post they show how to use their PHP SDK to connect to and use the CloudFiles service. Rackspace provides a Software Development Kit (SDK) for multiple programming languages. They store their PHP SDK on GitHub. The PHP SDK requires PHP 5 with the following modules: cURL, FileInfo and mbstring. In this tutorial we are going to review use of the PHP SDK with CloudFiles. Not all parts of the API will be covered but you will get a great start. Code is included showing how to make the connection, work with containers, pushing content out to a CDN, object handling and a few other handy tips (and API info) to help you along your way.
CloudSpring.com: Using the Rackspace PHP SDK
On the CloudSpring site today there's the continuation of a previous article about RackSpace's CloudFiles API. In this new post they show how to use their PHP SDK to connect to and use the CloudFiles service. Rackspace provides a Software Development Kit (SDK) for multiple programming languages. They store their PHP SDK on GitHub. The PHP SDK requires PHP 5 with the following modules: cURL, FileInfo and mbstring. In this tutorial we are going to review use of the PHP SDK with CloudFiles. Not all parts of the API will be covered but you will get a great start. Code is included showing how to make the connection, work with containers, pushing content out to a CDN, object handling and a few other handy tips (and API info) to help you along your way.
2011-11-16 18:56:
In this new post to his blog Stoimen Popov talks about calling the "destructor" method of an object and why doing it directly could lead to some issues - like not actually destroying the object before the script ends. At the end of the script the interpreter frees the memory. Actually every object has a built-in destructor, just like it has built-in constructor. So even we don't define it explicitly, the object has its destructor. Usually this destructor is executed at the end of the script, or whenever the object isn't needed anymore. This can happen, for instance, at the end of a function body. Now if we call the destructor explicitly, which as I said I've seen many times, here's what happen. As you can see calling the destructor explicitly doesn't destroy the object. So the question is...how to destroy an object before the script stops? He points out that one way to "destroy" an object is to null it out and remove the structure from memory. This is tricky, though, because a clone of the object will still exist in memory, just not the original.
Stoimen Popov's Blog: PHP: Don't Call the Destructor Explicitly
In this new post to his blog Stoimen Popov talks about calling the "destructor" method of an object and why doing it directly could lead to some issues - like not actually destroying the object before the script ends. At the end of the script the interpreter frees the memory. Actually every object has a built-in destructor, just like it has built-in constructor. So even we don't define it explicitly, the object has its destructor. Usually this destructor is executed at the end of the script, or whenever the object isn't needed anymore. This can happen, for instance, at the end of a function body. Now if we call the destructor explicitly, which as I said I've seen many times, here's what happen. As you can see calling the destructor explicitly doesn't destroy the object. So the question is...how to destroy an object before the script stops? He points out that one way to "destroy" an object is to null it out and remove the structure from memory. This is tricky, though, because a clone of the object will still exist in memory, just not the original.
2011-11-16 17:06:
On DZone.com today Girogio Sironi shares some of his experiences testing out the PHP bindings currently offered to work with Selenium, the web application frontend testing tool that's become a standard over the past few years. After trying out Selenium 2, it was natural for me to look for its support in PHP code; however, there isn't an official PHP Api distributed on Selenium's website. I tested all the PHP bindings I could find to see which is the best choice today. He tried out a few different technologies: PHPUnit_Selenium Facebook's php-webdriver the php-webdriver-bindings project WebDriver-PHP The finishes the post with a quick summary for each of the offerings including strengths each has and situations where you might want to use them.
DZone.com: Selenium 2 from PHP code
On DZone.com today Girogio Sironi shares some of his experiences testing out the PHP bindings currently offered to work with Selenium, the web application frontend testing tool that's become a standard over the past few years. After trying out Selenium 2, it was natural for me to look for its support in PHP code; however, there isn't an official PHP Api distributed on Selenium's website. I tested all the PHP bindings I could find to see which is the best choice today. He tried out a few different technologies: PHPUnit_Selenium Facebook's php-webdriver the php-webdriver-bindings project WebDriver-PHP The finishes the post with a quick summary for each of the offerings including strengths each has and situations where you might want to use them.
2011-11-16 16:43:
Lorna Mitchell has a quick new post showing one way to handle SQL errors in PDO that could pop up because of badly written/generated SQL statements. I love PHP's PDO (PHP Data Objects) extension; it gives a consistent, object-oriented interface to handling all kinds of relational database backends. One thing that annoys me is that the MySQL driver for PDO defaults to a silent error mode which can make SQL errors tricky to spot! In her two code snippets she shows a failing PDO request (that fails silently) and a method for catching this issue - checking the result of the "errorCode" method to see if it equals "0" (zero). If there were errors, you can use the "errorInfo" function to get to them. This will return the SQL error code, the driver-specific error code and a driver-specific error message.
Lorna Mitchell's Blog: Handling SQL Errors in PDO
Lorna Mitchell has a quick new post showing one way to handle SQL errors in PDO that could pop up because of badly written/generated SQL statements. I love PHP's PDO (PHP Data Objects) extension; it gives a consistent, object-oriented interface to handling all kinds of relational database backends. One thing that annoys me is that the MySQL driver for PDO defaults to a silent error mode which can make SQL errors tricky to spot! In her two code snippets she shows a failing PDO request (that fails silently) and a method for catching this issue - checking the result of the "errorCode" method to see if it equals "0" (zero). If there were errors, you can use the "errorInfo" function to get to them. This will return the SQL error code, the driver-specific error code and a driver-specific error message.
2011-11-16 15:02:
If you're a Zend Studio user and have been wondering how to hook it directly into the phpcloud service from Zend, Kevin Schroeder has posted complete instructions in a new post today (complete with screenshots). PHPCloud.com is the landing page for our new cloud offering. Using the Zend Application Fabric you can build your applications in the same environment as you will be deploying your apps to. The application is built on my.phpcloud.com and you can then deploy it onto any platform where the Fabric is supported. But how do you get started? Phpcloud.com has been built in a way where you can connect with any IDE. With Zend Studio 9 that connectivity has been built directly in to the IDE. It's a simple six (well, technically seven) step process that involves setting up a new project, configuring some deployment options and hitting "deploy". Zend Studio makes it super simple to launch your application as many times as you need - a one-click deploy once things are all set up.
Kevin Schroeder's Blog: Connecting to PHPCloud.com through Zend Studio 9
If you're a Zend Studio user and have been wondering how to hook it directly into the phpcloud service from Zend, Kevin Schroeder has posted complete instructions in a new post today (complete with screenshots). PHPCloud.com is the landing page for our new cloud offering. Using the Zend Application Fabric you can build your applications in the same environment as you will be deploying your apps to. The application is built on my.phpcloud.com and you can then deploy it onto any platform where the Fabric is supported. But how do you get started? Phpcloud.com has been built in a way where you can connect with any IDE. With Zend Studio 9 that connectivity has been built directly in to the IDE. It's a simple six (well, technically seven) step process that involves setting up a new project, configuring some deployment options and hitting "deploy". Zend Studio makes it super simple to launch your application as many times as you need - a one-click deploy once things are all set up.
2011-11-15 19:56:
php|architect has officially announced the speaker line up for what they call their "Cloud Summit", a day-long event happening at the end of November about cloud computing - what it is and how you and your PHP applications can take advantage of it. Tired of hearing about the ever-so... nebulous "Cloud" and what vendors say it will do for humankind? Yeah, us too. So, why won't it just go away? We found some folks who have used the cloud successfully to strike it big and asked them to show us why it made such a big difference to them. We were surprised, and now we're going to share it with you. The event is virtual, so you can attend no matter where you are. The cost is $50 USD for a single ticket, $24 USD for php|architect subscribers and $100 USD for an "office party". Speakers for the event include Sean Coates (of Gimmie Bar), Kirsten Jones & Jeremy Johnstone and Marcus Whitney. You can find out more information and register for your ticket on the php|architect site.
php|architect: php|architect Live! presents The Cloud Summit
php|architect has officially announced the speaker line up for what they call their "Cloud Summit", a day-long event happening at the end of November about cloud computing - what it is and how you and your PHP applications can take advantage of it. Tired of hearing about the ever-so... nebulous "Cloud" and what vendors say it will do for humankind? Yeah, us too. So, why won't it just go away? We found some folks who have used the cloud successfully to strike it big and asked them to show us why it made such a big difference to them. We were surprised, and now we're going to share it with you. The event is virtual, so you can attend no matter where you are. The cost is $50 USD for a single ticket, $24 USD for php|architect subscribers and $100 USD for an "office party". Speakers for the event include Sean Coates (of Gimmie Bar), Kirsten Jones & Jeremy Johnstone and Marcus Whitney. You can find out more information and register for your ticket on the php|architect site.
2011-11-15 18:32:
As a reminder, the PHP UK Conference (2012) still has their "Blind Bird" tickets on sale until the 4th of December for £90: Purchase blindbird 2012 conference registration(s) for Friday 24th and/or Saturday 25th February - available at this price until 4th December 2011. After this time the earlybird 2012 conference registration for Friday 24th February will be available at £120/£210 excluding VAT, with only the full price of £140/£250 excluding VAT available from 3rd January 2012. The conference is two days in London with over 30 talks and 25 speakers. The schedule hasn't bene released yet (hence the "blind bird" pricing) but if it's anything like previous years, it will be packed with excellent sessions on a variety of subjects, from beginner to intermediate.
Community News: PHP UK Conference 2012 - "Blind Bird" Tickets until Dec. 4th
As a reminder, the PHP UK Conference (2012) still has their "Blind Bird" tickets on sale until the 4th of December for £90: Purchase blindbird 2012 conference registration(s) for Friday 24th and/or Saturday 25th February - available at this price until 4th December 2011. After this time the earlybird 2012 conference registration for Friday 24th February will be available at £120/£210 excluding VAT, with only the full price of £140/£250 excluding VAT available from 3rd January 2012. The conference is two days in London with over 30 talks and 25 speakers. The schedule hasn't bene released yet (hence the "blind bird" pricing) but if it's anything like previous years, it will be packed with excellent sessions on a variety of subjects, from beginner to intermediate.
2011-11-15 17:18:
In a follow up to his previous post about how PHP is broken (and what can be done to fix it), Court Ewing has this new post with a few suggestions on how PHP development could be better, but admits that PHP itself is not broken. It is no secret that the PHP development process has never been a shining example of project organization or quality assurance. Until recently, some of the most important aspects of any project's development cycle were either entirely lacking or were ill-defined. Worse, there was little in the form of systemic quality assurance. Fortunately, the core devs did not ignore these issues, and they've been pushing really hard to improve on these areas over the past few years. He points out two things that he sees as things that could be improved in the overall process of developing the language - noting that failing automated tests are ineffective and that communication is a key factor in the trust developers have in PHP. The core PHP developers have long been a key component of [the amazing things the language can do], and none of progress that modern PHP applications have made would be possible without their ongoing efforts. As a result of those efforts, PHP is a stable, secure, and beautifully-practical language that is both easy for novices to wrap their heads around and experts to build the most-used web applications the world has ever seen.
Court Ewing's Blog: Follow-up: How PHP is Broken and How It Can Be Fixed
In a follow up to his previous post about how PHP is broken (and what can be done to fix it), Court Ewing has this new post with a few suggestions on how PHP development could be better, but admits that PHP itself is not broken. It is no secret that the PHP development process has never been a shining example of project organization or quality assurance. Until recently, some of the most important aspects of any project's development cycle were either entirely lacking or were ill-defined. Worse, there was little in the form of systemic quality assurance. Fortunately, the core devs did not ignore these issues, and they've been pushing really hard to improve on these areas over the past few years. He points out two things that he sees as things that could be improved in the overall process of developing the language - noting that failing automated tests are ineffective and that communication is a key factor in the trust developers have in PHP. The core PHP developers have long been a key component of [the amazing things the language can do], and none of progress that modern PHP applications have made would be possible without their ongoing efforts. As a result of those efforts, PHP is a stable, secure, and beautifully-practical language that is both easy for novices to wrap their heads around and experts to build the most-used web applications the world has ever seen.
2011-11-15 16:53:
On the php|architect site there's a recent tutorial from Jeremy Kendall about full-text searching in SQLite, a lightweight database alternative that, since it's stored locally, can be used without a full database server. Full-text search with SQLite is so ridiculously easy to implement, there are only two valid reasons you haven't done it yet. The first is you don't need the full-text capability, and the second is you didn't know it could be done. In his method he creates a full-text search table (using fts4) and populating it with your data. You can use the "MATCH" keyword in your SQL to find the closest matches and even handy modifiers like "NEARBY", wildcards and token/prefixes in queries. For more detailed information, check out the SQLite documentation for a full guide.
php|architect: Full-text Search with SQLite
On the php|architect site there's a recent tutorial from Jeremy Kendall about full-text searching in SQLite, a lightweight database alternative that, since it's stored locally, can be used without a full database server. Full-text search with SQLite is so ridiculously easy to implement, there are only two valid reasons you haven't done it yet. The first is you don't need the full-text capability, and the second is you didn't know it could be done. In his method he creates a full-text search table (using fts4) and populating it with your data. You can use the "MATCH" keyword in your SQL to find the closest matches and even handy modifiers like "NEARBY", wildcards and token/prefixes in queries. For more detailed information, check out the SQLite documentation for a full guide.
2011-11-15 15:25:
On PHPMaster.com today, there's a new tutorial helping you get started with on of the most popular unit testing frameworks for PHP, PHPUnit. In this new article they help you write your first tests, run them and figure out what to do when they fail. Most people know that testing your websites is a good idea, but after some time testing can become tedious. What if a lot of this testing process could be automated so you don't have to go trough every function manually, time after time, to ensure that it still works after updating your code? This is where unit testing comes in, to automate the testing process. She starts with a simple, self-contained test - setting and getting a "name" value from a User class. The tests include an example of a setup/tear down and check that the result of the "talk()" method is correct with an assertEquals.
PHPMaster.com: Getting Started with PHPUnit
On PHPMaster.com today, there's a new tutorial helping you get started with on of the most popular unit testing frameworks for PHP, PHPUnit. In this new article they help you write your first tests, run them and figure out what to do when they fail. Most people know that testing your websites is a good idea, but after some time testing can become tedious. What if a lot of this testing process could be automated so you don't have to go trough every function manually, time after time, to ensure that it still works after updating your code? This is where unit testing comes in, to automate the testing process. She starts with a simple, self-contained test - setting and getting a "name" value from a User class. The tests include an example of a setup/tear down and check that the result of the "talk()" method is correct with an assertEquals.
2011-11-15 14:05:
Latest PECL Releases: APM 1.0.1 cld 0.5.0
Community News: Latest PECL Releases for 11.15.2011
Latest PECL Releases: APM 1.0.1 cld 0.5.0
2011-11-14 18:53:
In a recent post from Learncomputer.com, there's a comparison of two PHP profilers - the PHP Quick Profiler and the one included in Xdebug. Whether you are an experienced developer or just getting started it is important to know how to measure the performance of your scripts and applications so that you can learn to make improvements and optimizations to your code. [...] This article compares two of the most popular [profiling] solutions under free license that you can begin using today to profile your PHP applications. They describe each of the tools - the Quick PHP Profiler acting more like a plugin (running on each page load) and Xdebug working more behind the scenes and providing cachegrind files. These files can be viewed in cachegrind tools to drill in to the badly performing aspects of your applications and find the issues. If you need a free tool it can be difficult to find a PHP profiling tool that has all of the features you may want and the interface that you like all rolled into one. Identifying what kind of data you are looking for and what information you need from a profiling tool will allow you to choose the best solution for your needs.
Learncomputer.com: PHP Profilers Compared (PHP Quick Profiler & XDebug)
In a recent post from Learncomputer.com, there's a comparison of two PHP profilers - the PHP Quick Profiler and the one included in Xdebug. Whether you are an experienced developer or just getting started it is important to know how to measure the performance of your scripts and applications so that you can learn to make improvements and optimizations to your code. [...] This article compares two of the most popular [profiling] solutions under free license that you can begin using today to profile your PHP applications. They describe each of the tools - the Quick PHP Profiler acting more like a plugin (running on each page load) and Xdebug working more behind the scenes and providing cachegrind files. These files can be viewed in cachegrind tools to drill in to the badly performing aspects of your applications and find the issues. If you need a free tool it can be difficult to find a PHP profiling tool that has all of the features you may want and the interface that you like all rolled into one. Identifying what kind of data you are looking for and what information you need from a profiling tool will allow you to choose the best solution for your needs.
2011-11-14 17:12:
Robert Basic has a recent post showing you how to use the "cookie jar" functionality included with Apache's "ab" benchmarking tool to get behind your PHP-based login with a simple curl and grep combo. Tonight I decided to relax a bit and what better way of relaxing is there for a geek then to do some bash scripting?! So for fun and no profit I decided to try and benchmark pages with ab, Apache HTTP server benchmarking tool, which are behind a login. Turns out, it's pretty easy after reading some man pages. He includes an example of the format of the "cookie jar" and the shell script he used to grab the PHP session ID from it and inject it into the "ab" call. The script is on github.
Robert Basic's Blog: Benchmarking pages behind a login with ab
Robert Basic has a recent post showing you how to use the "cookie jar" functionality included with Apache's "ab" benchmarking tool to get behind your PHP-based login with a simple curl and grep combo. Tonight I decided to relax a bit and what better way of relaxing is there for a geek then to do some bash scripting?! So for fun and no profit I decided to try and benchmark pages with ab, Apache HTTP server benchmarking tool, which are behind a login. Turns out, it's pretty easy after reading some man pages. He includes an example of the format of the "cookie jar" and the shell script he used to grab the PHP session ID from it and inject it into the "ab" call. The script is on github.
2011-11-14 16:50:
In a new post to his blog Lukas Smith looks at a recently introduced service, Travis CI that helps make continuous integration simple (and without having to set up the software yourself). He talks about his experiences in getting his trial project up and working with their system. Continuous integration is one of these topics that had a slow start, but in recent years has really taken off. The slow start is likely to be attributed to the fact that it was perceived as hard to setup and maintain. But solutions around Jenkins and Sismo are making it easier and easier. But thanks to the new Travis CI service, its now essentially so easy that there is no excuse not to use CI for PHP projects, at least if you are hosting your OSS code on github.com. What makes this service so crazy cool is that you can run your tests against multiple PHP versions, multiples databases (heck even RabbitMQ) and against multiple versions of various libraries. Thanks to the "first class" PHP support they offer, setting up a PHP project is as simple as creating a ".travis.yml" file in your github-based project (including PHP versions to test against, dependency management and "before script" tasks to execute). If you're looking for a CI platform without a lot of the hassle involved in the usual setup, you'd do well to check out Travis CI. You can also see another example of a project setup in this post from Travis Swicegood.
Lukas Smith's Blog: Travis, CI for OSS
In a new post to his blog Lukas Smith looks at a recently introduced service, Travis CI that helps make continuous integration simple (and without having to set up the software yourself). He talks about his experiences in getting his trial project up and working with their system. Continuous integration is one of these topics that had a slow start, but in recent years has really taken off. The slow start is likely to be attributed to the fact that it was perceived as hard to setup and maintain. But solutions around Jenkins and Sismo are making it easier and easier. But thanks to the new Travis CI service, its now essentially so easy that there is no excuse not to use CI for PHP projects, at least if you are hosting your OSS code on github.com. What makes this service so crazy cool is that you can run your tests against multiple PHP versions, multiples databases (heck even RabbitMQ) and against multiple versions of various libraries. Thanks to the "first class" PHP support they offer, setting up a PHP project is as simple as creating a ".travis.yml" file in your github-based project (including PHP versions to test against, dependency management and "before script" tasks to execute). If you're looking for a CI platform without a lot of the hassle involved in the usual setup, you'd do well to check out Travis CI. You can also see another example of a project setup in this post from Travis Swicegood.
2011-11-14 15:38:
PHPMaster.com has posted its third part of its "Localizing PHP Applications 'The Right Way'" series. In this third part you'll learn more about locales and message domain switching. In Part 2 you gained more insight into using the gettext library by learning the most important functions of the extension. In this part you'll learn how to best use a fallback locale, switch between locales, and override the currently selected message domain. They show you how to set up the directory structure to handle a fallback locale, a choice to use when the system can't determine which to use. By using a default, you also avoid having the system translate from the default language to...the default language (like "English" to "English"). Included are also the code bits you'll need to switch between locales (just using a different domain) and using the dgettext function to specify a different domain than the selected one.
PHPMaster.com: Localizing PHP Applications "The Right Way", Part 3
PHPMaster.com has posted its third part of its "Localizing PHP Applications 'The Right Way'" series. In this third part you'll learn more about locales and message domain switching. In Part 2 you gained more insight into using the gettext library by learning the most important functions of the extension. In this part you'll learn how to best use a fallback locale, switch between locales, and override the currently selected message domain. They show you how to set up the directory structure to handle a fallback locale, a choice to use when the system can't determine which to use. By using a default, you also avoid having the system translate from the default language to...the default language (like "English" to "English"). Included are also the code bits you'll need to switch between locales (just using a different domain) and using the dgettext function to specify a different domain than the selected one.
2011-11-11 19:05:
On the php|architect site today Chris Tankersley has a new tutorial about geocoding, Finding Exactly Where You Are - a guide to integrating the Yahoo! Placefinder service into your application. Yahoo! PlaceFinder is a REST web service that will turn an address into the latitudinal and longitudinal coordinates in XML, JSON, or serialized PHP objects. It has a few other functions too, like finding the nearest airport, time zone, and even telephone area code. [...] PlaceFinder is a very simple REST service, so cURL is a quick and easy way to access it. There are no authentication tokens to deal with or logon procedures. Just send a GET request, and read the response. He links you to the service to get an API key and includes a simple class (PlaceFinderAPI) that builds the GET query for you and makes the request via curl. Also included is an example showing how to find a given location (coincidentally, his location choice is the hotel where the php|tek conferences are held).
php|architect: Finding Exactly Where You Are
On the php|architect site today Chris Tankersley has a new tutorial about geocoding, Finding Exactly Where You Are - a guide to integrating the Yahoo! Placefinder service into your application. Yahoo! PlaceFinder is a REST web service that will turn an address into the latitudinal and longitudinal coordinates in XML, JSON, or serialized PHP objects. It has a few other functions too, like finding the nearest airport, time zone, and even telephone area code. [...] PlaceFinder is a very simple REST service, so cURL is a quick and easy way to access it. There are no authentication tokens to deal with or logon procedures. Just send a GET request, and read the response. He links you to the service to get an API key and includes a simple class (PlaceFinderAPI) that builds the GET query for you and makes the request via curl. Also included is an example showing how to find a given location (coincidentally, his location choice is the hotel where the php|tek conferences are held).
2011-11-11 18:37:
New on PHPBuilder.com today is a tutorial introducing you to web services with the Zend Framework, a guide to creating a simple RESTful service with this popular PHP framework. Rather than attempt to build and maintain multiple versions of the Web application in order to accommodate the diverse array of challenges and advantages presented by each device type, developers are increasingly embracing a unified approach which allows them to manage a single server-side code base which communicates with multiple client-specific interfaces by way of a RESTful Web service. The Zend Framework's Zend_Rest component offers PHP developers with an incredibly straightforward approach to building RESTful Web services. He shows how to set up some internal RESTful routing (with the help of Zend_Rest_Route) and create a simple controller that responds to several of the major HTTP request types - POST, GET, PUT, etc. In his simple example, he shows how to update a basic TODO list with a POST and the JSON response that would follow.
PHPBuilder.com: Building RESTful Web Services with the Zend Framework
New on PHPBuilder.com today is a tutorial introducing you to web services with the Zend Framework, a guide to creating a simple RESTful service with this popular PHP framework. Rather than attempt to build and maintain multiple versions of the Web application in order to accommodate the diverse array of challenges and advantages presented by each device type, developers are increasingly embracing a unified approach which allows them to manage a single server-side code base which communicates with multiple client-specific interfaces by way of a RESTful Web service. The Zend Framework's Zend_Rest component offers PHP developers with an incredibly straightforward approach to building RESTful Web services. He shows how to set up some internal RESTful routing (with the help of Zend_Rest_Route) and create a simple controller that responds to several of the major HTTP request types - POST, GET, PUT, etc. In his simple example, he shows how to update a basic TODO list with a POST and the JSON response that would follow.
2011-11-11 17:36:
On the PHP.net site today they've announced the release of the latest Release Candidate in the PHP 5.4 series - PHP 5.4 RC1. The PHP development team is proud to announce the first release candidate of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. [...] This is the first release candidate. No new features will be included before the final version of PHP 5.4.0. The release candidate phase is intended as a period of bug fixing prior to the stable release. Major changes include class member access on instantiation, array to string conversion now throws a notice and bugs fixes/improvements to Core and other extensions. For a complete list, check out the NEWS file. Download this latest release
PHP.net: PHP 5.4 RC 1 Released
On the PHP.net site today they've announced the release of the latest Release Candidate in the PHP 5.4 series - PHP 5.4 RC1. The PHP development team is proud to announce the first release candidate of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. [...] This is the first release candidate. No new features will be included before the final version of PHP 5.4.0. The release candidate phase is intended as a period of bug fixing prior to the stable release. Major changes include class member access on instantiation, array to string conversion now throws a notice and bugs fixes/improvements to Core and other extensions. For a complete list, check out the NEWS file. Download this latest release
2011-11-11 16:04:
On PHPMaster.com today (disclaimer: PHPMaster is a SitePoint website) Timothy Boronczyk has posted a review of SitePoint's latest offering for PHP developers - Writing Cutting-Edge Code (by Lorna Mitchell, Davey Shafik and Matthew Turland). The book was written explicitly to help you becoming a better PHP programmer and is totally awesome. It not only covers advanced PHP coding topics such as object-oriented programming and design patterns, but also periphery topics that are just as important, such as security, performance profiling, and deployment. If you're ready to hang up your novice hat for good and become a professional-level PHP developer, this book is for you. He goes through and highlights some of the content in the book, chapters covering relational databases, web services, security topics, caching, automated testing, PEAR/PECL....just to name a few. Using the Slashdot scale of book ratings, where 1 is fit for lining cages and 10 is destined to be a class, I give PHP Master: Write Cutting-Edge Code a very solid 8.5. The content will grow with you and the book is not something you'll read in a weekend and then donate to the library because you have no need for it.
PHPMaster.com: PHP Master: Writing Cutting-Edge Code
On PHPMaster.com today (disclaimer: PHPMaster is a SitePoint website) Timothy Boronczyk has posted a review of SitePoint's latest offering for PHP developers - Writing Cutting-Edge Code (by Lorna Mitchell, Davey Shafik and Matthew Turland). The book was written explicitly to help you becoming a better PHP programmer and is totally awesome. It not only covers advanced PHP coding topics such as object-oriented programming and design patterns, but also periphery topics that are just as important, such as security, performance profiling, and deployment. If you're ready to hang up your novice hat for good and become a professional-level PHP developer, this book is for you. He goes through and highlights some of the content in the book, chapters covering relational databases, web services, security topics, caching, automated testing, PEAR/PECL....just to name a few. Using the Slashdot scale of book ratings, where 1 is fit for lining cages and 10 is destined to be a class, I give PHP Master: Write Cutting-Edge Code a very solid 8.5. The content will grow with you and the book is not something you'll read in a weekend and then donate to the library because you have no need for it.
2011-11-11 15:43:
As is mentioned by Matthew Weier O'Phinney (and expanded on by Robert Basic) beginning immediately, the Zend Framework 2 project will no longer require developers to sign a CLA before submitting their code. In #zf2 news, effective immediately, we no longer require a CLA for #zf2 contributions. Let the pull requests flow! Robert gives a bit more detail in his post, pointing out the official git repo, the issues list, section on the wiki and the mailing list/IRC meetings. There's also a blog to follow to get the latest updates for the project. If you'd like to find out more about this new version of the framework, check out this video from ZendCon by Matthew.
Community News: Zend Framework 2 Development - CLA Not Required!
As is mentioned by Matthew Weier O'Phinney (and expanded on by Robert Basic) beginning immediately, the Zend Framework 2 project will no longer require developers to sign a CLA before submitting their code. In #zf2 news, effective immediately, we no longer require a CLA for #zf2 contributions. Let the pull requests flow! Robert gives a bit more detail in his post, pointing out the official git repo, the issues list, section on the wiki and the mailing list/IRC meetings. There's also a blog to follow to get the latest updates for the project. If you'd like to find out more about this new version of the framework, check out this video from ZendCon by Matthew.
2011-11-11 14:04:
Popular posts from PHPDeveloper.org for the past week:Kevin Schroeder's Blog: fatal: The remote end hung up unexpectedly Anthony Ferrara's Blog: On PSR-0 Being Included In PHP's Core Slawek Lukasiewicz's Blog: PHP application diagnostics - Memtrack Ulf Wendel's Blog: Using MySQL stored procedures with PHP mysqli DZone.com: Using a virtual machine to play with multiple versions of PHP Volker Dusch's Blog: An introduction to PHPUnits @covers annotation php|architect: Geolocation: Easier Than It Looks Community News: EngineYard Hosts "Future of PHP" Live Panel - "PEAR & Pyrus" PHPMaster.com: Code Templates, AutoHotKey, and Ditto: Speeding Up Development PEAR Blog: PEAR Development on Github
Site News: Popular Posts for the Week of 11.11.2011
Popular posts from PHPDeveloper.org for the past week:Kevin Schroeder's Blog: fatal: The remote end hung up unexpectedly Anthony Ferrara's Blog: On PSR-0 Being Included In PHP's Core Slawek Lukasiewicz's Blog: PHP application diagnostics - Memtrack Ulf Wendel's Blog: Using MySQL stored procedures with PHP mysqli DZone.com: Using a virtual machine to play with multiple versions of PHP Volker Dusch's Blog: An introduction to PHPUnits @covers annotation php|architect: Geolocation: Easier Than It Looks Community News: EngineYard Hosts "Future of PHP" Live Panel - "PEAR & Pyrus" PHPMaster.com: Code Templates, AutoHotKey, and Ditto: Speeding Up Development PEAR Blog: PEAR Development on Github
2011-11-10 20:11:
In this new post to his blog Sameer Borate applies an interesting method of discovery of structure in unfamiliar code - generating code signatures. One method [Ward Cunningham] suggests is that of summarizing on a single line select punctuation characters from each source file. He calls this the file's "signature". This will help the developer gauge the complexity of the code base. He includes a few examples from files in WordPress - looking for the structure of curly braces and semicolons as delimiters for chunks of functionality. Included are a few lines of code to help you generate a signature from any file and an example of a result. It's an interesting idea, but I'm not sure how practical it is. It could be a helpful reference for how complicated the file is, though.
Sameer Borate's Blog: Source Code Signatures in PHP
In this new post to his blog Sameer Borate applies an interesting method of discovery of structure in unfamiliar code - generating code signatures. One method [Ward Cunningham] suggests is that of summarizing on a single line select punctuation characters from each source file. He calls this the file's "signature". This will help the developer gauge the complexity of the code base. He includes a few examples from files in WordPress - looking for the structure of curly braces and semicolons as delimiters for chunks of functionality. Included are a few lines of code to help you generate a signature from any file and an example of a result. It's an interesting idea, but I'm not sure how practical it is. It could be a helpful reference for how complicated the file is, though.
2011-11-10 19:54:
Following along the lines of this post from Ed Finkler about working with the Gimme Bar API, Chris Hartjes has chimed in with his own post about creating his sidebar based on the same source. Funkatron was kind enough to put together a blog post about building a Tumblelog with Gimme Bar and PHP so I told him I would write up what I did on my own blog. One of my intents was to use the Gimme Bar API to pull in a list of my latest Gimmies for the sidebar on this blog. Ed had posted a very simple example in Javascript (I cannot remember where it is) so I took it and ran with it to modify it to work with the blogging software used here. He includes the simple javascript, about 15 lines of it, that pulls the latest "gimmies" from his own feed and posting them as sidebar items (as you can see right next to the code snippet).It uses a combination of Ender.js, Reqwest, Underscore and regular javascript to get the job done.
Chris Hartjes' Blog: Building a Gimmebar Sidebar
Following along the lines of this post from Ed Finkler about working with the Gimme Bar API, Chris Hartjes has chimed in with his own post about creating his sidebar based on the same source. Funkatron was kind enough to put together a blog post about building a Tumblelog with Gimme Bar and PHP so I told him I would write up what I did on my own blog. One of my intents was to use the Gimme Bar API to pull in a list of my latest Gimmies for the sidebar on this blog. Ed had posted a very simple example in Javascript (I cannot remember where it is) so I took it and ran with it to modify it to work with the blogging software used here. He includes the simple javascript, about 15 lines of it, that pulls the latest "gimmies" from his own feed and posting them as sidebar items (as you can see right next to the code snippet).It uses a combination of Ender.js, Reqwest, Underscore and regular javascript to get the job done.
2011-11-10 18:50:
The phpDay conference organizers have officially announced the Call for Papers for this year's event (happening May 18th and 19th in Verona, Italy). Do you want to be our next php hero? Fill out the form with your profile and talk description. Remember that the phpDay CfP will end on Feb 28th 2012. As a no profit organization we don't have a big budget but we will refund speakers accommodation, meals and we'll give them from 200 € as refund for travel expenses. They're looking for all levels of talks for the event - beginner, intermediate and advanced in three different categories: Overview, Hands On and In Depth. The deadline is February 28th (2012), so be sure to submit your ideas (the more the better)!
Community News: phpDay 2012 Call for Papers Announced
The phpDay conference organizers have officially announced the Call for Papers for this year's event (happening May 18th and 19th in Verona, Italy). Do you want to be our next php hero? Fill out the form with your profile and talk description. Remember that the phpDay CfP will end on Feb 28th 2012. As a no profit organization we don't have a big budget but we will refund speakers accommodation, meals and we'll give them from 200 € as refund for travel expenses. They're looking for all levels of talks for the event - beginner, intermediate and advanced in three different categories: Overview, Hands On and In Depth. The deadline is February 28th (2012), so be sure to submit your ideas (the more the better)!
2011-11-10 17:01:
On the Ibuildings techPortal today, they've posted the latest in their DPC Radio series of podcasts - recordings from this year's Dutch PHP Conference. In this latest episode, they share Christopher Jones' talk "Developing and Deploying High Performance PHP Applications". This session starts with a brief but important overview about the growing Oracle technology eco-system. It shows what Oracle's direction means for PHP application development and deployment. The majority of the talk then highlights techniques on building high performance PHP applications with the very widely used Oracle Database. Technologies mentioned include connection pooling, monitoring, caching and suspending/resuming transactions for stateful web applications. You can listen to this latest episode either using the in-page player, by downloading the mp3 or subscribing to their feed. You can find his slides over on the Oracle Technology Network.
Ibuildings techPortal: DPC Radio: Developing and Deploying High Performance PHP Applications
On the Ibuildings techPortal today, they've posted the latest in their DPC Radio series of podcasts - recordings from this year's Dutch PHP Conference. In this latest episode, they share Christopher Jones' talk "Developing and Deploying High Performance PHP Applications". This session starts with a brief but important overview about the growing Oracle technology eco-system. It shows what Oracle's direction means for PHP application development and deployment. The majority of the talk then highlights techniques on building high performance PHP applications with the very widely used Oracle Database. Technologies mentioned include connection pooling, monitoring, caching and suspending/resuming transactions for stateful web applications. You can listen to this latest episode either using the in-page player, by downloading the mp3 or subscribing to their feed. You can find his slides over on the Oracle Technology Network.
2011-11-10 16:19:
On his blog today Kowser introduces you to Kohana, an easy to use, lightweight PHP HMVC framework that can help you get applications up and running quickly. In his tutorial he walks you through the creation of a simple application - a typical blog. Kohana is the framework I liked best among other PHP framework. Its an easy one also . To me it is organized, highly object oriented, having clear separation of model, view & controller. Autoloading of classes is nice feature here also. Here is the tutorial I prepared. [...] Probably you have downloaded the zip file from here. He walks you through the initial setup and configuration first then jumps right into the code with an "Article" controller, a view to match and a simple model to hook into a "kohana_blog" table (creation SQL provided). Using this setup, he shows how to get a list of the current articles and update current ones/add new ones via a basic form.
Kowser's Blog: Kohana Tutorial: For the beginners
On his blog today Kowser introduces you to Kohana, an easy to use, lightweight PHP HMVC framework that can help you get applications up and running quickly. In his tutorial he walks you through the creation of a simple application - a typical blog. Kohana is the framework I liked best among other PHP framework. Its an easy one also . To me it is organized, highly object oriented, having clear separation of model, view & controller. Autoloading of classes is nice feature here also. Here is the tutorial I prepared. [...] Probably you have downloaded the zip file from here. He walks you through the initial setup and configuration first then jumps right into the code with an "Article" controller, a view to match and a simple model to hook into a "kohana_blog" table (creation SQL provided). Using this setup, he shows how to get a list of the current articles and update current ones/add new ones via a basic form.
2011-11-10 15:41:
On PHPMaster.com today there's a new tutorial from Sneha Heda looking at error handling in PHP - the types of errors that can come up, how to throw your own and how to catch them appropriately. Errors are the most common event a developer faces when programming. [...] To help reduce the number of errors in your code, and to mitigate their effects, proper error handling is essential in your web application. This article is a crash course in PHP error handling. You'll learn about PHP's built-in error reporting levels, and how to handle errors with custom error handlers and exception handling. She starts with the different error reporting levels PHP offers, everything from the lightweight E_NOTICE out to E_ALL|E_STRICT. With this as a reference, she shows how to create a custom error handler (using set_error_handler). Also included is a look at exceptions and some of the more detailed information that comes with them - line numbers, messages, file the error was thrown from, etc.
PHPMaster.com: Error Handling in PHP
On PHPMaster.com today there's a new tutorial from Sneha Heda looking at error handling in PHP - the types of errors that can come up, how to throw your own and how to catch them appropriately. Errors are the most common event a developer faces when programming. [...] To help reduce the number of errors in your code, and to mitigate their effects, proper error handling is essential in your web application. This article is a crash course in PHP error handling. You'll learn about PHP's built-in error reporting levels, and how to handle errors with custom error handlers and exception handling. She starts with the different error reporting levels PHP offers, everything from the lightweight E_NOTICE out to E_ALL|E_STRICT. With this as a reference, she shows how to create a custom error handler (using set_error_handler). Also included is a look at exceptions and some of the more detailed information that comes with them - line numbers, messages, file the error was thrown from, etc.
2011-11-09 19:50:
In this new post to the Symfony Blog, Fabien Potencier shares some of his thoughts about the Symfony community and tosses out an idea of a way to "gameify" the process to let community members proudly show off their level of involvement. When I say "community", I'm not talking about just the Symfony community, but I'm talking about all the people that are part of a larger ecosystem that makes Symfony better. [...] The corner stone of such a system is a unique account where all information are gathered and aggregated. We already have such a system on symfony-project.org but it is quite limited as it is only used for authentication. Related to this goal, they've introduced SenseioLabs Connect, a site for tracking accounts "on steroids" and the Symfony Community Awards that lets you nominate individuals for awards like "Best Blogger", "Best Support in the Forum" and "Best Evangelist". Voting is open and will run until December 24th with the winners announced in January 2012.
Symfony Blog: Developing the Symfony Community
In this new post to the Symfony Blog, Fabien Potencier shares some of his thoughts about the Symfony community and tosses out an idea of a way to "gameify" the process to let community members proudly show off their level of involvement. When I say "community", I'm not talking about just the Symfony community, but I'm talking about all the people that are part of a larger ecosystem that makes Symfony better. [...] The corner stone of such a system is a unique account where all information are gathered and aggregated. We already have such a system on symfony-project.org but it is quite limited as it is only used for authentication. Related to this goal, they've introduced SenseioLabs Connect, a site for tracking accounts "on steroids" and the Symfony Community Awards that lets you nominate individuals for awards like "Best Blogger", "Best Support in the Forum" and "Best Evangelist". Voting is open and will run until December 24th with the winners announced in January 2012.
2011-11-09 18:37:
Chance Garcia has a recent post to his blog showing how he fixed an issue with his MAMP install involving development of a SSH wrapper he developed and some testing out of PHPStorm and PHPUnit. One thing I can say is that, even though I use a convenient app like MAMP PRO to set up my local development environment, I'm glad my sysadmin-fu is up to snuff enough to fly without the conveniences because after this ordeal, I feel like I might as well have made my MAMP stack from scratch with all the hoops I jumped tonight. He shares a few of the things he discovered along the way like: the location of MAMP's "pecl" command, an error caused by a bad pear.conf file, doing custom compiles of PHP and libssh as a fallback and getting the extension to work in the CLI PHP version too.
Chance Garcia's Blog: MAMP PRO, PECL, SSH2, and OSX CLI (AKA acronym madness)
Chance Garcia has a recent post to his blog showing how he fixed an issue with his MAMP install involving development of a SSH wrapper he developed and some testing out of PHPStorm and PHPUnit. One thing I can say is that, even though I use a convenient app like MAMP PRO to set up my local development environment, I'm glad my sysadmin-fu is up to snuff enough to fly without the conveniences because after this ordeal, I feel like I might as well have made my MAMP stack from scratch with all the hoops I jumped tonight. He shares a few of the things he discovered along the way like: the location of MAMP's "pecl" command, an error caused by a bad pear.conf file, doing custom compiles of PHP and libssh as a fallback and getting the extension to work in the CLI PHP version too.
2011-11-09 17:04:
On ZendCasts.com today there's a new screencast in their "Building a JSON endpoint with the Slim microframework" series - part two focusing on jQuery integration. (Part one is here) [This screencast is] part 2 in a series on building a JSON end-point. We're using simple RESTful verbage to grab a list of names from a session store. You'll need to have the base scripts created in part one to follow along effectively. He picks up right where the previous part ends, creating a new view that uses some simple javascript (jQuery) code to pull the "names" values from his simple JSON endpoint. Also included is an example of a form for adding a new name to the list. The full source for the example can be found over on github.
ZendCasts.com: Building a JSON End-Point With SLIM and jQuery: Part 2
On ZendCasts.com today there's a new screencast in their "Building a JSON endpoint with the Slim microframework" series - part two focusing on jQuery integration. (Part one is here) [This screencast is] part 2 in a series on building a JSON end-point. We're using simple RESTful verbage to grab a list of names from a session store. You'll need to have the base scripts created in part one to follow along effectively. He picks up right where the previous part ends, creating a new view that uses some simple javascript (jQuery) code to pull the "names" values from his simple JSON endpoint. Also included is an example of a form for adding a new name to the list. The full source for the example can be found over on github.
2011-11-09 16:20:
In a quick new post today Kevin Schroeder asks his readers for feedback on what programming rules you should always follow in your development practices. Earlier today, more for my own interest, I asked the question on Twitter "What programming rules should you ALWAYS follow, regardless of the scenario you're working in?" In other words, are there programming rules that you ALWAYS should follow. It doesn't matter if it's a script to copy a bunch of files for a one time migration or if you're building the next Facebook (DON'T try to build the next Facebook. You will fail miserably. Build something else). In other words, what was the purist of programming rules. Responses he received ranged from the simple to slightly more complex including: Always comment your code Test your code Use source control "Think. Think again. Then write code" Use a good debugger to help track down problems Make effective use of logging/output
Kevin Schroeder's Blog: What programming rules should you ALWAYS follow?
In a quick new post today Kevin Schroeder asks his readers for feedback on what programming rules you should always follow in your development practices. Earlier today, more for my own interest, I asked the question on Twitter "What programming rules should you ALWAYS follow, regardless of the scenario you're working in?" In other words, are there programming rules that you ALWAYS should follow. It doesn't matter if it's a script to copy a bunch of files for a one time migration or if you're building the next Facebook (DON'T try to build the next Facebook. You will fail miserably. Build something else). In other words, what was the purist of programming rules. Responses he received ranged from the simple to slightly more complex including: Always comment your code Test your code Use source control "Think. Think again. Then write code" Use a good debugger to help track down problems Make effective use of logging/output
2011-11-09 15:54:
Anthony Ferrara has a new post today on his blog with some things he think you can do to become a better overall developer (and not just in PHP). He shares six things from his own experience to help answer this question. One of the most frequent questions that I get asked is "How can I become a better developer?" I think that it's a very good question to ask that deserves a good response. But how can you respond to something like that? Becoming a better developer depends so heavily on past experience (where to grow), interests and rationale (why do you want to grow), that it's really hard to answer without a fair bit of discussion. This post reflects my experiences from both my own growth and the growth that I've seen in others. The things on his list are pretty simple, but they're easy to forget in your day to day development life. Things like being motivated to better yourself, gaining confidence in your abilities, sharing your knowledge and/or becoming a mentor to developers with less experience than you. Interestingly enough, this last one can sometimes teach you a little something about you and your processes too.
Anthony Ferrara's Blog: Becoming A Better Developer
Anthony Ferrara has a new post today on his blog with some things he think you can do to become a better overall developer (and not just in PHP). He shares six things from his own experience to help answer this question. One of the most frequent questions that I get asked is "How can I become a better developer?" I think that it's a very good question to ask that deserves a good response. But how can you respond to something like that? Becoming a better developer depends so heavily on past experience (where to grow), interests and rationale (why do you want to grow), that it's really hard to answer without a fair bit of discussion. This post reflects my experiences from both my own growth and the growth that I've seen in others. The things on his list are pretty simple, but they're easy to forget in your day to day development life. Things like being motivated to better yourself, gaining confidence in your abilities, sharing your knowledge and/or becoming a mentor to developers with less experience than you. Interestingly enough, this last one can sometimes teach you a little something about you and your processes too.
2011-11-08 19:08:
Slawek Lukasiewicz has posted about a handy tool that can be used to track memory consumption and performance in your PHP application - memtrack. Application profiling can help us determine bottlenecks and possible problems during development. But sometimes we also need to diagnose problems in production environment. Frequent performance problems are connected with functions and methods using too much memory. The tool allows you to set up thresholds for memory consumption and, if the scripts exceeds it, add warnings to your log files. He includes the simple instructions to install it (via PECL) and enable it in your php.ini. Some sample code to create a memory overvload is included to test it out. Configuration options let you set the limits and define functions to ignore if you know for sure there's trouble spots.
Slawek Lukasiewicz's Blog: PHP application diagnostics - Memtrack
Slawek Lukasiewicz has posted about a handy tool that can be used to track memory consumption and performance in your PHP application - memtrack. Application profiling can help us determine bottlenecks and possible problems during development. But sometimes we also need to diagnose problems in production environment. Frequent performance problems are connected with functions and methods using too much memory. The tool allows you to set up thresholds for memory consumption and, if the scripts exceeds it, add warnings to your log files. He includes the simple instructions to install it (via PECL) and enable it in your php.ini. Some sample code to create a memory overvload is included to test it out. Configuration options let you set the limits and define functions to ignore if you know for sure there's trouble spots.
2011-11-08 18:51:
Till Klampaeckel has a new post about replacing the now-missing phar port on FreeBSD installations with a custom compile work-around. I noticed that archivers/pecl-phar vanished from the ports tree on one of my FreeBSD servers. Problem? Reasons to remove the port were: the port is unmaintained, the port was based on the outdated phar extension from pec and that phar (in pecl) contains open security issues. The simple solution is to create a new port which of course will use the phar which is bundled in PHP's core. He includes the simple five or six step process you'll need to follow to compile your own phar extension for your installation - grabbing the latest source, compiling (configure/make) and putting the resulting shared object (.so) in the right place for PHP to find it. All that's left then is to enable it in the php.ini. Phar is an archive creation tool that (normally) comes bundled with versions of PHP and can be used to both read and write to compressed packages.
Till Klampaeckel's Blog: PHAR and FreeBSD
Till Klampaeckel has a new post about replacing the now-missing phar port on FreeBSD installations with a custom compile work-around. I noticed that archivers/pecl-phar vanished from the ports tree on one of my FreeBSD servers. Problem? Reasons to remove the port were: the port is unmaintained, the port was based on the outdated phar extension from pec and that phar (in pecl) contains open security issues. The simple solution is to create a new port which of course will use the phar which is bundled in PHP's core. He includes the simple five or six step process you'll need to follow to compile your own phar extension for your installation - grabbing the latest source, compiling (configure/make) and putting the resulting shared object (.so) in the right place for PHP to find it. All that's left then is to enable it in the php.ini. Phar is an archive creation tool that (normally) comes bundled with versions of PHP and can be used to both read and write to compressed packages.
2011-11-08 17:41:
Matthew Weier O'Phinney has posted a guide to modules in ZF2 - some helpful hints to get you started writing modules for the Zend Framework 2 to fit into the new architecture. During ZendCon this year, we released 2.0.0beta1 of Zend Framework. The key story in the release is the creation of a new MVC layer, and to sweeten the story, the addition of a modular application architecture. "Modular? What's that mean?" For ZF2, "modular" means that your application is built of one or more "modules". In a lexicon agreed upon during our IRC meetings, a module is a collection of code and other files that solves a specific atomic problem of the application or website. He starts with a definition of a module as a reusable, self-contained object that can contain the code for one functional piece of the application (like a "forum" module or "blog" module). He gets more technical with a code-level module example structure and example code for setting up a "blog" module with autoloading and a little ACL. He includes the code you'll need to tell the module manager about the module and a few helpful tips/tricks he's found along the way.
Matthew Weier O'Phinney's Blog: Getting started writing ZF2 modules
Matthew Weier O'Phinney has posted a guide to modules in ZF2 - some helpful hints to get you started writing modules for the Zend Framework 2 to fit into the new architecture. During ZendCon this year, we released 2.0.0beta1 of Zend Framework. The key story in the release is the creation of a new MVC layer, and to sweeten the story, the addition of a modular application architecture. "Modular? What's that mean?" For ZF2, "modular" means that your application is built of one or more "modules". In a lexicon agreed upon during our IRC meetings, a module is a collection of code and other files that solves a specific atomic problem of the application or website. He starts with a definition of a module as a reusable, self-contained object that can contain the code for one functional piece of the application (like a "forum" module or "blog" module). He gets more technical with a code-level module example structure and example code for setting up a "blog" module with autoloading and a little ACL. He includes the code you'll need to tell the module manager about the module and a few helpful tips/tricks he's found along the way.
2011-11-08 16:28:
In a new article today on PHPMaster.com Robert Mariotti takes a look at standards and how important they can be when developing applications (both in following them and defining them correctly). It's not specifically targeted at PHP developers, but it does give some good food for thought. As a long-time programmer, often with a staff of other programmers to watch over, I learned early in my career how important enforcing programming standards is in contributing to the overall success of a project. Not only do standards affect an individual's production of code, but they ensure that anyone else who may contribute code later can do so with a reasonable expectation of consistency. He defines the abstract concept of "coding standards" as rules or guidelines that should be followed based on the application. Sure, there's more global standards for things (PSR-0 anyone?) but your needs will always be different and more fine-grained than those can get. He recommends standardizing everything, possibly using one of the standards popular open source projects have already laid out as a base.
PHPMaster.com: The Importance of Standards
In a new article today on PHPMaster.com Robert Mariotti takes a look at standards and how important they can be when developing applications (both in following them and defining them correctly). It's not specifically targeted at PHP developers, but it does give some good food for thought. As a long-time programmer, often with a staff of other programmers to watch over, I learned early in my career how important enforcing programming standards is in contributing to the overall success of a project. Not only do standards affect an individual's production of code, but they ensure that anyone else who may contribute code later can do so with a reasonable expectation of consistency. He defines the abstract concept of "coding standards" as rules or guidelines that should be followed based on the application. Sure, there's more global standards for things (PSR-0 anyone?) but your needs will always be different and more fine-grained than those can get. He recommends standardizing everything, possibly using one of the standards popular open source projects have already laid out as a base.
2011-11-08 15:03:
On the php|architect site Jeremy Kendall has a new article looking at geolocation in PHP and how, despite some comments in the past about its difficulty, some more recent tools make it relatively simple. Have you ever wanted to add location-aware content to your web applications? Would you believe me if I told you it was dead easy, and you could be up and running in about 10 minutes? The first thing you want to do is use someone else's work. Geolocation is a solved problem; there's no need to roll your own. I went searching for free Geolocation APIs and found two I wanted to try: MaxMind's GeoLite API and Quova. He briefly introduces each data source - GeoLite as a downloadable database and Quova as an API. Sample code is included for using the data from both of these services to find a location based on an IP address. He does include one caveat though - be careful about accuracy, they usually only promise things to be within 25 miles of the spot you're actually looking for.
php|architect: Geolocation: Easier Than It Looks
On the php|architect site Jeremy Kendall has a new article looking at geolocation in PHP and how, despite some comments in the past about its difficulty, some more recent tools make it relatively simple. Have you ever wanted to add location-aware content to your web applications? Would you believe me if I told you it was dead easy, and you could be up and running in about 10 minutes? The first thing you want to do is use someone else's work. Geolocation is a solved problem; there's no need to roll your own. I went searching for free Geolocation APIs and found two I wanted to try: MaxMind's GeoLite API and Quova. He briefly introduces each data source - GeoLite as a downloadable database and Quova as an API. Sample code is included for using the data from both of these services to find a location based on an IP address. He does include one caveat though - be careful about accuracy, they usually only promise things to be within 25 miles of the spot you're actually looking for.
2011-11-08 14:05:
Latest PECL Releases: timezonedb 2011.14 mysqlnd_ms 1.1.2
Community News: Latest PECL Releases for 11.08.2011
Latest PECL Releases: timezonedb 2011.14 mysqlnd_ms 1.1.2
2011-11-07 20:09:
EngineYard, a company that recently merged with the PHP platform as a service provider Orchestra.io, has a new live panel podcast about the Future of PHP, specifically involving PEAR and Pyrus. If you are a PHP developer using PEAR and Pyrus, we invite you to join us this week as we explore the future of PEAR and Pyrus. We'll be discussing issues such as where PEAR/Pyrus will be going in the next few years, what obstacles may be on the horizon, and how they're going to get where they're going. The live panel, hosted by Elizabeth Naramore, will include experts from the two projects: David Coallier (President), Helgi Þormar Þorbjörnsson, Brett Bieber, and Till Klampäckel. There's still time to sign up to attend - the show happens on November 17th. To put your name in to be a part of the event, fill in the info here and you'll be sent more information about attending.
Community News: EngineYard Hosts "Future of PHP" Live Panel - "PEAR & Pyrus"
EngineYard, a company that recently merged with the PHP platform as a service provider Orchestra.io, has a new live panel podcast about the Future of PHP, specifically involving PEAR and Pyrus. If you are a PHP developer using PEAR and Pyrus, we invite you to join us this week as we explore the future of PEAR and Pyrus. We'll be discussing issues such as where PEAR/Pyrus will be going in the next few years, what obstacles may be on the horizon, and how they're going to get where they're going. The live panel, hosted by Elizabeth Naramore, will include experts from the two projects: David Coallier (President), Helgi Þormar Þorbjörnsson, Brett Bieber, and Till Klampäckel. There's still time to sign up to attend - the show happens on November 17th. To put your name in to be a part of the event, fill in the info here and you'll be sent more information about attending.
2011-11-07 19:36:
On the PEAR blog today it's been pointed out that
PEAR Blog: PEAR Development on Github
On the PEAR blog today it's been pointed out that
2011-11-07 18:13:
On PHPMaster.com today they share a list of helpful tools and tricks that you can apply not only to your PHP development, but programming in general. They highlight code templates, using hotkeys and Ditto. There are also other helpful pieces of software such as libraries, code snippets, and third party applications. In this article I'll show you how I use a feature built into NetBeans along with two other applications to increase my productivity when programming on Windows. These tips and techniques offer a different way of thinking about things which should be helpful to any developer, regardless of his skill level. They start with a look at the Code Templates available in NetBeans (other IDEs/editors have a similar feature) to provide an easier starting place for your code, a tool called AutoHotKey that lets you define custom hotkey shortcuts and Ditto, a clipboard manager that lets you manage your copy/pasting better than the single-shot functionality Windows normally has.
PHPMaster.com: Code Templates, AutoHotKey, and Ditto: Speeding Up Development
On PHPMaster.com today they share a list of helpful tools and tricks that you can apply not only to your PHP development, but programming in general. They highlight code templates, using hotkeys and Ditto. There are also other helpful pieces of software such as libraries, code snippets, and third party applications. In this article I'll show you how I use a feature built into NetBeans along with two other applications to increase my productivity when programming on Windows. These tips and techniques offer a different way of thinking about things which should be helpful to any developer, regardless of his skill level. They start with a look at the Code Templates available in NetBeans (other IDEs/editors have a similar feature) to provide an easier starting place for your code, a tool called AutoHotKey that lets you define custom hotkey shortcuts and Ditto, a clipboard manager that lets you manage your copy/pasting better than the single-shot functionality Windows normally has.
2011-11-07 17:47:
Ed Finkler has a new post today showing how he's created a tumbleblog using the Gimmie Bar API and backend as a source for the posts. For the curious, the code for his simple blog can be found here. One of the coolest things about working on Gimme Bar has been the opportunity to build a platform. While most folks interact with our service via the web site, the site is just one application built on top of the Gimme Bar content collection and curation system. Our web site interacts with the system via our HTTP API, which is open to everyone, not just our internal team. That means that anyone can build applications on top of our platform to suit their own needs or interests. This simple blog (demo here grabs items from his Gimmie Bar feed and posts them. He includes complete installation instructions and a brief overview of how the parts work together.
Ed Finkler's Blog: Building a Tumblelog with Gimme Bar and PHP
Ed Finkler has a new post today showing how he's created a tumbleblog using the Gimmie Bar API and backend as a source for the posts. For the curious, the code for his simple blog can be found here. One of the coolest things about working on Gimme Bar has been the opportunity to build a platform. While most folks interact with our service via the web site, the site is just one application built on top of the Gimme Bar content collection and curation system. Our web site interacts with the system via our HTTP API, which is open to everyone, not just our internal team. That means that anyone can build applications on top of our platform to suit their own needs or interests. This simple blog (demo here grabs items from his Gimmie Bar feed and posts them. He includes complete installation instructions and a brief overview of how the parts work together.
2011-11-07 16:14:
Derick Rethans has a new post today looking at a method for setting up multiple PHP versions on the same machine and switch between them with a little help from some simple bash scripts. For many of my projects (both hobby and commercial) I need to support many different PHP configurations. Not only just different PHP versions, but also debug builds, ZTS builds and 32-bit builds. In order to be able to test and build extensions against all those different PHP configurations I have adopted a simple method that I'm sharing with you here. Using this script he can tell his system to pull the latest version of any release from SVN and try to compile it. The trick is putting each of them into a different directory under /usr/local. He uses another small shell function (with a function called "pe()") that sets up the pathing to the right release, complete with its own locations for PEAR/PECL and a php.ini.
Derick Rethans' Blog: Multiple PHP versions set-up
Derick Rethans has a new post today looking at a method for setting up multiple PHP versions on the same machine and switch between them with a little help from some simple bash scripts. For many of my projects (both hobby and commercial) I need to support many different PHP configurations. Not only just different PHP versions, but also debug builds, ZTS builds and 32-bit builds. In order to be able to test and build extensions against all those different PHP configurations I have adopted a simple method that I'm sharing with you here. Using this script he can tell his system to pull the latest version of any release from SVN and try to compile it. The trick is putting each of them into a different directory under /usr/local. He uses another small shell function (with a function called "pe()") that sets up the pathing to the right release, complete with its own locations for PEAR/PECL and a php.ini.
2011-11-07 15:54:
In this new post to his blog Davey Shafik looks at an alternative to the traditional arrays most scripts use - something a little faster and more specific: SplFixedArray, part of the Standard PHP Library included with every release. The SplFixedArray class provides a super-fast, fixed size array implementation. There are some limitations however, first you must use numeric keys and secondly you cannot use anonymous assignment (i.e. $array[] = 'value';). You'll notice one requirement was missing, that it should have a fixed size. While having a fixed size is what will bring you the speed increase it's actually not a requirement that the size be fixed. Because of these restrictions, the SplFixedArray is faster than its cousin - between 20 and 40 percent faster, depending on the size of the array. He includes a few snippets in the the post - one showing how he benchmarked the differences against simple arrays and another showing a more advanced example with another SPL type, a FilterIterator.
Davey Shafik's Blog: Faster Arrays
In this new post to his blog Davey Shafik looks at an alternative to the traditional arrays most scripts use - something a little faster and more specific: SplFixedArray, part of the Standard PHP Library included with every release. The SplFixedArray class provides a super-fast, fixed size array implementation. There are some limitations however, first you must use numeric keys and secondly you cannot use anonymous assignment (i.e. $array[] = 'value';). You'll notice one requirement was missing, that it should have a fixed size. While having a fixed size is what will bring you the speed increase it's actually not a requirement that the size be fixed. Because of these restrictions, the SplFixedArray is faster than its cousin - between 20 and 40 percent faster, depending on the size of the array. He includes a few snippets in the the post - one showing how he benchmarked the differences against simple arrays and another showing a more advanced example with another SPL type, a FilterIterator.
2011-11-07 14:06:
Latest PEAR Releases: Services_ProjectHoneyPot 0.6.0 PHP_CodeSniffer 1.3.1
Community News: Latest PEAR Releases for 11.07.2011
Latest PEAR Releases: Services_ProjectHoneyPot 0.6.0 PHP_CodeSniffer 1.3.1
2011-11-04 18:55:
Kevin Schroeder has a quick tip for anyone using phpcloud.com and having trouble with git and "remote end hung up" error messages. If you are using phpcloud.com and are experiencing errors with git [...] and you are trying to push large files (not sure what is defined as "large") you may need to change some git settings. He points out two settings - one for Windows and the other for Linux - that increase the buffer size to handle larger files that might be included in your repository.
Kevin Schroeder's Blog: fatal: The remote end hung up unexpectedly
Kevin Schroeder has a quick tip for anyone using phpcloud.com and having trouble with git and "remote end hung up" error messages. If you are using phpcloud.com and are experiencing errors with git [...] and you are trying to push large files (not sure what is defined as "large") you may need to change some git settings. He points out two settings - one for Windows and the other for Linux - that increase the buffer size to handle larger files that might be included in your repository.
2011-11-04 17:39:
Ulf Wendel has a new post today with details on using stored procedures with mysqli - not overly difficult if you know how to handle the IN, OUT and INOUT parameters. He includes a few code examples showing how to use them. Out of curiosity I asked another friend, a team lead, how things where going with their PHP MySQL project, for which they had planned to have most of their business logic in stored procedures. I got an email in reply stating something along the lines: "Our developers found that mysqli does not support stored procedures correctly. We use PDO.". Well, the existing documentation from PHP 5.0 times is not stellar, I confess. But still, that's a bit too much... it ain't that difficult. And, it works. He describes the three parameters (IN, OUT and INOUT) and gives some examples of setting/getting them from your SQL statements. They're all still set up using the query method on your connection as well as handling the result sets that come back and working with prepared statements.
Ulf Wendel's Blog: Using MySQL stored procedures with PHP mysqli
Ulf Wendel has a new post today with details on using stored procedures with mysqli - not overly difficult if you know how to handle the IN, OUT and INOUT parameters. He includes a few code examples showing how to use them. Out of curiosity I asked another friend, a team lead, how things where going with their PHP MySQL project, for which they had planned to have most of their business logic in stored procedures. I got an email in reply stating something along the lines: "Our developers found that mysqli does not support stored procedures correctly. We use PDO.". Well, the existing documentation from PHP 5.0 times is not stellar, I confess. But still, that's a bit too much... it ain't that difficult. And, it works. He describes the three parameters (IN, OUT and INOUT) and gives some examples of setting/getting them from your SQL statements. They're all still set up using the query method on your connection as well as handling the result sets that come back and working with prepared statements.
2011-11-04 16:15:
On DZone.com Giorgio Sironi has a new post talking about a development practice that's becoming more and more popular (rather than the old standby of one development platform for all developers) - using virtual machines as reusable, easily renewable platforms. He talks about the process he went through to set up PHP, including the commands used during the process. This is an occasion to learn about a virtualization tool which I'm not familiar with, VirtualBox. The goal is to install PHP 5.4, which is not yet a stable release, to play around with new features such as traits without ruining the setup on my primary machine (which runs the super-stable PHP 5.3). Although it may be possible to run them together (I'm not a sysadmin), it's really simpler to install one of them in a virtual machine that can be thrown away if something goes wrong. Using VirtualBox he describes the process of getting a Ubuntu system up and running including a custom compile of PHP with things like curl, bz2, mbstring and openssl support. With that installed and the Apache packages all set up, it should just be a matter of hitting your localhost's web server. If you're looking for older (or just other) versions of PHP to compile, check out the Historical Releases page on the PHP.net site.
DZone.com: Using a virtual machine to play with multiple versions of PHP
On DZone.com Giorgio Sironi has a new post talking about a development practice that's becoming more and more popular (rather than the old standby of one development platform for all developers) - using virtual machines as reusable, easily renewable platforms. He talks about the process he went through to set up PHP, including the commands used during the process. This is an occasion to learn about a virtualization tool which I'm not familiar with, VirtualBox. The goal is to install PHP 5.4, which is not yet a stable release, to play around with new features such as traits without ruining the setup on my primary machine (which runs the super-stable PHP 5.3). Although it may be possible to run them together (I'm not a sysadmin), it's really simpler to install one of them in a virtual machine that can be thrown away if something goes wrong. Using VirtualBox he describes the process of getting a Ubuntu system up and running including a custom compile of PHP with things like curl, bz2, mbstring and openssl support. With that installed and the Apache packages all set up, it should just be a matter of hitting your localhost's web server. If you're looking for older (or just other) versions of PHP to compile, check out the Historical Releases page on the PHP.net site.
2011-11-04 15:55:
PHPUnit is one of the most widely used unit testing tools for PHP applications. It comes packed with features, some that are commonly used and some not so much. In a new post to his blog today Volker Dusch looks at one specific feature - the "@covers" annotation you can use in your tests' comments to specify which functionality you're actually testing. One of the goals of your test suite and the coverage report is to make you trust in your code base and to remove the fear of changing something that needs to be changed. [...] You shouldn't think "Well yes that a 100% but a lot of that just comes from that big integration test and I don't know if the class is really tested!". [...] Thankfully PHPUnit offers a way to drastically increase your confidence in what you actually have tested. Using the "@covers" annotation on your test method docblocks gives you one more level of confidence in what's being tested and can help make for clearer updating down the road. He also mentions using them to provide extra insight into protected methods in your code and where the test coverage for them really lies.
Volker Dusch's Blog: An introduction to PHPUnits @covers annotation
PHPUnit is one of the most widely used unit testing tools for PHP applications. It comes packed with features, some that are commonly used and some not so much. In a new post to his blog today Volker Dusch looks at one specific feature - the "@covers" annotation you can use in your tests' comments to specify which functionality you're actually testing. One of the goals of your test suite and the coverage report is to make you trust in your code base and to remove the fear of changing something that needs to be changed. [...] You shouldn't think "Well yes that a 100% but a lot of that just comes from that big integration test and I don't know if the class is really tested!". [...] Thankfully PHPUnit offers a way to drastically increase your confidence in what you actually have tested. Using the "@covers" annotation on your test method docblocks gives you one more level of confidence in what's being tested and can help make for clearer updating down the road. He also mentions using them to provide extra insight into protected methods in your code and where the test coverage for them really lies.
2011-11-04 14:34:
In a new post to his blog today Anthony Ferrara looks at the (heated) discussion that's popped up around having the PSR-0 autoloader standard included as a part of the PHP core. He gives his reasons (three of them) why he's not for the decision. Recently there has been a rather heated and intense discussion on whether the PSR-0 autoloader "standard" should be included as part of the PHP core (in ext/spl to be exact). I've tried to stay out of the discussion and have successfully done so. Until today. I feel that there's something that's been missing to the discussion. So rather then posting this to the internals list, I feel it's better served by a blog post on the subject. So here's my take on it. As mentioned, he's not in favor of the inclusion for three different reasons: It's inconsistent with current PHP functionality and would bias development one way or another It's not an actual standard, just a loosely defined practice based on functionality already in place There's noting for core to gain by adopting it and could cause problems trying to make things fit a one-size-fits-all solution.
Anthony Ferrara's Blog: On PSR-0 Being Included In PHP's Core
In a new post to his blog today Anthony Ferrara looks at the (heated) discussion that's popped up around having the PSR-0 autoloader standard included as a part of the PHP core. He gives his reasons (three of them) why he's not for the decision. Recently there has been a rather heated and intense discussion on whether the PSR-0 autoloader "standard" should be included as part of the PHP core (in ext/spl to be exact). I've tried to stay out of the discussion and have successfully done so. Until today. I feel that there's something that's been missing to the discussion. So rather then posting this to the internals list, I feel it's better served by a blog post on the subject. So here's my take on it. As mentioned, he's not in favor of the inclusion for three different reasons: It's inconsistent with current PHP functionality and would bias development one way or another It's not an actual standard, just a loosely defined practice based on functionality already in place There's noting for core to gain by adopting it and could cause problems trying to make things fit a one-size-fits-all solution.
2011-11-04 13:03:
Popular posts from PHPDeveloper.org for the past week:Johannes Schmitt's Blog: A New Killer Feature for Symfony2 Security XpertDeveloper.com: Abstract in PHP Community News: ZendCon 2011 Wrap-ups (from a Speaker & Zend) DZone.com: Closure Object Binding in PHP 5.4 Developer Drive: Create Your Own CRUD App with MySQL and PHP PHPBuilder.com: An Early Look at Zend Framework 2.0 ArsMagnaTutorials: FuelPHP Tutorial Videos Ibuildings techPortal: Architecture Patterns: Domain Model and Friends Dave Marshall's Blog: Phpmig - Simple migrations for php Ibuildings techPortal: PHPNW11 Conference Report - Part II
Site News: Popular Posts for the Week of 11.04.2011
Popular posts from PHPDeveloper.org for the past week:Johannes Schmitt's Blog: A New Killer Feature for Symfony2 Security XpertDeveloper.com: Abstract in PHP Community News: ZendCon 2011 Wrap-ups (from a Speaker & Zend) DZone.com: Closure Object Binding in PHP 5.4 Developer Drive: Create Your Own CRUD App with MySQL and PHP PHPBuilder.com: An Early Look at Zend Framework 2.0 ArsMagnaTutorials: FuelPHP Tutorial Videos Ibuildings techPortal: Architecture Patterns: Domain Model and Friends Dave Marshall's Blog: Phpmig - Simple migrations for php Ibuildings techPortal: PHPNW11 Conference Report - Part II
2011-11-03 17:04:
On Reddit.com there's a recent post that asks the question How do YOU sanitize input in your PHP applications? I am developing some software for my high school using HTML, CSS, MySQL, and most importantly PHP. [...] So I pose this question, what is YOUR favorite way to sanitize input for inserting, updating, or selecting from a database? Also, is there any way you prefer to verify that input is of a certain type, and only of that type ie, if you're expecting an int or a string, how would you make sure you are receiving one? Answers on the post touch on things like: parametrised queries for databases filter_var/filter_types Sanitized versus "database-safe" using PDO avoiding the false sense of security things like mysql_escape_string and mysql_real_escape_string
Reddit.com: How do YOU sanitize input?
On Reddit.com there's a recent post that asks the question How do YOU sanitize input in your PHP applications? I am developing some software for my high school using HTML, CSS, MySQL, and most importantly PHP. [...] So I pose this question, what is YOUR favorite way to sanitize input for inserting, updating, or selecting from a database? Also, is there any way you prefer to verify that input is of a certain type, and only of that type ie, if you're expecting an int or a string, how would you make sure you are receiving one? Answers on the post touch on things like: parametrised queries for databases filter_var/filter_types Sanitized versus "database-safe" using PDO avoiding the false sense of security things like mysql_escape_string and mysql_real_escape_string
2011-11-03 16:48:
The Seattle PHP User Group is having this month's meeting tonight (the 3rd) starting at 6:30pm at Market Leader, Inc featuring talka from Brian Swan on "PHP on Azure" and Jesse Keating on "Git". Market Leader,Inc. is graciously hosting the venue for Seattle PHP Meetup in Kirkland, WA this month!! In fact, Ariz Jacinto (long-time member & frequent presenter at our Meetups), an employee of Market Leader, Inc., has gone bonkers and lined up a killer night for us all! Note the entrance and then celebrate the FREE PARKING!! Brian Swan is a Microsoft advocate for PHP on Windows and Jesse Keating is the release engineer for Fedora Core. There's still time to RSVP on Meetup and attend this event - be sure to sign up so they know how many to expect!
User Group: Seattle User Group Meeting Tonight (3rd) - PHP on Azure & Git
The Seattle PHP User Group is having this month's meeting tonight (the 3rd) starting at 6:30pm at Market Leader, Inc featuring talka from Brian Swan on "PHP on Azure" and Jesse Keating on "Git". Market Leader,Inc. is graciously hosting the venue for Seattle PHP Meetup in Kirkland, WA this month!! In fact, Ariz Jacinto (long-time member & frequent presenter at our Meetups), an employee of Market Leader, Inc., has gone bonkers and lined up a killer night for us all! Note the entrance and then celebrate the FREE PARKING!! Brian Swan is a Microsoft advocate for PHP on Windows and Jesse Keating is the release engineer for Fedora Core. There's still time to RSVP on Meetup and attend this event - be sure to sign up so they know how many to expect!
2011-11-03 15:13:
Henrik Bjørnskov has a new post with a technique you can use to combine Symfony2 and Doctrine2 to create a multi-step form (a wizard) without having to worry about lost user information between steps. The easy ways is doing it with Javascript and just show/hide the correct fieldsets when needed. The downside with this approach is that the data is only saved and validated once at the end. So if the user reloads the page the entered information is gone. The other way is to have every Step in the Wizard being a seperate form and validate the data based on what step you are on and save the necessary fields. For his method, he created a Manager class with a StepInterface that returns the correct field names, forms and template information to render. The interface code is included in the post as well as an example of it in use setting up the wizard object, making a report and getting the correct step information from the wizard.
Henrik Bjørnskov's Blog: Symfony2: How to do a Wizard (multistep form) with Doctrine2
Henrik Bjørnskov has a new post with a technique you can use to combine Symfony2 and Doctrine2 to create a multi-step form (a wizard) without having to worry about lost user information between steps. The easy ways is doing it with Javascript and just show/hide the correct fieldsets when needed. The downside with this approach is that the data is only saved and validated once at the end. So if the user reloads the page the entered information is gone. The other way is to have every Step in the Wizard being a seperate form and validate the data based on what step you are on and save the necessary fields. For his method, he created a Manager class with a StepInterface that returns the correct field names, forms and template information to render. The interface code is included in the post as well as an example of it in use setting up the wizard object, making a report and getting the correct step information from the wizard.
2011-11-03 14:50:
On NetTuts.com today there's a new tutorial helping you get started with Zend Framework "from scratch". They outline the full process - from download to the creation of a first application. Ready to take your PHP skills to the next level? In this new "From Scratch" series, we'll focus exclusively on Zend Framework, a full-stack PHP framework created by Zend Technologies. First in our tutorial series, is "Getting Started with Zend Framework." The tutorial (executed in a Windows environment) is broken up into seven parts: Download Zend Framework Set up your Zend Framework Environment Create your First Zend Framework Project Learn about Zend Framework's MVC Structure Pass Data From a Controller to its View Create a Layout in Zend Framework Create New Controllers and Actions They use the Windows version of Apache to host the site (installation instructions not included). If you'd like to get the source for this tutorial series as it evolves, you can find it on github.
NetTuts.com: Zend Framework from Scratch
On NetTuts.com today there's a new tutorial helping you get started with Zend Framework "from scratch". They outline the full process - from download to the creation of a first application. Ready to take your PHP skills to the next level? In this new "From Scratch" series, we'll focus exclusively on Zend Framework, a full-stack PHP framework created by Zend Technologies. First in our tutorial series, is "Getting Started with Zend Framework." The tutorial (executed in a Windows environment) is broken up into seven parts: Download Zend Framework Set up your Zend Framework Environment Create your First Zend Framework Project Learn about Zend Framework's MVC Structure Pass Data From a Controller to its View Create a Layout in Zend Framework Create New Controllers and Actions They use the Windows version of Apache to host the site (installation instructions not included). If you'd like to get the source for this tutorial series as it evolves, you can find it on github.
2011-11-02 22:28:
Henri Bergius has a new post to his blog today about a tool that could help make code reuse across PHP applications a much simpler process. The Composer tool (and Packagist) make setting up packages and dependencies easy. In PHP we've had a lousy culture of code-sharing. Because depending on code from others as been tricky, every major PHP application or framework has practically had to reimplement the whole world. Only some tools, like PHPUnit, have managed to break over this barrier and become de-facto standards across project boundaries. But for the rest: just write it yourself. But now Composer, and its repository counterpart Packagist, promise to change all that. And obviously new conventions like PHP's namespacing support and the PSR-0 standard autoloader help. Making a package is as simple as setting up a JSON-based configuration file that names dependencies and package metadata (like name, type, etc). Composer generates an autoloader of its own to handle the loading of your needs based on the dependencies listed as a part of the package. If you'd like more information about Composer or to get the latest version and try it yourself, check out the project's github repository.
Henri Bergius' Blog: Composer Solves The PHP Code-Sharing Problem
Henri Bergius has a new post to his blog today about a tool that could help make code reuse across PHP applications a much simpler process. The Composer tool (and Packagist) make setting up packages and dependencies easy. In PHP we've had a lousy culture of code-sharing. Because depending on code from others as been tricky, every major PHP application or framework has practically had to reimplement the whole world. Only some tools, like PHPUnit, have managed to break over this barrier and become de-facto standards across project boundaries. But for the rest: just write it yourself. But now Composer, and its repository counterpart Packagist, promise to change all that. And obviously new conventions like PHP's namespacing support and the PSR-0 standard autoloader help. Making a package is as simple as setting up a JSON-based configuration file that names dependencies and package metadata (like name, type, etc). Composer generates an autoloader of its own to handle the loading of your needs based on the dependencies listed as a part of the package. If you'd like more information about Composer or to get the latest version and try it yourself, check out the project's github repository.
2011-11-02 21:05:
PHPMaster.com has posted the second part of their series about localizing PHP applications "the right way" (hint: it uses gettext). Welcome back to this series of articles which teach you how to localize your PHP applications using gettext and its PHP extension. In Part 1 you took your first steps towards towards this by installing gettext and Poedit, creating a translation file, and writing a Hello World script. In this part you'll lean about each of the function used in the script, and dive more into the gettext library and its usage. The explain some of the naming conventions gettext uses for things (like "domains" and "codeset") as well as the shorthand "_()" you can use to retrieve translated values. There's also a look at supporting multiple locales via multiple directories of .po and .mo files.
PHPMaster.com: Localizing PHP Applications "The Right Way", Part 2
PHPMaster.com has posted the second part of their series about localizing PHP applications "the right way" (hint: it uses gettext). Welcome back to this series of articles which teach you how to localize your PHP applications using gettext and its PHP extension. In Part 1 you took your first steps towards towards this by installing gettext and Poedit, creating a translation file, and writing a Hello World script. In this part you'll lean about each of the function used in the script, and dive more into the gettext library and its usage. The explain some of the naming conventions gettext uses for things (like "domains" and "codeset") as well as the shorthand "_()" you can use to retrieve translated values. There's also a look at supporting multiple locales via multiple directories of .po and .mo files.
2011-11-02 20:55:
In a new post to his blog today Kevin Schroeder answers a question about a product his employer, Zend currently offers - what is phpcloud.com? Well that's a stupid question, isn't it? It's "Development done right", "Fast, Elastic, Dependable" and on "Any Cloud", right? If you are unclear as to what phpcloud.com is, what the Zend Application Fabric is and what the DevCloud is then this is a good post for you. The phpcloud platform offers their own Zend Application fabric to provide resources based on the needs at the time and the DevCloud, a "slice" of these resources for you to try out for your development. So, the Fabric is the loom, DevCloud is a thread spool and phpcloud.com is the lever you pull to start.
Kevin Schroeder's Blog: What is phpcloud.com?
In a new post to his blog today Kevin Schroeder answers a question about a product his employer, Zend currently offers - what is phpcloud.com? Well that's a stupid question, isn't it? It's "Development done right", "Fast, Elastic, Dependable" and on "Any Cloud", right? If you are unclear as to what phpcloud.com is, what the Zend Application Fabric is and what the DevCloud is then this is a good post for you. The phpcloud platform offers their own Zend Application fabric to provide resources based on the needs at the time and the DevCloud, a "slice" of these resources for you to try out for your development. So, the Fabric is the loom, DevCloud is a thread spool and phpcloud.com is the lever you pull to start.
2011-11-02 19:02:
Wojciech Sznapka has a new post today sharing his opinions as to why Mockery is better than PHPUnit Mock Builder in testing Symfony2-based applications. Recently I did a lot of Test Driven Development on my Symfony2 bundle. I used PHPUnit's built-in mocks and stubs for many projects, so I took it again. But while I was working on mocking Symfony2 core objects I found those mocks very uncomfortable in use. I tried Mockery and it saved my day. Let's see how to get it working with Symfony2 and how it kicks ass! He shows how to get things set up - adding Mockery to the dependencies file (deps), getting the latest version from their git repository and an example mock method that shows the difference in mocking the Doctrine2 entity manager - PHPUnit vs Mockery.
Wojciech Sznapka's Blog: Why Mockery is better than PHPUnit Mock Builder (with Symfony2)
Wojciech Sznapka has a new post today sharing his opinions as to why Mockery is better than PHPUnit Mock Builder in testing Symfony2-based applications. Recently I did a lot of Test Driven Development on my Symfony2 bundle. I used PHPUnit's built-in mocks and stubs for many projects, so I took it again. But while I was working on mocking Symfony2 core objects I found those mocks very uncomfortable in use. I tried Mockery and it saved my day. Let's see how to get it working with Symfony2 and how it kicks ass! He shows how to get things set up - adding Mockery to the dependencies file (deps), getting the latest version from their git repository and an example mock method that shows the difference in mocking the Doctrine2 entity manager - PHPUnit vs Mockery.
2011-11-01 19:19:
In a new post to his blog Dave Marshall shares a homegrown migration tool he's created to help make database migrations a simpler task - phpmig. I've previously blogged about migrations with phing and dbdeploy and also porting ActiveRecord::Migrations to PHP, now here I am again blogging about yet another way of doing migrations in PHP projects. Only maybe this time it's different, maybe this time I've found a way I'm happy with...? Phpmig is a simple migrations system that was written to be easily adopted regardless of the framework or libraries you are using. It requires a little bit of setting up, but if you know you should be using migrations, you're probably more than capable. He's worked up a sample application to show you how to get things set up and working - a basic Silex-based application. Phpmig is used to create a basic bootstrap for the deployment that includes the use of Pimple for dependency injection and a command-line interface to generate a migration skeleton class for the up/down methods. The source for phpmig can be found on github.
Dave Marshall's Blog: Phpmig - Simple migrations for php
In a new post to his blog Dave Marshall shares a homegrown migration tool he's created to help make database migrations a simpler task - phpmig. I've previously blogged about migrations with phing and dbdeploy and also porting ActiveRecord::Migrations to PHP, now here I am again blogging about yet another way of doing migrations in PHP projects. Only maybe this time it's different, maybe this time I've found a way I'm happy with...? Phpmig is a simple migrations system that was written to be easily adopted regardless of the framework or libraries you are using. It requires a little bit of setting up, but if you know you should be using migrations, you're probably more than capable. He's worked up a sample application to show you how to get things set up and working - a basic Silex-based application. Phpmig is used to create a basic bootstrap for the deployment that includes the use of Pimple for dependency injection and a command-line interface to generate a migration skeleton class for the up/down methods. The source for phpmig can be found on github.
2011-11-01 18:58:
Anthony Ferrara has a new post to his blog sharing some inconsistencies with iterators that he discovered as discussed with a fellow developer - why some iterators only accept Iterator arguments and others don't. We were talking about why some of the SPL Iterators accept only an Iterator as the constructor argument (Such as LimitIterator), and others accept either an Iterator or an IteratorAggregate as the argument (Such as IteratorIterator). Feeling that this would be a useful feature to add (having all of them accept an IteratorAggregate), I opened up the PHP source and started looking at how hard of a change this would be. What I found was... Interesting... He shares some of the C code he came across in his investigation including a "WTF" moment when he found a case statement for DIT_IteratorIterator in a constructor. Because of some of the logic in this constructor, the inputted iterator is "cast down" to a class. This is shown in a few code examples comparing simple iteration objects and arrays and how it seems to be able to bypass class inheritance to use methods from other classes.
Anthony Ferrara's Blog: IteratorIterator - PHP Inconsistencies And WTFs
Anthony Ferrara has a new post to his blog sharing some inconsistencies with iterators that he discovered as discussed with a fellow developer - why some iterators only accept Iterator arguments and others don't. We were talking about why some of the SPL Iterators accept only an Iterator as the constructor argument (Such as LimitIterator), and others accept either an Iterator or an IteratorAggregate as the argument (Such as IteratorIterator). Feeling that this would be a useful feature to add (having all of them accept an IteratorAggregate), I opened up the PHP source and started looking at how hard of a change this would be. What I found was... Interesting... He shares some of the C code he came across in his investigation including a "WTF" moment when he found a case statement for DIT_IteratorIterator in a constructor. Because of some of the logic in this constructor, the inputted iterator is "cast down" to a class. This is shown in a few code examples comparing simple iteration objects and arrays and how it seems to be able to bypass class inheritance to use methods from other classes.
2011-11-01 17:40:
On PHPBuilder.com Jason Gilmore has posted a first peek at Zend Framework 2, an upcoming reworking of the popular framework with PHP 5.3-centric features. Version 2.0 seeks to improve upon the current release in a number of ways, focusing on making it easier to get started using the framework, improving performance, and fully embracing the latest PHP language enhancements made available to version 5.3. [...] Although the official release won't be out for several more months, it never hurts to take an early look at what the future holds for a technology used by countless PHP developers around the globe. In this article I'll present a meandering introduction to the key version 2.0 features that I find particularly compelling. He starts with a brief tutorial on getting the latest version of ZF2 from the git repository and creating basic project. The changes in the framework have fallen into a "rewrite only where it makes sense" mentality and changes have really only been made transparently to the backend or as new features/components like module management and Doctrine 2 integration. He also points out a few resources you can use to keep up to date on the latest from the framework including the changelog, mailing list and the ZF2 blog.
PHPBuilder.com: An Early Look at Zend Framework 2.0
On PHPBuilder.com Jason Gilmore has posted a first peek at Zend Framework 2, an upcoming reworking of the popular framework with PHP 5.3-centric features. Version 2.0 seeks to improve upon the current release in a number of ways, focusing on making it easier to get started using the framework, improving performance, and fully embracing the latest PHP language enhancements made available to version 5.3. [...] Although the official release won't be out for several more months, it never hurts to take an early look at what the future holds for a technology used by countless PHP developers around the globe. In this article I'll present a meandering introduction to the key version 2.0 features that I find particularly compelling. He starts with a brief tutorial on getting the latest version of ZF2 from the git repository and creating basic project. The changes in the framework have fallen into a "rewrite only where it makes sense" mentality and changes have really only been made transparently to the backend or as new features/components like module management and Doctrine 2 integration. He also points out a few resources you can use to keep up to date on the latest from the framework including the changelog, mailing list and the ZF2 blog.
2011-11-01 16:23:
On the ArsMagnaTutorials YouTube channel has posted three video tutorials (so far) covering the Fuel PHP framework, introducing you to some of the core concepts behind using this powerful framework. The three videos in the series give an overview of: Installation and configuration Folders and structure the framework provides Controllers, view and using the HTML5 boilerplate. You can find out more about Fuel on its website and more about the HTML5 Boilerplate here.
ArsMagnaTutorials: FuelPHP Tutorial Videos
On the ArsMagnaTutorials YouTube channel has posted three video tutorials (so far) covering the Fuel PHP framework, introducing you to some of the core concepts behind using this powerful framework. The three videos in the series give an overview of: Installation and configuration Folders and structure the framework provides Controllers, view and using the HTML5 boilerplate. You can find out more about Fuel on its website and more about the HTML5 Boilerplate here.
2011-11-01 15:43:
On PHPMaster.com today there's a new tutorial showing the use of a sometimes overlooked (but very handy) alternate syntax that PHP includes - the ternary operator, a short-hand if/else. You're probably already familiar with PHP's if statement. It's very similar to its counterparts in many other programming languages and represents one of the most fundamental concepts in programming. [...] But there's a way to build on this concept and increase your $coolFactor a bit in the process. Allow me to introduce you to the ternary operator, which serves as a shorthand notation for if statements. They introduce the ternary operator's syntax, the ":" and "?" operators and includes a few pieces of code showing its use. Thankfully they also include a warning - don't overuse or abuse it...and especially don't nest them - that just leads to headaches.
PHPMaster.com: Using the Ternary Operator
On PHPMaster.com today there's a new tutorial showing the use of a sometimes overlooked (but very handy) alternate syntax that PHP includes - the ternary operator, a short-hand if/else. You're probably already familiar with PHP's if statement. It's very similar to its counterparts in many other programming languages and represents one of the most fundamental concepts in programming. [...] But there's a way to build on this concept and increase your $coolFactor a bit in the process. Allow me to introduce you to the ternary operator, which serves as a shorthand notation for if statements. They introduce the ternary operator's syntax, the ":" and "?" operators and includes a few pieces of code showing its use. Thankfully they also include a warning - don't overuse or abuse it...and especially don't nest them - that just leads to headaches.
2011-11-01 14:06:
On the Developer Drive blog today there's a new tutorial helping you build out a simple CRUD (create, read, update and delete) system using a MySQL backend. This is just the first part of the series, introducing you to some concepts and getting the ball rolling connecting PHP and the database. You're may be wondering what exactly CRUD is. CRUD simply stands for Create, Read, Update and Delete and it is the one of the fundamental principles of programming logic that can be expanded and applied to larger projects. For example, let's imagine we're creating a social network and we like to have the ability for users to create accounts, edit and update information for those accounts and also delete said accounts; that is CRUD at work. This first part covers the structure of the database that'll make up the storage and includes a brief snippet of code to connect your PHP to the database (using PDO).
Developer Drive: Create Your Own CRUD App with MySQL and PHP
On the Developer Drive blog today there's a new tutorial helping you build out a simple CRUD (create, read, update and delete) system using a MySQL backend. This is just the first part of the series, introducing you to some concepts and getting the ball rolling connecting PHP and the database. You're may be wondering what exactly CRUD is. CRUD simply stands for Create, Read, Update and Delete and it is the one of the fundamental principles of programming logic that can be expanded and applied to larger projects. For example, let's imagine we're creating a social network and we like to have the ability for users to create accounts, edit and update information for those accounts and also delete said accounts; that is CRUD at work. This first part covers the structure of the database that'll make up the storage and includes a brief snippet of code to connect your PHP to the database (using PDO).
2011-11-01 13:06:
Latest PECL Releases: cld 0.3.0 eio 0.3.0 cld 0.4.0
Community News: Latest PECL Releases for 11.01.2011
Latest PECL Releases: cld 0.3.0 eio 0.3.0 cld 0.4.0
2011-10-31 20:26:
Johannes Schmitt has a new post about his "killer feature" he's added to the security for Symfony2 framework (as a bundle) - a new customized expression-based query language that's compiled down to native PHP to make permissions checking simpler and faster. If you have used the Symfony2 Security Component to any modest degree, you will know that we have a quite heavy voting system which uses attributes like "IS_AUTHENTICATED_FULLY" to make authorization decisions. [...] If you are concerned about performance, then you should not be all too generous with the isGranted() calls. The second option would work as well, but writing a new voter each time you need to make a new check does not really seem ideal either. Fortunately, we can do better. He includes an example of this expression language in a direct isGranted() call, a string that checks to see if a user has three different roles, and a snippet showing the same thing in the docblock comment of a controller method. The second is a bit more complex, checking for an admin role or if the user is the one that should be deleted. You can find more doucmentation here.
Johannes Schmitt's Blog: A New Killer Feature for Symfony2 Security
Johannes Schmitt has a new post about his "killer feature" he's added to the security for Symfony2 framework (as a bundle) - a new customized expression-based query language that's compiled down to native PHP to make permissions checking simpler and faster. If you have used the Symfony2 Security Component to any modest degree, you will know that we have a quite heavy voting system which uses attributes like "IS_AUTHENTICATED_FULLY" to make authorization decisions. [...] If you are concerned about performance, then you should not be all too generous with the isGranted() calls. The second option would work as well, but writing a new voter each time you need to make a new check does not really seem ideal either. Fortunately, we can do better. He includes an example of this expression language in a direct isGranted() call, a string that checks to see if a user has three different roles, and a snippet showing the same thing in the docblock comment of a controller method. The second is a bit more complex, checking for an admin role or if the user is the one that should be deleted. You can find more doucmentation here.
2011-10-31 20:26:
Johannes Schmitt has a new post about his "killer feature" he's added to the security for Symfony2 framework (as a bundle) - a new customized expression-based query language that's compiled down to native PHP to make permissions checking simpler and faster. If you have used the Symfony2 Security Component to any modest degree, you will know that we have a quite heavy voting system which uses attributes like "IS_AUTHENTICATED_FULLY" to make authorization decisions. [...] If you are concerned about performance, then you should not be all too generous with the isGranted() calls. The second option would work as well, but writing a new voter each time you need to make a new check does not really seem ideal either. Fortunately, we can do better. He includes an example of this expression language in a direct isGranted() call, a string that checks to see if a user has three different roles, and a snippet showing the same thing in the docblock comment of a controller method. The second is a bit more complex, checking for an admin role or if the user is the one that should be deleted. You can find more doucmentation here.
Johannes Schmitt' Blog: A New Killer Feature for Symfony2 Security
Johannes Schmitt has a new post about his "killer feature" he's added to the security for Symfony2 framework (as a bundle) - a new customized expression-based query language that's compiled down to native PHP to make permissions checking simpler and faster. If you have used the Symfony2 Security Component to any modest degree, you will know that we have a quite heavy voting system which uses attributes like "IS_AUTHENTICATED_FULLY" to make authorization decisions. [...] If you are concerned about performance, then you should not be all too generous with the isGranted() calls. The second option would work as well, but writing a new voter each time you need to make a new check does not really seem ideal either. Fortunately, we can do better. He includes an example of this expression language in a direct isGranted() call, a string that checks to see if a user has three different roles, and a snippet showing the same thing in the docblock comment of a controller method. The second is a bit more complex, checking for an admin role or if the user is the one that should be deleted. You can find more doucmentation here.
2011-10-31 19:09:
As linked to on DZone.com today, there's a video series about PHP/MySQL and creating a basic search engine from Adam Khoury's collection: Fresh from Adam Khoury's massive library of instructional videos comes a four-part, full-fledged tutorial on searching a MySQL database using PHP. The tutorials use the 'worked example' format (like Khan Academy), which makes learning relatively painless for newbies and not completely useless for more experienced developers. The four videos require you to have at least a decent working knowledge of putting PHP and MySQL together and show you how to: create/populate an example table build the frontend search form use UNION and LIKEs to search the data using the FULLTEXT searching in MySQL to find more accurate results
DZone.com: MySQL PHP search: four-part video tutorial series
As linked to on DZone.com today, there's a video series about PHP/MySQL and creating a basic search engine from Adam Khoury's collection: Fresh from Adam Khoury's massive library of instructional videos comes a four-part, full-fledged tutorial on searching a MySQL database using PHP. The tutorials use the 'worked example' format (like Khan Academy), which makes learning relatively painless for newbies and not completely useless for more experienced developers. The four videos require you to have at least a decent working knowledge of putting PHP and MySQL together and show you how to: create/populate an example table build the frontend search form use UNION and LIKEs to search the data using the FULLTEXT searching in MySQL to find more accurate results
2011-10-31 18:50:
On PHPClasses.org today they've released their latest episode of their "Lately In PHP" podcast - episode #17. In this new episode Manuel and Ernani talk about PHP-GTK in a web browser and the proposed PHP 5.4 release date. PHP 5.4 beta 2 was just released, so the final version of 5.4.0 is coming soon. Many PHP Developers want to know when it will be the final PHP 5.4 release date. Manuel Lemos and Ernani Joppert talk about this and other interesting PHP related topics in episode 17 of the Lately in PHP podcast. You can listen to this latest episode either through the in-page player, by downloading the full mp3 or by subscribing to their feed to get this and past episodes (including ones about MODX and PHPFog).
PHPClasses.org: Lately in PHP podcast episode 17 - PHP 5.4 & PHP-GTK in the Browser
On PHPClasses.org today they've released their latest episode of their "Lately In PHP" podcast - episode #17. In this new episode Manuel and Ernani talk about PHP-GTK in a web browser and the proposed PHP 5.4 release date. PHP 5.4 beta 2 was just released, so the final version of 5.4.0 is coming soon. Many PHP Developers want to know when it will be the final PHP 5.4 release date. Manuel Lemos and Ernani Joppert talk about this and other interesting PHP related topics in episode 17 of the Lately in PHP podcast. You can listen to this latest episode either through the in-page player, by downloading the full mp3 or by subscribing to their feed to get this and past episodes (including ones about MODX and PHPFog).
2011-10-31 17:26:
On the Ibuildings techPortal today there's a new post from Robert Raszczynski about domain modeling and how a good knowledge of it can help your application's architecture. Architectural and design patterns help software architects to break systems in to smaller, more maintainable sections organised by their functionality and usage. [...] There are three major layers in software architecture: presentation, domain and data source. [...] Now that we know what types of layers we can find in software architecture, let's have a look at how we can organize domain logic and data sources layers. He looks at three patterns that can help organize your domain logic - a transactional script (one file that does one thing), a table module (logic lives in the tables) and his focus, the domain model. He shows (via a graph) how the domain logic approach can cut through some of the effort it could take to improve on the other two. He gives a two suggestions of how to access the data in your domain layer - a Gateway or a Data Mapper. To reinforce the ideas he's presented, he includes some code snippets of a basic domain model for a Store, Customer and Product and uses them in both Gateway and Data Mapper examples.
Ibuildings techPortal: Architecture Patterns: Domain Model and Friends
On the Ibuildings techPortal today there's a new post from Robert Raszczynski about domain modeling and how a good knowledge of it can help your application's architecture. Architectural and design patterns help software architects to break systems in to smaller, more maintainable sections organised by their functionality and usage. [...] There are three major layers in software architecture: presentation, domain and data source. [...] Now that we know what types of layers we can find in software architecture, let's have a look at how we can organize domain logic and data sources layers. He looks at three patterns that can help organize your domain logic - a transactional script (one file that does one thing), a table module (logic lives in the tables) and his focus, the domain model. He shows (via a graph) how the domain logic approach can cut through some of the effort it could take to improve on the other two. He gives a two suggestions of how to access the data in your domain layer - a Gateway or a Data Mapper. To reinforce the ideas he's presented, he includes some code snippets of a basic domain model for a Store, Customer and Product and uses them in both Gateway and Data Mapper examples.
2011-10-31 16:40:
The PEAR blog has a recommendation for those that might not have updated their package udage in a while - there's been major changes in many packages, but two in particular. We've had 60 releases since July. While most are often minor improvements or bug fixes; a number of packages really stand out. Net_DNS2, and HTTP_Request2. Each of these packages represents the second edition of their respective APIs; each having been honed over time to a point of stability. Net_DNS2 gives you the ability to communicate and resolve host names/domain names inside of a PHP application. HTTP_Request2 gives you a simple way to perform HTTP requests.
PEAR Blog: Newly stable packages in PEAR
The PEAR blog has a recommendation for those that might not have updated their package udage in a while - there's been major changes in many packages, but two in particular. We've had 60 releases since July. While most are often minor improvements or bug fixes; a number of packages really stand out. Net_DNS2, and HTTP_Request2. Each of these packages represents the second edition of their respective APIs; each having been honed over time to a point of stability. Net_DNS2 gives you the ability to communicate and resolve host names/domain names inside of a PHP application. HTTP_Request2 gives you a simple way to perform HTTP requests.
2011-10-31 15:50:
Henri Bergius has a new post to his blog today sharing details about a messaging protocol that can help PHP and Node.js play together nicely - DNode. Both environments have their strong points. Node.js is very fast and flexible, but PHP has a lot more mature tools and libraries available. So in a lot of projects it is hard to choose between the two. But now you might not have to. DNode is a remote method invocation protocol originally written for Node.js, as the name probably tells. But as the protocol itself is quite simple, just sending newline-terminated JSON packets over TCP connections, implementations have started popping up in other languages. You can talk DNode in Ruby, Perl, Python, Java, and now PHP. He includes a quick example of both sides of the messaging - a simple server on the Node.js side that looks for a DNode request and using the dnode PHP client to connect to it (and return the input number multiplied by 100). He also includes a method that allows for bidirectional communication with a service that converts from Celsius to Fahrenheit.
Henri Bergius' Blog: DNode: Make PHP And Node.Js Talk To Each Other
Henri Bergius has a new post to his blog today sharing details about a messaging protocol that can help PHP and Node.js play together nicely - DNode. Both environments have their strong points. Node.js is very fast and flexible, but PHP has a lot more mature tools and libraries available. So in a lot of projects it is hard to choose between the two. But now you might not have to. DNode is a remote method invocation protocol originally written for Node.js, as the name probably tells. But as the protocol itself is quite simple, just sending newline-terminated JSON packets over TCP connections, implementations have started popping up in other languages. You can talk DNode in Ruby, Perl, Python, Java, and now PHP. He includes a quick example of both sides of the messaging - a simple server on the Node.js side that looks for a DNode request and using the dnode PHP client to connect to it (and return the input number multiplied by 100). He also includes a method that allows for bidirectional communication with a service that converts from Celsius to Fahrenheit.
2011-10-31 14:38:
PHPMaster.com has a new tutorial sharing what they call the right way for localizing PHP applications with the help of PHP's gettext functionality. Localizing software applications in general used to be a cumbersome and error-prone task resulting in a lot of messy code. Some developers even use different versions of code for the same application but for different locales, which makes managing the codebase practically impossible. Enter gettext, the wonderful open-source tool that will make your life easier by allowing you to concentrate on your code. Localization becomes a matter of writing separate translation files for the target language, which can easily be done by a translator using Poedit. They help you get your environment set up - PHP and a href="http://poedit.net/">Poedit, a gettext catalog editor - for both linux- and Windows-based OSes. They walk you through the creation of a simple project and a few basic "hello world" tokens. Using the files is as easy as setting the correct locale and default domain for your application. Then output is just a basic echo away.
PHPMaster.com: Localizing PHP Applications "The Right Way", Part 1
PHPMaster.com has a new tutorial sharing what they call the right way for localizing PHP applications with the help of PHP's gettext functionality. Localizing software applications in general used to be a cumbersome and error-prone task resulting in a lot of messy code. Some developers even use different versions of code for the same application but for different locales, which makes managing the codebase practically impossible. Enter gettext, the wonderful open-source tool that will make your life easier by allowing you to concentrate on your code. Localization becomes a matter of writing separate translation files for the target language, which can easily be done by a translator using Poedit. They help you get your environment set up - PHP and a href="http://poedit.net/">Poedit, a gettext catalog editor - for both linux- and Windows-based OSes. They walk you through the creation of a simple project and a few basic "hello world" tokens. Using the files is as easy as setting the correct locale and default domain for your application. Then output is just a basic echo away.
2011-10-31 13:08:
Latest PEAR Releases: Net_LDAP2 2.0.12 File_IMC 0.4.3
Community News: Latest PEAR Releases for 10.31.2011
Latest PEAR Releases: Net_LDAP2 2.0.12 File_IMC 0.4.3
2011-10-28 18:07:
Two recent summaries of this year's Zend/PHP Conference have been posted - one from an attendee and speaker, another from a member of the Zend team. In his post Joshua talks about the conference in general - the quality of the talks he went to and the community he experienced while there. He also mentions his presentation, "Puppet for Dummies" and some sessions from the Unconference. Andi Gutmans, CEO of Zend adds his perspective and mentions some of the new technologies that were introduced during the event including their PHPCloud platform and the Zend Application Fabric.
Community News: ZendCon 2011 Wrap-ups (from a Speaker & Zend)
Two recent summaries of this year's Zend/PHP Conference have been posted - one from an attendee and speaker, another from a member of the Zend team. In his post Joshua talks about the conference in general - the quality of the talks he went to and the community he experienced while there. He also mentions his presentation, "Puppet for Dummies" and some sessions from the Unconference. Andi Gutmans, CEO of Zend adds his perspective and mentions some of the new technologies that were introduced during the event including their PHPCloud platform and the Zend Application Fabric.
2011-10-28 17:15:
On the Ibuildings techPortal Marco De Bortoli has posted the second part of his summary of this year's PHP North West conference (you can find the first part here). In this part he briefly discusses the tutorial day and the main conference, including the sessions he attended. This was a very social event from day one, warm and funny with a horde of geeks trying to mix with "normal people" (yes, that can happen if you attend the PHPNW conference, so try not to miss it next year). The best thing about PHP conferences is knowledge-sharing; you won't leave without a hundred different thoughts and ideas of how to do things better. Once again - definitely a good time, both personally and professionally. If you weren't there, you missed out! The sessions he specifically mentions include the "Security" talk from Arne Blankerts, "Maintainable Applications in PHP Using Components" by Stuart Herbert, "PHP Extensions, why and what?" by Derick Rethans and "Acceptance & Integration Testing Using Behat" from Ben Waine.
Ibuildings techPortal: PHPNW11 Conference Report - Part II
On the Ibuildings techPortal Marco De Bortoli has posted the second part of his summary of this year's PHP North West conference (you can find the first part here). In this part he briefly discusses the tutorial day and the main conference, including the sessions he attended. This was a very social event from day one, warm and funny with a horde of geeks trying to mix with "normal people" (yes, that can happen if you attend the PHPNW conference, so try not to miss it next year). The best thing about PHP conferences is knowledge-sharing; you won't leave without a hundred different thoughts and ideas of how to do things better. Once again - definitely a good time, both personally and professionally. If you weren't there, you missed out! The sessions he specifically mentions include the "Security" talk from Arne Blankerts, "Maintainable Applications in PHP Using Components" by Stuart Herbert, "PHP Extensions, why and what?" by Derick Rethans and "Acceptance & Integration Testing Using Behat" from Ben Waine.
2011-10-28 16:55:
On the XpertDeveloper.com site today there's a new tutorial talking about something that can not only help the structure of your application but can make things more reusable in the end - abstract classes. For Abstact keyword we can say that, abstract is type of the class and class which we can't create a object of it. Surprised???? [...] Abstract class can be used some what like an interface in PHP. So basically we can implement class using abstract. We can't extend more than one abstract class while we can implement more than one interface. They introduce you to the creation of an abstract class and show how to set up some abstract methods inside. These methods are required to be defined as a part of the extension in your class. One of the benefits they don't mention of abstract classes over interfaces is the ability to have methods in the abstract that are actual code, not just definitions of the structure (that's more of what interfaces are for).
XpertDeveloper.com: Abstract in PHP
On the XpertDeveloper.com site today there's a new tutorial talking about something that can not only help the structure of your application but can make things more reusable in the end - abstract classes. For Abstact keyword we can say that, abstract is type of the class and class which we can't create a object of it. Surprised???? [...] Abstract class can be used some what like an interface in PHP. So basically we can implement class using abstract. We can't extend more than one abstract class while we can implement more than one interface. They introduce you to the creation of an abstract class and show how to set up some abstract methods inside. These methods are required to be defined as a part of the extension in your class. One of the benefits they don't mention of abstract classes over interfaces is the ability to have methods in the abstract that are actual code, not just definitions of the structure (that's more of what interfaces are for).
2011-10-28 15:43:
In a new post to DZone.com Mitchell Pronschinske looks at closure object binding in PHP 5.4 applications (yes, we know PHP 5.4 isn't released yet). He explains what this is an shows some sample use cases for you to consider in your development. For the people who read PHP's NEWS file, it's no surprise - but for all who don't here's is probably one of the biggest features of PHP 5.4: Closure Object Support is back. For me it's something I missed the most, when Closures were introduced in PHP 5.3. So I'm very happy, that's finally here (or back). I'm going to tell you about the rocky road which closure object binding support had and show you some simple use cases for it. The functionality, based on this RFC, lets you more correctly bind closures to objects instead of having to pass the objects into the closure at create time. He includes an example from a Silex framework application and an example that refactors a helper method as a part of rendering a simple template.
DZone.com: Closure Object Binding in PHP 5.4
In a new post to DZone.com Mitchell Pronschinske looks at closure object binding in PHP 5.4 applications (yes, we know PHP 5.4 isn't released yet). He explains what this is an shows some sample use cases for you to consider in your development. For the people who read PHP's NEWS file, it's no surprise - but for all who don't here's is probably one of the biggest features of PHP 5.4: Closure Object Support is back. For me it's something I missed the most, when Closures were introduced in PHP 5.3. So I'm very happy, that's finally here (or back). I'm going to tell you about the rocky road which closure object binding support had and show you some simple use cases for it. The functionality, based on this RFC, lets you more correctly bind closures to objects instead of having to pass the objects into the closure at create time. He includes an example from a Silex framework application and an example that refactors a helper method as a part of rendering a simple template.
2011-10-28 14:03:
Popular posts from PHPDeveloper.org for the past week:SitePoint Blog: Book Release - "PHP Master: Write Cutting-Edge PHP Code" Community News: CakePHP 2.0 Released (with some Major Changes) DZone.com: PHP 5.4 Will Have a Built-in Web Server Adam Patterson's Blog: DIY simple staging server. Fabien Potencier's Blog: What is Symfony2? Brian Swan's Blog: Using SQL Azure to Store PHP Session Data Script-Tutorials.com: Creating a Smooth Curve Graphs with PHP and GD User Group: New York PHP (Oct 25th @ 6:30pm) - MongoDb & ZendCon Justin Carmony's Blog: Setting Up Nginx & PHP-FPM on Ubuntu 10.04 CodeForest.net: Obfuscate your e-mail address with PHP, JavaScript and CSS
Site News: Popular Posts for the Week of 10.28.2011
Popular posts from PHPDeveloper.org for the past week:SitePoint Blog: Book Release - "PHP Master: Write Cutting-Edge PHP Code" Community News: CakePHP 2.0 Released (with some Major Changes) DZone.com: PHP 5.4 Will Have a Built-in Web Server Adam Patterson's Blog: DIY simple staging server. Fabien Potencier's Blog: What is Symfony2? Brian Swan's Blog: Using SQL Azure to Store PHP Session Data Script-Tutorials.com: Creating a Smooth Curve Graphs with PHP and GD User Group: New York PHP (Oct 25th @ 6:30pm) - MongoDb & ZendCon Justin Carmony's Blog: Setting Up Nginx & PHP-FPM on Ubuntu 10.04 CodeForest.net: Obfuscate your e-mail address with PHP, JavaScript and CSS
2011-10-27 19:49:
These days there's much more involved in making a good, solid web application than just the platform you serve from. Joshua Thijssen knows this and humorously points it out in a new post about a "LAMPGMVNMCSTRAH-stack" (that's fifteen different technologies for those counting). Back in the good old days - and in internet-time, this actually means just a few years ago - people were quite happy with their LAMP stack: Linux, Apache, MySQL and PHP. With this quartet, or a variation on it like PostgreSQL instead of MySQL, we could do everything: create a blog-site, setup an e-commerce web shop, making a guestbook, you name it and it was there.. But times have changed... radically. He talks about this "brave new world" developers live in today where they can't know everything that happens in every facet of the application (he likens it to the responsibilities of generals vs infantry in the army). As a programmer, you simply cannot pretend that you and you alone are running a system. You are part of a whole, and even though you might be the most important part, or the controlling part, you still need to work with other components in order to get the job done. If you forget this, no matter how good your part is running, the whole system will fail because you either decided to do too much yourself, or did not correctly utilize the rest of the system. Wondering what his acronym stands for? LAMPGMVNMCSTRAH is short for "Linux, Apache, MySQL, PHP, Gearman, Memcached, Varnish, Ngnix, MongoDB, CouchDB, Solr, Tika, Redit, ActiveMQ, Hadoop."
Joshua Thijssen's Blog: LAMP-stack? Forget it! It's a LAMPGMVNMCSTRAH-stack now...
These days there's much more involved in making a good, solid web application than just the platform you serve from. Joshua Thijssen knows this and humorously points it out in a new post about a "LAMPGMVNMCSTRAH-stack" (that's fifteen different technologies for those counting). Back in the good old days - and in internet-time, this actually means just a few years ago - people were quite happy with their LAMP stack: Linux, Apache, MySQL and PHP. With this quartet, or a variation on it like PostgreSQL instead of MySQL, we could do everything: create a blog-site, setup an e-commerce web shop, making a guestbook, you name it and it was there.. But times have changed... radically. He talks about this "brave new world" developers live in today where they can't know everything that happens in every facet of the application (he likens it to the responsibilities of generals vs infantry in the army). As a programmer, you simply cannot pretend that you and you alone are running a system. You are part of a whole, and even though you might be the most important part, or the controlling part, you still need to work with other components in order to get the job done. If you forget this, no matter how good your part is running, the whole system will fail because you either decided to do too much yourself, or did not correctly utilize the rest of the system. Wondering what his acronym stands for? LAMPGMVNMCSTRAH is short for "Linux, Apache, MySQL, PHP, Gearman, Memcached, Varnish, Ngnix, MongoDB, CouchDB, Solr, Tika, Redit, ActiveMQ, Hadoop."
2011-10-27 18:36:
Padraic Brady has posted his own response to some of the recent talk about making standard interfaces in PHP applications. His perspective focuses on interfaces and coupling as related to the Zend Framework. Every PHP framework has it's own unique set of interfaces for common operations such as logging, caching, http clients, filtering, validation, etc. This creates a situation where a framework tends to be loosely coupled but only within the scope of its own interfaces. [...] Loose coupling is therefore a bad joke. It is a narrowly defined concept usually described within the scope of one particular application. We never really apply the concept across multiple applications written with different frameworks because, at that point, the disparate interfaces of both frameworks would immediately make loose coupling unobtainable. He goes on to talk about a simple example, ZendFeedReader, and how it's very difficult to swap something as simple as the HTTP client out for one from another framework. He mentions the common scapegoat for over-interfacing - Java - and how PHP's is a bit more "practical and flexible" in that department (a good and bad thing). So yes, common interfaces would benefit PHP and would make framework libraries more interoperable and thus usable within competing frameworks. Hey, if you can't beat them at least make sure you can inject your classes into them. Hmm, still sounds dirty.
Padraic Brady's Blog: Interfacing The PHP World Would Be Good
Padraic Brady has posted his own response to some of the recent talk about making standard interfaces in PHP applications. His perspective focuses on interfaces and coupling as related to the Zend Framework. Every PHP framework has it's own unique set of interfaces for common operations such as logging, caching, http clients, filtering, validation, etc. This creates a situation where a framework tends to be loosely coupled but only within the scope of its own interfaces. [...] Loose coupling is therefore a bad joke. It is a narrowly defined concept usually described within the scope of one particular application. We never really apply the concept across multiple applications written with different frameworks because, at that point, the disparate interfaces of both frameworks would immediately make loose coupling unobtainable. He goes on to talk about a simple example, ZendFeedReader, and how it's very difficult to swap something as simple as the HTTP client out for one from another framework. He mentions the common scapegoat for over-interfacing - Java - and how PHP's is a bit more "practical and flexible" in that department (a good and bad thing). So yes, common interfaces would benefit PHP and would make framework libraries more interoperable and thus usable within competing frameworks. Hey, if you can't beat them at least make sure you can inject your classes into them. Hmm, still sounds dirty.
2011-10-27 17:12:
The PHP.net site has a new announcement about the latest version of the language in the PHP 5.4.x series - beta 2 has been released for testing. The PHP development team is proud to announce the second beta release of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. [...] Please help us to identify bugs by testing new features and looking for unintended backward compatibility breaks, so we can fix the problems and fully document intended changes before PHP 5.4.0 is released. Report findings to the QA mailing list and/or the PHP bug tracker. Remember - this is not a production release, so do not use it in your live applications (unless you really like to live dangerously, of course). You can look at the NEWS file for a complete list of changes.
PHP.net: PHP 5.4 beta2 released
The PHP.net site has a new announcement about the latest version of the language in the PHP 5.4.x series - beta 2 has been released for testing. The PHP development team is proud to announce the second beta release of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. [...] Please help us to identify bugs by testing new features and looking for unintended backward compatibility breaks, so we can fix the problems and fully document intended changes before PHP 5.4.0 is released. Report findings to the QA mailing list and/or the PHP bug tracker. Remember - this is not a production release, so do not use it in your live applications (unless you really like to live dangerously, of course). You can look at the NEWS file for a complete list of changes.
2011-10-27 16:57:
On the PHPClasses.org blog today there's a new post showing how you can use PHP-GTK to generate websites, not just the more traditional desktop applications people associate it with. es, you read it right, GTK+, the Gnome Toolkit library, normally used to create desktop applications, can now be used to serve the same applications via the Web to a browser that supports HTML 5 canvas objects. PHP-GTK is a PHP extension that uses the GTK+ library to build PHP desktop applications. So it can eventually benefit for this GTK library enhancements to build PHP-GTK based applications that can be served over the Web to HTML 5 browsers. Manuel starts by explaining a bit about what PHP-GTK (and GTK+) is and a recent update to GTK+ that allows it to generate output to different backends - Wayland (direct graphics rendering) and Broadway (HTML5 canvas support). There's no example code to go along with the post, but there's a good description of how the output of an X Windows session could be pulled in and displayed in a browser (see this video for a cool example using GIMP and Broadway).
PHPClasses.org: Using PHP-GTK to serve Web Applications to HTML 5 Browsers
On the PHPClasses.org blog today there's a new post showing how you can use PHP-GTK to generate websites, not just the more traditional desktop applications people associate it with. es, you read it right, GTK+, the Gnome Toolkit library, normally used to create desktop applications, can now be used to serve the same applications via the Web to a browser that supports HTML 5 canvas objects. PHP-GTK is a PHP extension that uses the GTK+ library to build PHP desktop applications. So it can eventually benefit for this GTK library enhancements to build PHP-GTK based applications that can be served over the Web to HTML 5 browsers. Manuel starts by explaining a bit about what PHP-GTK (and GTK+) is and a recent update to GTK+ that allows it to generate output to different backends - Wayland (direct graphics rendering) and Broadway (HTML5 canvas support). There's no example code to go along with the post, but there's a good description of how the output of an X Windows session could be pulled in and displayed in a browser (see this video for a cool example using GIMP and Broadway).
2011-10-27 15:27:
PHPMaster.com has a new tutorial today for those wanting to get into the MongoDb document-driven (NoSQL) database but haven't known where to start. This tutorial walks you through some of the basics including setup and configuration of both the server and PHP client side. There are a lot of implementations of the NoSQL concept, but one of the most famous and widely used NoSQL databases is MongoDB. I think it's one of the most interesting NoSQL databases available currently, and it's considered by many to be one of the easiest to use (which has helped it gain widespread adoption). In this article I'll introduce you to NoSQL with MongoDB. You'll learn how to install the MongoDB extension for PHP, and how to add, update, and retrieve document objects. He starts with an introduction to MongoDB and links to their site to grab the latest version of the database. A few simple steps later (including a call to install the mongo PECL module) and your PHP install is ready to go. Code snippets are included showing how to connect to the server and insert/update/select document records.
PHPMaster.com: Introduction to MongoDB
PHPMaster.com has a new tutorial today for those wanting to get into the MongoDb document-driven (NoSQL) database but haven't known where to start. This tutorial walks you through some of the basics including setup and configuration of both the server and PHP client side. There are a lot of implementations of the NoSQL concept, but one of the most famous and widely used NoSQL databases is MongoDB. I think it's one of the most interesting NoSQL databases available currently, and it's considered by many to be one of the easiest to use (which has helped it gain widespread adoption). In this article I'll introduce you to NoSQL with MongoDB. You'll learn how to install the MongoDB extension for PHP, and how to add, update, and retrieve document objects. He starts with an introduction to MongoDB and links to their site to grab the latest version of the database. A few simple steps later (including a call to install the mongo PECL module) and your PHP install is ready to go. Code snippets are included showing how to connect to the server and insert/update/select document records.
2011-10-26 19:39:
A new post on CodeForest.net today gives you a technique for obfuscating email addresses with a combination of PHP, CSS and Javascript. It uses ROT13 for the obfuscation and some tricky CSS to keep it usable for the human visitors. According to Wikipedia, more than 97% of all e-mails sent over the net are unwanted. That's around 200 billion spam messages per day. To keep this insane amount of spam out of your inbox, you should keep your e-mail safe when you display it on web. One of the ways to keep it safe is to obfuscate it. In this tutorial I'll show you how to create a script that will do just that. The script converts the email address into a ROT13 obfuscated versions and reverse it. The spam bots harvesting addresses won't see it as a valid format but the user, thanks to some CSS rules, will see it and be able to copy it easily. Each part of the script is explained in the post and you can see a demo of it in action here.
CodeForest.net: Obfuscate your e-mail address with PHP, JavaScript and CSS
A new post on CodeForest.net today gives you a technique for obfuscating email addresses with a combination of PHP, CSS and Javascript. It uses ROT13 for the obfuscation and some tricky CSS to keep it usable for the human visitors. According to Wikipedia, more than 97% of all e-mails sent over the net are unwanted. That's around 200 billion spam messages per day. To keep this insane amount of spam out of your inbox, you should keep your e-mail safe when you display it on web. One of the ways to keep it safe is to obfuscate it. In this tutorial I'll show you how to create a script that will do just that. The script converts the email address into a ROT13 obfuscated versions and reverse it. The spam bots harvesting addresses won't see it as a valid format but the user, thanks to some CSS rules, will see it and be able to copy it easily. Each part of the script is explained in the post and you can see a demo of it in action here.
2011-10-26 18:19:
Pavel Shevaev has a quick new post to his blog showing how to get PHP-FPM to execute PHP scripts via a socket request. We are using APC cache very heavily in our projects and during project deployment the cache must be flushed and warmed up. A common solution to warmup the APC cache is to fetch some special page via HTTP which does the job. The problem with this approach is that it's not reliable enough when PHP is served via several fastcgi back-ends. To solve the problem, he uses a PHP-FPM module to work with the FastCGI socket and execute any file (as permissions allow, of course). In his case, he uses it to "warm up" his APC cache for the user. A code snippet is provided as an example.
Pavel Shevaev's Blog: Make php-fpm execute arbitrary PHP scripts via socket
Pavel Shevaev has a quick new post to his blog showing how to get PHP-FPM to execute PHP scripts via a socket request. We are using APC cache very heavily in our projects and during project deployment the cache must be flushed and warmed up. A common solution to warmup the APC cache is to fetch some special page via HTTP which does the job. The problem with this approach is that it's not reliable enough when PHP is served via several fastcgi back-ends. To solve the problem, he uses a PHP-FPM module to work with the FastCGI socket and execute any file (as permissions allow, of course). In his case, he uses it to "warm up" his APC cache for the user. A code snippet is provided as an example.
2011-10-26 17:51:
On ZendCasts.com today, the next part of their series looking at using the Slim microframework has been posted. This is part one of a tutorial building a JSON endpoint for a web service. You'll need some of the base that he created in this previous screencast to follow along (the basic structure, really). His takes his basic "hello world" application and builds on it to add a "model" to pull name data from and has the "/names" action respond with a JSON-formatted message (and an "application/json" content-type). His "model" pulls the data out with findAll() and find() methods. You can grab the source to follow along.
ZendCasts.com: Building a JSON Endpoint with SLIM (Part 1)
On ZendCasts.com today, the next part of their series looking at using the Slim microframework has been posted. This is part one of a tutorial building a JSON endpoint for a web service. You'll need some of the base that he created in this previous screencast to follow along (the basic structure, really). His takes his basic "hello world" application and builds on it to add a "model" to pull name data from and has the "/names" action respond with a JSON-formatted message (and an "application/json" content-type). His "model" pulls the data out with findAll() and find() methods. You can grab the source to follow along.
2011-10-26 16:15:
Fabien Potencier has made an announcement on the Symfony Blog today about all the availability of previous Symfony versions on github. symfony1 is well and alive and many developers are now using it for projects hosted on Git. But as the official symfony 1 repository is hosted on Subversion, it's not always easy to get things versioned easily. As of today, this becomes much more easier. If you are using Git and symfony1, you can now use the official symfony1 Git clone. There are branches for each of the major 1.x releases as well as tags for some of the minor releases. You can, of course, still access the latest packages directly via the symfony website.
Symfony Blog: All symfony 1.x versions available on Github
Fabien Potencier has made an announcement on the Symfony Blog today about all the availability of previous Symfony versions on github. symfony1 is well and alive and many developers are now using it for projects hosted on Git. But as the official symfony 1 repository is hosted on Subversion, it's not always easy to get things versioned easily. As of today, this becomes much more easier. If you are using Git and symfony1, you can now use the official symfony1 Git clone. There are branches for each of the major 1.x releases as well as tags for some of the minor releases. You can, of course, still access the latest packages directly via the symfony website.
2011-10-26 15:33:
In a new post to DZone.com today Mitchell Pronschinske responds to some comments that were made by Lukas Smith about working with interfaces in PHP and what he sees as an ideal "drop in" solution. The PHP community was reacting to Lukas Smith's "Interfacing the PHP world" for most of last weekend. [...] It's a pretty major propositon to start 'interfacing the PHP' world. Catch up on the conversation and let us know what you think. Mitchell summarizes Lukas' thoughts into three points - interfaces in separate repositories, PHP frameworks not adopting 5.3 yet and the customization of method names/naming conventions across frameworks and tools. Another response to Lukas came from Herman Radtke with Lukas following up his original post with "Why Bother?"
DZone.com: Debate - How to Interface the PHP World
In a new post to DZone.com today Mitchell Pronschinske responds to some comments that were made by Lukas Smith about working with interfaces in PHP and what he sees as an ideal "drop in" solution. The PHP community was reacting to Lukas Smith's "Interfacing the PHP world" for most of last weekend. [...] It's a pretty major propositon to start 'interfacing the PHP' world. Catch up on the conversation and let us know what you think. Mitchell summarizes Lukas' thoughts into three points - interfaces in separate repositories, PHP frameworks not adopting 5.3 yet and the customization of method names/naming conventions across frameworks and tools. Another response to Lukas came from Herman Radtke with Lukas following up his original post with "Why Bother?"
2011-10-25 20:39:
Justin Carmony has a new tutorial posted to his blog today about setting up Nginx and PHP-FPM on Ubuntu in a few easy steps (thanks to some package management). This is another wonderful setup that I've found myself using rather than the traditional Apache & mod_php setup. [...] Ngnix, unlike Apache, doesn't actually load PHP. Instead, it hands it off as a proxy to a "php handler" which acts like an Application Server. So nginx by itself won't serve PHP files, but just static files. He briefly introduces Nginx and PHP-FPM for those not familiar and points out that this combination is very fast, even without much configuration. The packages are installed with the aptitude installer and minimal changes are made to the php-fm and nginx configuration files (mostly to set up whatever your domain/virtual host is).
Justin Carmony's Blog: Setting Up Nginx & PHP-FPM on Ubuntu 10.04
Justin Carmony has a new tutorial posted to his blog today about setting up Nginx and PHP-FPM on Ubuntu in a few easy steps (thanks to some package management). This is another wonderful setup that I've found myself using rather than the traditional Apache & mod_php setup. [...] Ngnix, unlike Apache, doesn't actually load PHP. Instead, it hands it off as a proxy to a "php handler" which acts like an Application Server. So nginx by itself won't serve PHP files, but just static files. He briefly introduces Nginx and PHP-FPM for those not familiar and points out that this combination is very fast, even without much configuration. The packages are installed with the aptitude installer and minimal changes are made to the php-fm and nginx configuration files (mostly to set up whatever your domain/virtual host is).
2011-10-25 19:19:
Fabien Potencier of the Symfony project (framework) recently made a presentation at the Symfony Day conference and answered the question "what is Symfony2?" When I ask people what Symfony2 is for them, most of them say something along the lines of: Symfony2 is a full-stack web framework written in PHP. Some also add that this is an MVC framework. And some others add that this is a decoupled framework. This is all fine and correct. But my definition is a bit different. Let me tell you what it is and why I think it matters. Symfony2 is really about two different things. His "two things" are simple - first that Symfony2 is a "reusable set of standalone, decoupled, and cohesive PHP components that solve common web development problems" and second that the framework is, based on these components, a full-stack framework. He also answers a common question about the framework - is is really MVC? He explains that the framework is less about adhering to a design pattern and more about being useful as a HTTP framework (request and response). He finishes off the post with some thoughts on the framework's place in "the enterprise", innovation, reusing standard, well-tested tools and some reasons why to choose Symfony for your next project.
Fabien Potencier's Blog: What is Symfony2?
Fabien Potencier of the Symfony project (framework) recently made a presentation at the Symfony Day conference and answered the question "what is Symfony2?" When I ask people what Symfony2 is for them, most of them say something along the lines of: Symfony2 is a full-stack web framework written in PHP. Some also add that this is an MVC framework. And some others add that this is a decoupled framework. This is all fine and correct. But my definition is a bit different. Let me tell you what it is and why I think it matters. Symfony2 is really about two different things. His "two things" are simple - first that Symfony2 is a "reusable set of standalone, decoupled, and cohesive PHP components that solve common web development problems" and second that the framework is, based on these components, a full-stack framework. He also answers a common question about the framework - is is really MVC? He explains that the framework is less about adhering to a design pattern and more about being useful as a HTTP framework (request and response). He finishes off the post with some thoughts on the framework's place in "the enterprise", innovation, reusing standard, well-tested tools and some reasons why to choose Symfony for your next project.
2011-10-25 18:27:
On Script-Tutorials.com there's a new tutorial posted showing you how you can get better curves on your graphs with PHP and GD (the key is in the "CubicSplines" class, providing a few extra calculations to make "splines", a mathematical method for smoothing out values). Today I have new article for PHP. I will tell you about drawing graphs with GD. Plus - we will smooth our graph with curve lines using cubic splines interpolation method. You can read more about method at Wikipedia. All of the code is included in the post, ready for cop and pasting - the HTML, CSS plus the PHP to generate the graph, plot the points and apply the cubic splines values. You can check out a live demo of it in action or just download the code and get started on your own.
Script-Tutorials.com: Creating a Smooth Curve Graphs with PHP and GD
On Script-Tutorials.com there's a new tutorial posted showing you how you can get better curves on your graphs with PHP and GD (the key is in the "CubicSplines" class, providing a few extra calculations to make "splines", a mathematical method for smoothing out values). Today I have new article for PHP. I will tell you about drawing graphs with GD. Plus - we will smooth our graph with curve lines using cubic splines interpolation method. You can read more about method at Wikipedia. All of the code is included in the post, ready for cop and pasting - the HTML, CSS plus the PHP to generate the graph, plot the points and apply the cubic splines values. You can check out a live demo of it in action or just download the code and get started on your own.
2011-10-25 17:09:
On PHPMaster.com today they're posted the second part of their OAuth series showing you how to use the authentication mechanism to connect to Twitter's API. (Part one is here. Welcome back to Understanding OAuth - Tweeting from Scratch. This is Part 2 of the two-part series and picks up right where we left off in Part 1 with your returned Access Credentials. Since obtaining the credentials is the grueling part of the process, there's not much more left to do except posting a tweet on the user's behalf. Hopefully you'll find the final steps to be a lot easier to follow and more fun to implement. They show you how to store the credentials from Part 1 into your session for safe keeping and include a simple form you will use to send a tweet to Twitter. They choose to manually build the HTTP POST request, including the credential headers along with the payload (oauth_consumer_key, oauth_signature, oauth_token, etc).
PHPMaster.com: Understanding OAuth - Tweeting from Scratch, Part 2
On PHPMaster.com today they're posted the second part of their OAuth series showing you how to use the authentication mechanism to connect to Twitter's API. (Part one is here. Welcome back to Understanding OAuth - Tweeting from Scratch. This is Part 2 of the two-part series and picks up right where we left off in Part 1 with your returned Access Credentials. Since obtaining the credentials is the grueling part of the process, there's not much more left to do except posting a tweet on the user's behalf. Hopefully you'll find the final steps to be a lot easier to follow and more fun to implement. They show you how to store the credentials from Part 1 into your session for safe keeping and include a simple form you will use to send a tweet to Twitter. They choose to manually build the HTTP POST request, including the credential headers along with the payload (oauth_consumer_key, oauth_signature, oauth_token, etc).
2011-10-25 16:42:
Hasin Hayder has put together a list of cloud hosting providers that are already set and ready to go for PHP applications. His list highlights a few of the free ones. I will be focusing on some of these free cloud hosting options available out there. One thing to note before you proceed - these free cloud hosting options are very good to develop and test your applications (in dev+staging environment) and it may not be wise to deploy the production version of your application with any free plan (Except Amazon AWS's free tier, its production ready). He has four different services on his list, ranging anywhere from small to industrial strength, depending on your needs: Amazon's AWS PHPFog PHPCloud (from Zend) Heroku (traditionally Ruby, now supports PHP too)
Hasin Hayder's Blog: Developing PHP applications in the cloud with free cloud hosting providers
Hasin Hayder has put together a list of cloud hosting providers that are already set and ready to go for PHP applications. His list highlights a few of the free ones. I will be focusing on some of these free cloud hosting options available out there. One thing to note before you proceed - these free cloud hosting options are very good to develop and test your applications (in dev+staging environment) and it may not be wise to deploy the production version of your application with any free plan (Except Amazon AWS's free tier, its production ready). He has four different services on his list, ranging anywhere from small to industrial strength, depending on your needs: Amazon's AWS PHPFog PHPCloud (from Zend) Heroku (traditionally Ruby, now supports PHP too)
2011-10-25 15:33:
Lukas Smith has put together a recent post to his blog with some thoughts on standardization of interfaces in PHP applications to help improve code quality and interoperability. In my previous blog post I was brainstorming the possibility of collaboration between various frameworks to define a set of common interfaces. But I kind of failed to explain why this would be useful. Herman's "rebuttal" made this omission on my part quite clear. [...] That being said the open questions left in my previous blog might still prevent this idea to take off, even if I manage to convince the general community that the above mentioned negative effects are not such a significant concern. He talks first about some of the things he sees PHP as having done right (citing its popularity) and contrasts it to Java based on the standards they impose. He goes on to mention how interfaces, introduced early enough in the process, can help with the "best tool for the job" idea (with an example involving Symfony2, Zend Framework and Doctrine).
Lukas Smith's Blog: Why bother?
Lukas Smith has put together a recent post to his blog with some thoughts on standardization of interfaces in PHP applications to help improve code quality and interoperability. In my previous blog post I was brainstorming the possibility of collaboration between various frameworks to define a set of common interfaces. But I kind of failed to explain why this would be useful. Herman's "rebuttal" made this omission on my part quite clear. [...] That being said the open questions left in my previous blog might still prevent this idea to take off, even if I manage to convince the general community that the above mentioned negative effects are not such a significant concern. He talks first about some of the things he sees PHP as having done right (citing its popularity) and contrasts it to Java based on the standards they impose. He goes on to mention how interfaces, introduced early enough in the process, can help with the "best tool for the job" idea (with an example involving Symfony2, Zend Framework and Doctrine).
2011-10-25 14:04:
Latest PECL Releases: eio 0.1.0 eio 0.1.1 eio 0.2.0 cld 0.1.0 geoip 1.0.8 cld 0.2.0 timezonedb 2011.13
Community News: Latest PECL Releases for 10.25.2011
Latest PECL Releases: eio 0.1.0 eio 0.1.1 eio 0.2.0 cld 0.1.0 geoip 1.0.8 cld 0.2.0 timezonedb 2011.13
2011-10-25 04:52:
Maarten Balliauw has a new post to his blog with a guide to running mamcached on Windows Azure for PHP, a tool targeted towards PHP on Windows users to provide them with the ability to cache outside of their application. While Windows Azure offers a distributed caching layer under the form of the Windows Azure Caching, that components currently lacks support for non-.NET technologies. I've heard there's work being done there, but that's not very interesting if you are building your app today. This blog post will show you how to modify a Windows Azure deployment to run and use Memcached in the easiest possible manner. Note: this post focuses on PHP but can also be used to setup Memcached on Windows Azure for NodeJS, Java, Ruby, Python... He provides a phar-based scaffolding you can use to set up the instance and describes two ways of accomplishing it - the "short way" of relying on the scaffolding or the "long way" describing what the scaffolder does behind the scenes (complete with code). For this, you can also download the source and look through it.
Maarten Balliauw's Blog: Running Memcached on Windows Azure for PHP
Maarten Balliauw has a new post to his blog with a guide to running mamcached on Windows Azure for PHP, a tool targeted towards PHP on Windows users to provide them with the ability to cache outside of their application. While Windows Azure offers a distributed caching layer under the form of the Windows Azure Caching, that components currently lacks support for non-.NET technologies. I've heard there's work being done there, but that's not very interesting if you are building your app today. This blog post will show you how to modify a Windows Azure deployment to run and use Memcached in the easiest possible manner. Note: this post focuses on PHP but can also be used to setup Memcached on Windows Azure for NodeJS, Java, Ruby, Python... He provides a phar-based scaffolding you can use to set up the instance and describes two ways of accomplishing it - the "short way" of relying on the scaffolding or the "long way" describing what the scaffolder does behind the scenes (complete with code). For this, you can also download the source and look through it.
2011-10-25 04:07:
For those that will be in the New York City area tomorrow night (10/25), Daniel Krook has something you should consider attending - the New York PHP User Group is having a meeting with a talk on MongoDB (and a ZendCon Recap). PHP on IBM System i consultant
User Group: New York PHP (Oct 25th @ 6:30pm) - MongoDb & ZendCon
For those that will be in the New York City area tomorrow night (10/25), Daniel Krook has something you should consider attending - the New York PHP User Group is having a meeting with a talk on MongoDB (and a ZendCon Recap). PHP on IBM System i consultant
2011-10-25 03:08:
In a new tutorial from PHPMaster.com Jason Pasnikowski takes a look at sending emails with PHP - an introduction to what the language offers and how it can be used to send an HTML version. In most cases your installation of PHP will be capable of sending emails. If you are using a shared host, or if you installed PHP using a package management system like apt-get, more than likely you're all set. You'll really only need to worry about extra configuration if you're compiling PHP from source or if you're running it on Windows. In either case, there are plenty of resources available online to help you out. Because that's all beyond the scope of this article, I'll assume you're set. If not, Google will be your friend. He starts with a simple example using the mail function but quickly moves on to sending a multi-part email with an attached zip file and HTML content. He includes the all code you'll need and explains each part in detail so you'll know exactly what's going on.
PHPMaster.com: Sending Emails with PHP
In a new tutorial from PHPMaster.com Jason Pasnikowski takes a look at sending emails with PHP - an introduction to what the language offers and how it can be used to send an HTML version. In most cases your installation of PHP will be capable of sending emails. If you are using a shared host, or if you installed PHP using a package management system like apt-get, more than likely you're all set. You'll really only need to worry about extra configuration if you're compiling PHP from source or if you're running it on Windows. In either case, there are plenty of resources available online to help you out. Because that's all beyond the scope of this article, I'll assume you're set. If not, Google will be your friend. He starts with a simple example using the mail function but quickly moves on to sending a multi-part email with an attached zip file and HTML content. He includes the all code you'll need and explains each part in detail so you'll know exactly what's going on.
2011-10-24 16:24:
As is mentioned in this new post to DZone.com, one of the features of the upcoming PHP 5.4 release, including things like traits and array dereferencing support, will also have an interesting new feature - a built-in simple web server. Yet another new feature to look forward to in PHP 5.4.0 - the CLI SAPI will now provide a built-in web server which is geared toward developmental purposes. It shouldn't be used in production right now. The PHP manual has been updated with the latest on this upcoming feature: URI requests are served from the current working directory where PHP was started, unless the -t option is used to specify an explicit document root. [...] If a PHP file is given on the command line when the web server is started it is treated as a "router" script for the web server. The script is run at the start of each HTTP request. If this script returns FALSE, then the requested resource is returned as-is. Otherwise the script's output is returned to the browser. The PHP 5.4.x series is still in beta as of the time of this post - you can download the beta1 on the downloads section of the PHP site (or the Windows binaries).
DZone.com: PHP 5.4 Will Have a Built-in Web Server
As is mentioned in this new post to DZone.com, one of the features of the upcoming PHP 5.4 release, including things like traits and array dereferencing support, will also have an interesting new feature - a built-in simple web server. Yet another new feature to look forward to in PHP 5.4.0 - the CLI SAPI will now provide a built-in web server which is geared toward developmental purposes. It shouldn't be used in production right now. The PHP manual has been updated with the latest on this upcoming feature: URI requests are served from the current working directory where PHP was started, unless the -t option is used to specify an explicit document root. [...] If a PHP file is given on the command line when the web server is started it is treated as a "router" script for the web server. The script is run at the start of each HTTP request. If this script returns FALSE, then the requested resource is returned as-is. Otherwise the script's output is returned to the browser. The PHP 5.4.x series is still in beta as of the time of this post - you can download the beta1 on the downloads section of the PHP site (or the Windows binaries).
2011-10-24 15:16:
Ken Guest has a new post today talking about a PEAR package he's been developing, Services_Openstreetmap, to interact with the OpenStreetMap service to make it simpler to work with OSM data, adding new locations and working with users. So over the last while, I've been working on a PHP package imaginatively named Services_Openstreetmap, for interacting with the openstreetmap API. I initially needed it so I could search for certain POIs and tabulate the results; it's now also capable of adding data to the openstreetmap database - nodes and other elements can be created, updated and so on. It will even access the details of the user that is being used to modify that data, which is one difference between it and the other single purpose OSM frameworks. He's submitted it to PEAR for official inclusion. Until then, you can download the package from github. The OpenStreetMap project is a community-driven mapping tool that allows users to provide new map information or make updates in an effort to keep things more up to date.
Ken Guest's Blog: A new Openstreetmap API framework for PHP
Ken Guest has a new post today talking about a PEAR package he's been developing, Services_Openstreetmap, to interact with the OpenStreetMap service to make it simpler to work with OSM data, adding new locations and working with users. So over the last while, I've been working on a PHP package imaginatively named Services_Openstreetmap, for interacting with the openstreetmap API. I initially needed it so I could search for certain POIs and tabulate the results; it's now also capable of adding data to the openstreetmap database - nodes and other elements can be created, updated and so on. It will even access the details of the user that is being used to modify that data, which is one difference between it and the other single purpose OSM frameworks. He's submitted it to PEAR for official inclusion. Until then, you can download the package from github. The OpenStreetMap project is a community-driven mapping tool that allows users to provide new map information or make updates in an effort to keep things more up to date.
2011-10-24 14:00:
Latest PEAR Releases: Services_Twitter_Uploader 0.1.0 Net_URL2 1.0.0 Net_URL2 2.0.0 HTTP_Request2 2.0.0
Community News: Latest PEAR Releases for 10.24.2011
Latest PEAR Releases: Services_Twitter_Uploader 0.1.0 Net_URL2 1.0.0 Net_URL2 2.0.0 HTTP_Request2 2.0.0
2011-10-21 18:03:
The Bakery (a CakePHP site) has announced the release of CakePHP 2.0, a major shift in the framework with some very large changes to bring it up to the level of other full-stack frameworks currently offered for PHP. The CakePHP core team is very exited to announce a major jump in the version numbering. CakePHP 2.0 stable is out! we have put endless hours into this release and great ideas have made it into the the framework for this version. [...] The overall CakePHP ecosystem has also been improved. [...] A huge thanks to all involved in terms of both contributions through commits, tickets, documentation edits, and otherwise contribute to the framework. Without you there would be no CakePHP. Some huge changes have happened in this release including: Dropping PHP4 support Use of more native PHP functions PSR-0 compliance Object injection for libraries/components/helpers/etc Console tools completely rebuilt A move to PHPUnit tests (away from SimpleUnit) HTML support in form helpers Lazy-loading on just about everything making the overall experience faster Several new plugins like: DebugKit, Datasources, MongoDb, Migrations and AclExtras They've created a few resources to help you get started with this new version including a new version of the book, a screencast and a migration guide.
Community News: CakePHP 2.0 Released (with some Major Changes)
The Bakery (a CakePHP site) has announced the release of CakePHP 2.0, a major shift in the framework with some very large changes to bring it up to the level of other full-stack frameworks currently offered for PHP. The CakePHP core team is very exited to announce a major jump in the version numbering. CakePHP 2.0 stable is out! we have put endless hours into this release and great ideas have made it into the the framework for this version. [...] The overall CakePHP ecosystem has also been improved. [...] A huge thanks to all involved in terms of both contributions through commits, tickets, documentation edits, and otherwise contribute to the framework. Without you there would be no CakePHP. Some huge changes have happened in this release including: Dropping PHP4 support Use of more native PHP functions PSR-0 compliance Object injection for libraries/components/helpers/etc Console tools completely rebuilt A move to PHPUnit tests (away from SimpleUnit) HTML support in form helpers Lazy-loading on just about everything making the overall experience faster Several new plugins like: DebugKit, Datasources, MongoDb, Migrations and AclExtras They've created a few resources to help you get started with this new version including a new version of the book, a screencast and a migration guide.
2011-10-21 17:29:
Adam Peterson has posted an interesting idea for those out there running an internal staging server they want to constantly keep up to date with the main line of code (without manual intervention) - a git pull web frontend combined with git post-receive hooks. This [move from svn to git] left a bit of a gap in my process where I could no longer test on a remote server without updating it manually by S/FTP or opening terminal and manually calling a git pull. Open terminal and manually git pull it did break up the work flow a bit so using the Dingo framework I created a very simple Git helper and gave it its own URL something like git/pull. He added a post-receive hook to his git server that calls this "git/pull" URL on the staging server and updates the code on the server. This provides an easy asynchronous way to update things on another server. Note, though, that this should never be done on a publicly accessible server - it's a pretty large security hole (or at the very least made secure somehow). He used Dingo to create his interface, but something like the Slim micro-framework could have worked just as well. You can view his code on github.
Adam Patterson's Blog: DIY simple staging server.
Adam Peterson has posted an interesting idea for those out there running an internal staging server they want to constantly keep up to date with the main line of code (without manual intervention) - a git pull web frontend combined with git post-receive hooks. This [move from svn to git] left a bit of a gap in my process where I could no longer test on a remote server without updating it manually by S/FTP or opening terminal and manually calling a git pull. Open terminal and manually git pull it did break up the work flow a bit so using the Dingo framework I created a very simple Git helper and gave it its own URL something like git/pull. He added a post-receive hook to his git server that calls this "git/pull" URL on the staging server and updates the code on the server. This provides an easy asynchronous way to update things on another server. Note, though, that this should never be done on a publicly accessible server - it's a pretty large security hole (or at the very least made secure somehow). He used Dingo to create his interface, but something like the Slim micro-framework could have worked just as well. You can view his code on github.
2011-10-21 16:58:
As is mentioned in this new post to the SitePoint blogs, a new book has been released (by SitePoint press, naturally) about "writing cutting-edge PHP code" by a few well known authors in the PHP community - Lorna Mitchell, Davey Shafik and Matthew Turland. Savvy PHP web developers can now keep ahead of the game and ensure that their PHP code is safe, secure, and well-structured for the future with the latest release from SitePoint: "PHP Master: Write Cutting-edge Code" by Lorna Mitchell, Davey Shafik, and Matthew Turland. The book covers a wide range of topics (somewhat replacing SitePoint's usual "anthology" type of book) including: An introduction to OOP Working with databases Creating and working with APIs Design patterns Security Automated testing As part of a special offer, you can pick up your print+ebook bundle for the price of just the book, about $40 USD. If you'd like a sample before purchasing, they've posted three sample chapters.
SitePoint Blog: Book Release - "PHP Master: Write Cutting-Edge PHP Code"
As is mentioned in this new post to the SitePoint blogs, a new book has been released (by SitePoint press, naturally) about "writing cutting-edge PHP code" by a few well known authors in the PHP community - Lorna Mitchell, Davey Shafik and Matthew Turland. Savvy PHP web developers can now keep ahead of the game and ensure that their PHP code is safe, secure, and well-structured for the future with the latest release from SitePoint: "PHP Master: Write Cutting-edge Code" by Lorna Mitchell, Davey Shafik, and Matthew Turland. The book covers a wide range of topics (somewhat replacing SitePoint's usual "anthology" type of book) including: An introduction to OOP Working with databases Creating and working with APIs Design patterns Security Automated testing As part of a special offer, you can pick up your print+ebook bundle for the price of just the book, about $40 USD. If you'd like a sample before purchasing, they've posted three sample chapters.
2011-10-21 15:32:
In a recent post to his blog Brian Swan takes a look at working with sessions in PHP and, specifically, how to save them to Azure along with all of their data. In my last post, I looked at the session handling functionality that is built into the Windows Azure SDK for PHP, which uses Azure Tables or Azure Blobs for storing session data. As I wrote that post, I wondered how easy it would be to use SQL Azure to store session data, especially since using a database to store session data is a common and familiar practice when building distributed PHP applications. As I found out, using SQL Azure to store session data was relatively easy (as I'll show in this post), but I did run into a couple of small hurdles that might be worth taking note of. He uses PHP's own session_set_save_handler to point to his custom Azure handling class with the needed methods (like write, close and destroy). He breaks it out into three simple steps, some with a bit of code attached: Create the database, table, and stored procedure Add the SqlAzureSessionHandler class to your project Instantiate SqlAzureSessionHandler before calling session functions as you normally would The code for the Azure handling class can be downloaded here.
Brian Swan's Blog: Using SQL Azure to Store PHP Session Data
In a recent post to his blog Brian Swan takes a look at working with sessions in PHP and, specifically, how to save them to Azure along with all of their data. In my last post, I looked at the session handling functionality that is built into the Windows Azure SDK for PHP, which uses Azure Tables or Azure Blobs for storing session data. As I wrote that post, I wondered how easy it would be to use SQL Azure to store session data, especially since using a database to store session data is a common and familiar practice when building distributed PHP applications. As I found out, using SQL Azure to store session data was relatively easy (as I'll show in this post), but I did run into a couple of small hurdles that might be worth taking note of. He uses PHP's own session_set_save_handler to point to his custom Azure handling class with the needed methods (like write, close and destroy). He breaks it out into three simple steps, some with a bit of code attached: Create the database, table, and stored procedure Add the SqlAzureSessionHandler class to your project Instantiate SqlAzureSessionHandler before calling session functions as you normally would The code for the Azure handling class can be downloaded here.


ABOUT ME