Archive for 'PHP'

BetterXML

Everyone hates the way that PHP’s SimpleXML object handles variables. We find ourselves constantly checking if the string we’ve been given back contains numeric or boolean values. Well… here’s a quick fix. <?php   /** * A decorator for SimpleXML to add 2 important things: * 1) The "hasChildren() method". * 2) The "asVar()" method [...]

YAML Reference Card

Our projects contain a lot of configuration. So much, in fact, that our parsers have been struggling with the size of our files and causing sites to time out :s. Therefore, the exemplar team have created a reference YAML. We write some default configurations in our reference YAML and then our main configuration can use [...]

Changing the PHP Session Lifetime

As anyone who has attempted to use the default PHP session handler has probably noticed, sessions naturally die after a period of inactivity. What you’ll probably want in most situations is for the session not to die (or ‘expire’) until the user closes their browser. Unfortunately, there is no server-side way of knowing for certain [...]