Archive for the ‘PHP’ Category
Sunday, September 25th, 2011
I’m currently working with a legacy PHP CMS and do-it-all system which is heavily reliant on singletons. Instead of relying on static methods and direct invocation we store object instances in a global array, these instances are then retrieved through the use of a call looking like this: singleton(’ClassName’).... Read More
Tags: eclipse, PHP, productivity
Posted in Dev Environment, PHP | No Comments »
Sunday, September 25th, 2011
Yesterday I had to loop through every directory in a whole PHP project and go through all the PHP files in order to get at their contents, the goal was to get information from each file in order to create an array looking like this for each class method:... Read More
Tags: files and directories, PHP, tokenize
Posted in PHP | No Comments »
Wednesday, September 14th, 2011
I just realized I needed to replicate some data from one database to another, but only certain tables.... Read More
Tags: Database, mysql, PHP, replication
Posted in Database, PHP | No Comments »
Saturday, July 9th, 2011
Color theming in Geany is quite a no-brainer if you know how to go about it.... Read More
Tags: color theme, geany, zenburn
Posted in PHP | No Comments »
Wednesday, June 22nd, 2011
Create a file called “2 clés.html”, zip it up and, name the file html.zip then unzip it with the following command: unzip html.zip -d /tmp, check the /tmp folder, what do you see?... Read More
Tags: PHP, unzip, utf8
Posted in PHP | No Comments »
Friday, June 17th, 2011
If you’ve read the article about my email server setup you quickly realize that adding a new email account is quite onerous, a combination of adding records to tables in a MySQL database and creating folders on the harddrive. This can easily be automated with for instance PHP and I’ll show you how below.... Read More
Tags: email, Linux, PHP, postfix, server
Posted in PHP | No Comments »
Monday, February 21st, 2011
The following is required to get for instance Swedish to work:... Read More
Tags: PHP, setlocale, swedish
Posted in Misc, PHP | No Comments »
Tuesday, January 18th, 2011
I’ve just run into the need to be able to get the http cookies of a response to a request sent from PHP and accepted in PHP. Normally cookies can be accessed through the $_COOKIE super global but since no client/browser is involved that won’t be possible in this case. The below is an example of machine to machine communication.... Read More
Tags: PHP, zend framework, Zend Http Client, Zend Http Cookie, Zend Http CookieJar, zf
Posted in PHP, Zend Framework | No Comments »
Friday, December 31st, 2010
I’m currently working on a project where I use MongoDB and Clojure to create an API only type of service. Other sites of ours are connecting to this service, these sites are all made with PHP at the moment.... Read More
Tags: Clojure, congomongo, json, mongodb, PHP
Posted in Clojure, PHP | No Comments »
Monday, December 27th, 2010
When you want a random password you might think that for instance uniquid() is a good fit. It’s not though as it will only return hex characters.... Read More
Tags: password, PHP, random
Posted in PHP | No Comments »