Monthly Archives: February 2009
“/usr/bin/ld: cannot find -lltdl” Error when compiling PHP with mcrypt
When compiling PHP with mcrypt I got the error “/usr/bin/ld: cannot find -lltdl”. I found the solution here: http://www.linuxquestions.org/questions/linux-server-73/error-compiling-php-usrbinld-cannot-find-lltdl-656764/ Following knudfl’s advice I installed “The libtool-ltdl package contains the GNU Libtool Dynamic Module Loader, a library that provides a consistent, … Continue reading
Overridable view scripts in Zend Framework
I needed to have overridable view scripts in zend framework, that is if there is a view script for the current action + controller use that, otherwise render the view script with the “no controller” option ( render the view … Continue reading
Data Shuffler – Maps relational data to an object oriented paradigm
Data Shuffler is an opensource PHP implementation of the datamapper pattern. Release 0.1 now available http://datashuffler.org/
Type hinting exceptions / errors with unit testing ( simpletest )
For some reason PHP thinks type hinting should result in fatal errors that aren’t catchable by user code. I finally reached my breaking point and decided I’m hacking the damn thing, whether I have to extend PHP itself or not. … Continue reading
Are constructors evil? Thoughts on dependency injection
Gilad Bracha blogged about how “Constructors [are] considered harmful” however I tend to disagree. Citing Martin Fowler’s article on Dependency Injection / Inversion of control “Another advantage with constructor initialization is that it allows you to clearly hide any fields … Continue reading
Firefox dynamic javascript fields not posting
Thanks to Tom for this, who complains “other developers never seemed to mention the problem in their blogs”, so here ya’ go. I ran into an issue I sank a little time into. My Jquery generated forms weren’t working in … Continue reading
Subclassing Zend_View / namespaced view helpers
So I needed namespaced view helpers ( need $this->foo() to act conditionally based on the module, not using a switch statement in a view helper but rather by using polymorphic helpers ). The easiest solution was to subclass the view. … Continue reading
Case insensitive URLs / module names with Zend Framework routing
class Ne8_Controller_Request extends Zend_Controller_Request_Http { /** * Retrieve the module name * * @return string */ public function getModuleName() { if (null === $this->_module) { $this->_module = $this->getParam($this->getModuleKey()); } return ucfirst( strtolower( $this->_module ) ); } } Then in your … Continue reading