Pragmatism in the real world

Missing fields in $_POST

I recently updated to OS X 10.8 (Mountain Lion) which has PHP 5.3.13 installed by default. When testing something today, I discovered that a very very large form wasn't submitting all fields. It seemed that $_POST was being truncated. After a little bit of searching around I discovered the max_input_vars php.ini setting. This is new since PHP 5.3.9 and defaults to 1000. As OS X also comes with suhosin installed, if you want to increase… continue reading.

Evan Coury: Creating a simple view helper in Zend Framework 2

Evan Coury has posted Creating a simple view helper in Zend Framework 2 This post will show you how to create a simple view helper in Zend Framework 2. In this example, our view helper will simply return the full, absolute URL of the current page/request. He goes on to show the code required, including how to inject the Request object into the view helper.

Adam Lundrigan: Quick-and-dirty ZF2: ZendNavigation

Adam Lundrigan has posted a short article on how to use ZendNavigation in Zend Framework 2. He goes through the steps required: Add Service Manager Factory Configure Sitemap Using the View Helpers Well worth a read if you want to use ZendNavigation in your app.

Updated ZF2 tutorial for Beta 5

Zend Framework 2, Beta 5 has been released! This is an important release as we think we're at the point where the API has stabilised and expect only small BC breaks between Beta5 and the stable release. We also have two new components: ZendI18n for localisation and translation ZendEscaper for context-specific escaping that targets HTML, HTML attributes, URLs, CSS, and JavaScript. Lots of other changes happened too, so I recommend reading the announcement for all… continue reading.

Evan Coury: Using ZendDb’s TableGateway and HydratingResultSet to return rows as custom entity/model objects

Evant Coury has posted Using ZendDb’s TableGateway and HydratingResultSet to return rows as custom entity/model objects The new ZendDb in Zend Framework 2 has a handy feature which allows you to specify your own entity/model class to represent rows in your database tables. This means you can tell ZendDb to return each row as a populated instance of your own custom objects. He then goes through a simple example showing how to save and load… continue reading.

Jurian Sluiman: Use 3rd party modules in Zend Framework 2

Jurian Sluiman has posted Use 3rd party modules in Zend Framework 2 – Jurian Sluiman Because using a 3rd party MVC module does not mean you are enforced to follow their routing scheme, use their view scripts or use the predefined forms, I will explain how you can modify those options to your needs. We hope that there will be a healthy eco-system of third-party modules for ZF2. Jurian's post shows you how to modify… continue reading.

Gittyup – Easily keep master in sync with upstream

If, like me, you use git and have an upstream remote which is not your origin, then I highly recommend that you use Evan Coury's gittyup script. This is a very simple script that does the following: 1. Verify that you are in a valid Git repo. 2. Remember which branch you are on. 3. Stash any uncommitted changes you have. 4. Checkout master. 5. Fetch all remotes. (nice to track other remotes) 6. Merge… continue reading.

Kyle Spraggs: How does configuration work in ZF2?

Kyle Spraggs has posted How does configuration work in ZF2? As ZF2 increases the beta count and draws nearer to RC I’ve noticed more questions popping up in IRC regarding configuration. Questions like: “How do I setup XXX?” “Where do I add module options?” So, I decided to write up a quick blog explaining how configuration works in ZF2. By default, there are three types of configurations. He then goes on to explain what config/application.config.php,… continue reading.

Padraic Brady: Automatic Output Escaping In PHP And The Real Future Of Preventing Cross-Site Scripting (XSS)

Pádraic Brady has posted Automatic Output Escaping In PHP And The Real Future Of Preventing Cross-Site Scripting (XSS) In the game of mitigating against the risks of XSS, how you escape is not as important as knowing why you are escaping. That second point, understanding why you escape data on output, is unfortunately commonly misunderstood. Yet, without that basic understanding – your choice of how to escape is quite possibly incorrect and, worse, it allows… continue reading.