Thoughts on website ideas, PHP and other tech topics, plus going car-free
Categories: PHP | Add a Comment

I’ve been writing a PHP course for beginners over for the past couple of weeks, and think it is now good enough to share. It’s a work in progress, but what I have at present is useful already, and I plan to add to it. I’d previously looked around the existing resources on the web, […]

Categories: PHP, Symfony | 1 Comment

I’m still using symfony 1.3 for pet projects, even though I should find the time (maybe first quarter of 2014!) to look at Symfony 2. However as can happen with any framework, today I came across a head-scratcher that took more coffee than expected to fix. Today’s hiccup was with the Propel 1.6 plugin – […]

Categories: PHP, Technical | 2 Comments

I recently fixed a WordPress site that was having trouble sending mail from the popular contact form system, Contact Form 7. The site was running on a Fasthosts web server. Incidentally, I don’t recommend this hosting service; from what I can tell, they disable all the system() PHP calls, making it impossible to run backup […]

Categories: PHP, XML | Add a Comment

Today I had a requirement to match an XML path where a part of the path must have a specified attribute that does not have a specified suffix. Additionally, the solution must be in SimpleXML, and so cannot use the XPath function fn:ends-with, since that is part of XPath 2.0 and hence isn’t supported. Phew! […]

Categories: PHP, Symfony | Add a Comment

I was recently in the process of moving some sites to a new server, and found that a particular format of URI was not working on the new server: http://myserver/frontend_dev.php/criteria/analyse Normally in a symfony application, the default .htaccess file ensures that anything after the controller (i.e. frontend_dev.php) is simply passed to that controller, rather than […]

Categories: PHP | Add a Comment

Yesterday I was debugging a legacy PHP app, and came across this item of code. This example is substantially condensed for brevity: OK, here’s the output: On first examination, this doesn’t look right at all; after all, iterating over an array with foreach should not modify the array. I discovered, looking at the output of […]

Categories: PHP | Add a Comment

I am currently working on a project proposal that will allow the user to design and build their own Propel database, and to connect it to a database instance. I’d originally intended to use the propel-gen script plus a re-written file on every call, but I decided that this wasn’t very elegant, and that […]

Categories: PHP | 1 Comment

I’m quite a fan of Propel, having used it with Symfony since the 1.2.x days. That version was relatively slow, as it used its own data access layer; it wasn’t until 1.3 that it switched to the much faster PDO approach. Nevertheless, the ability to create objects and persist them, to look up items without […]

Categories: PHP, XML | Add a Comment

I am currently working on a PHP class to manipulate SVG documents, using PHP’s SimpleXML to handle the XML structure. I found myself needing to reset the namespaced attribute “xlink:href” in the following XML block: Finding the necessary info proved somewhat difficult, so I’m recording it here for posterity. Firstly, note that obtaining namespaced attributes […]

Categories: Symfony | Add a Comment

I’ve been setting aside some time to jump all the way from symfony 1.0, which I still use in my full-time work, to 1.4. I’m in particular interested in the Forms system, which links form element attributes (such as an integer or string length validator) to database columns automatically. Since I’m fond of advising new […]

Categories: Symfony | 5 Comments

I work on a large web application using symfony 1.0, and we add new subsystems frequently, each having its own set of authorisation/security requirements. When we started writing the application, it was clear that we needed a unified permissions system that would be both simple to use, and highly flexible. I’ve talked about our solution […]

Categories: Symfony | 3 Comments

A popular forum question from symfony beginners is how to install the software on a server that hosts a number of symfony projects. The original core team advice, dating back to before the 1.0 version, was to install via PEAR. However, anyone who has fought with PEAR in a Microsoft corporate network environment knows that […]