Tag Archives: php

Super Lazy Provisioning with Vagrant

It has been almost a year since I posted anything even remotely related to my php series. I guess I should have suspected that SITS would be the death-kneel for the project. It seemed like a good, small sized project … Continue reading

Posted in sysadmin notes | Tagged , | 3 Comments

PHP Like a Pro: Part 7 (First Steps with Silex)

As I mentioned in the previous installment, I want to use Sixex four our new issue management tools. Why? Because it is easy to work with, lean, powerful and very testable. My composer.json file at the moment looks like this: … Continue reading

Posted in programming | Tagged , | 3 Comments

PHP Like a Pro: Part 6 (A New Project)

Having created a really simple Pastebin, how about we embark on something more ambitious. An actual web app with all the usual trappings: user accounts, session management, email notifications and etc. On the other hand, I shouldn’t try to build … Continue reading

Posted in programming | Tagged , | 3 Comments

PHP Like a Pro: Part 5

In Part 4, I mentioned the Codeception test framework, but didn’t really get to use it because their page temporarily went down and I didn’t feel like trying to hunt down the documentation from third party sources. That outage seemed … Continue reading

Posted in programming | Tagged , | 5 Comments

PHP Like a Pro: Part 4

In the previous installment we built a semi-working skeleton of our application. It is time to finally get down to the business and make it talk to the database and actually save and retrieve out content. Normally this would be … Continue reading

Posted in programming | Tagged , | 3 Comments

PHP Like a Pro: Part 3

Welcome to the third installment of PHP-ing like a productive person. It’s code writing time. Here is how I like to start: touch index.php Yes, I’m a toucher. Sue me! The Front Controller The index file seems like a good … Continue reading

Posted in programming | Tagged , | 2 Comments

PHP Like a Pro: Part 2

In part one of this series I imparted some serious knowledge and discussed a lot of theoretical bullshit. Not all of it went over well, and not all of it was PHP specific. A lot of the stuff we talked … Continue reading

Posted in programming | Tagged , | 4 Comments

PHP Like a Pro: Part 1

PHP gets a lot of flack for being a shitty language. This reputation is unfortunately well deserved. It is an ugly, quirky, idiosyncratic mess. But at the same time, PHP remains one of the most popular web programming languages out … Continue reading

Posted in programming | Tagged , | 6 Comments

Refactoring PHP

How do you tackle big refactoring projects for your chosen language, framework and platform? I’ve been sort of struggling with a very old, twisted and convoluted PHP mess as of lately, and I’m finding that there are just not that … Continue reading

Posted in programming | Tagged | 5 Comments

Writing a Minimalistic MVC Framework in PHP

This is an outcome of a conversation I had recently. Apparently saying that MVC is a fairly simple concept is some sort of blasphemy. But it is. You really don’t need to use the almighty RAILS or a rails like … Continue reading

Posted in programming | Tagged , | 23 Comments

PHP: File Download Script – Straming Binary Data to the Browser

I don’t think I have posted this snipped of code here yet. It is old as hell, but I use it all over the place lately so I figured I just post it here for future reference. The script below … Continue reading

Posted in programming | Tagged | 5 Comments

WIMP or WAMP?

For the past few years I have been running some software on a WIMP stack. They have been working quite well. I never had any issues with the technology stack itself. Or rather the only issues I had at times … Continue reading

Posted in technology | Tagged | 8 Comments

Design by Contract in PHP with Assertions

Recently I wrote about meta programming in php because my recent project involves quite a bit of it. I will probably write about it at some other point but it’s still in sort of early development stage. However while these … Continue reading

Posted in programming | Tagged | 9 Comments

Metaprogramming in PHP

Not so long ago I wrote about few meta programming tricks in Javascript. These are really powerful programming techniques that let you create elegant frameworks with generic code that adapts to your needs at runtime. But Javascript is not the … Continue reading

Posted in programming | Tagged | Leave a comment

URL’s In Printed Media

I was reading an article in a magazine last week and while I don’t exactly recall the magazine or the topic right now I distinctly remember mild annoyance at the editor’s decision to put list of URL’s at the end … Continue reading

Posted in programming | Tagged | 5 Comments

Generate Outlook Calendar Events with PHP and iCalendar

The internal web application at my company tends to send out a lot of email notifications. Some of them are reminders about various deadlines. Recently I got a feature request to allow people to add these reminders as events to … Continue reading

Posted in programming | Tagged | 36 Comments

Sending Emails With Attachments via PHP

If you ever played around with the native PHP mail function, you will probably know that it’s functionality is very basic. Plain text emails work great, but if you want to do HTML email, you need to figure out what … Continue reading

Posted in programming | Tagged | 3 Comments

Word Cloud in PHP

Word clouds (or tag clouds if you will) are one of the interesting methods of visualizing textual data that got popular recently with the emergence of tagging, ad success folksonomy sites such as Flickr, del.ico.us and etc. One of the … Continue reading

Posted in programming | Tagged , | 6 Comments

Writing Your First WordPress Plugin

I never wrote a wordpress plugin before, so when I set out to learn how they work, I was surprised to see how easy it is to create one. One would think that there would be lot’s of setup and … Continue reading

Posted in programming | Tagged , , | 4 Comments

PHP: Export Query Results to a CSV File

Printing out nicely formated tables in HTML is good, but the downside is that sorting and aggregation options can be sometimes limited. If you didn’t write the code for it, your users won’t be able to do it. This is … Continue reading

Posted in programming | Tagged , | 21 Comments

Komodo Edit 4.1

I just discovered Komodo Edit from ActiveState (the same dudes who make that windows based Perl Package. Review Time! Komodo Edit 4.1 product My new favorite PHP editor. What is it? Komodo Edit 4.1 is a lightweight IDE with support … Continue reading

Posted in programming | Tagged , , , | 6 Comments

PHP4 Mail Function: Sent Time is 1 Hour Ahead

I have been messing around with this all morning and I can’t figure it out. Is there something wrong with the mail() function in PHP4? No matter what I do, all the emails sent by my PHP scripts appear to … Continue reading

Posted in programming | Tagged | Leave a comment

DST Readines Test for MySQL and PHP

Here is a quick and dirty way to see if the “MP” part of your LAMP or WIMP solution is ready for the DST time change. I tested all the production systems here today, and they seem to be working … Continue reading

Posted in technology | Tagged , , | 3 Comments

MySQL: How to get the key of last inerted row in PHP

I like to let MySQL generate unique keys for most of my tables by making them numerical and using the AUTO_INCREMENT feature. It is both an easy and convenient way to deal with primary keys. It has one disadvantage though. … Continue reading

Posted in programming | Tagged , | 7 Comments

PHP4 Static Function Calls

I just noticed that PHP4 does not support any scope modifiers such as static and visibility modifiers like private and public on class members and methods. PHP5 supports all 3, and it took me a several minutes to figure out … Continue reading

Posted in programming | Tagged | 5 Comments