Browsing tag

php

The allure of static proxies

Development

Several weeks ago I started playing with Laravel. Primarily because several colleagues are using it, and have suggested that I take a look at it. During my time reviewing how to build a view template I came across references to Html, Form, View and other static calls. Initially I was not impressed due to the … Continued

pure-authd external script failing

DevOps

I have a PHP script handling authentication for pure-authd, and the problem is that it fails. After a reboot it is still failing. If I log in, restart it manually and monitor the log files, it works. As soon as I log out it fails! I’ve come to the conclusion that pure-authd doesn’t properly daemonize, … Continued

SPL FileObject & LimitIterator

Development

Over that last couple of weeks I’ve come to use the SPL far more than I have in the past. The SplFileObject for reading CSV files is far more convenient than the fgetcsv() function, and associated code needed for a CSV file. Using the LimitIterator allowed me to easily bypass the first row of the … Continued

BlockList.de IP lists with CIDR notation

DevOps

Several weeks ago one of the servers I manage ended up with a lot of comment spam. After several hours of searching through the logs and correlating the IP’s, I found out that a majority of the hosts were listed in the BlockList.de’s bots.txt file. I didn’t want to import ALL the IP’s on the … Continued

ZfRest — RESTful-ness for Zend Framework 1

Development

For both a client and my work we are working on creating a RESTful API. The problem is that all of the current solutions for Zend Framework are either one off (Resauce, ZfApiVersioning) or otherwise do not play well with a pre-built Zend Framework 1 application. The solution I was looking needed the following handle … Continued

PHPUnit and certainty of test cases with random data

dc

Recently I was testing a function that generated slugs for an application. In order to make the slugs unique we would append the microtime to the slug if needed. After updating my data provider to account for using the microtime version of the slug I was receiving intermittent success for the test cases. Using microtime … Continued

Redux: PHP5 cronjob in Debian packages

dc

After running into “session could not be started because it was already started with session_start() or session.auto_start” on a project, I realized that removing the cronjob is not the only thing that needs to happen to let PHP manage it’s own sessions. chmod www-data:www-data /var/lib/php5 update /etc/php5/apache2/php5.ini and set session.gc_probability = 1 I’m assuming that … Continued