Pragmatism in the real world

Setting up PHP & MySQL on OS X 10.8 Mountain Lion

There is a Serbo-Croatian translation of this article kindly provided by Anja Skrba: Podešavanje PHP i MySQL na OS X 10.8 With OS X 10.8, Apple continues to ship PHP 5.3 with Xdebug, PEAR, GD and PDO_MYSQL. This is how to set it up from a clean install of 10.8. /usr/local Ensure that the following directories exist: sudo mkdir /usr/local/include sudo mkdir /usr/local/bin sudo mkdir /usr/local/lib sudo mkdir -p /usr/local/man/man1 MySQL Download the "x86, 64bit"… continue reading.

ZF1.12 is released

I'm extremely happy to note that Zend Framework 1.12 has been released and is available here. The key changes are: ZF2's StandardAutoloader and ClassMapAutoloader have been back ported to `Zend_Loader`. ZF2's EventManager has been back ported to `Zend_EventManager` New `Zend_Http_UserAgent_Features_Adapter_Browscap` component New `Zend_Mobile_Push` component, contributed by Mike Willibanks New `Zend_Gdata_Analytics` component, contributed by Daniel hartmann `Zend_Http_UserAgent_Features_Adapter_Wurfl` has been removed due to WURFL licensing changes Many many bug fixes! See the changelog Getting ZF1.12 out of… continue reading.

Setting up required fields that can be empty with Zend\InputFilter

When you create an input filter entry that has the required element set to true, then by default, the field is set up so that it must have a value in it. If you want the field to be required, but also an empty value is okay, then add the allow_empty element to your definition: $inputFilter->add(array( 'name' => 'notes', 'required' => true, 'allow_empty' => true, )); In this definition, we have a 'notes' element that… continue reading.

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.