Posts Tagged ‘php’

The Default Virtuemart Theme is a piece of $***!

August 30th, 2008

There I’ve said it, I’ve spent the most part of today and my afternoon yesterday theming VM. I thought, hey there’s a default template here, I’ll just modify that…

Several hours later, I’m bumping into inline styles, redundant div nesting and crappy css! FFS I just wanted to change a couple of defaults! VM team! Please update your default template to use semantic mark up!!!! I can’t put it anyother way… The default virtuemart theme is a piece of $***.

» Read more: The Default Virtuemart Theme is a piece of $***!

Security Alert for Joomla 1.5.x Users

August 14th, 2008

A security alert has been raised at the Joomla Developer site. A vulnerability has been found to exist in the “user” component of the popular OSS which allows attackers to forge a password reset. Joomla Developers have since developed a patch which is available from their website.

Versions affected: 1.5 – 1.5.5
Solution: Download the patch and Upgrade to 1.5.6 -> http://joomlacode.org/gf/project/joomla/frs/

More details about this vulnerability can be found on the following URL:
http://developer.joomla.org/security/news/241-20080801-core-password-remind-functionality.html

Stay away from Bloated Class Methods, actually, bloated ANYTHING!

March 15th, 2008

Why are there so many examples of bloated PHP methods out there?! I see a lot of bloated methods being used in examples through sites like phpclasses.org and a very large chunk of a project I’ve recently picked up which a few developers have worked on. Guys! remember! There is no good reason to bloat your methods to over 10-20 lines long and on the rare occasions that you do exceed 10 – 20 lines it would be more the exception to the rule as opposed to being the rule itself!

Let’s not forget what classes and its methods are supposed to be: Classes are blueprints for specialist components and their methods are singular actions which address one to a few (2 – 3 at most!) procedures at a time whether it be through the use of other classes or just through simple logic!

» Read more: Stay away from Bloated Class Methods, actually, bloated ANYTHING!

Execute Linux commands in PHP by using backticks

January 13th, 2008

You can execute linux commands within a php script – all you have to do is put the command line in backticks (`).

Recently, I had to upload an archive to a server which did not allow ssh. For files that I need to transfer, I just package them up in a neat archive and transfer the archive file via scp. Not having ssh access however, I uploaded the archive file via ftp and created a script which extracts the file the file looks like the following:
» Read more: Execute Linux commands in PHP by using backticks

Classes & Examples Sub-Category

December 6th, 2007

I’ve created a “Classes & Examples” sub category for PHP. This category will be different from actual Design Patterns in a way that these will be more practical examples which you can modify and use in your own code base (all I ask is that you leave my name somewhere in the credits).

The Posts I will be making in the “Classes & Examples” Sub-Category will be formatted in the following way:

» Read more: Classes & Examples Sub-Category