Friday, September 12th, 2008

Joomla 1.5.7 Security release is now available

Joomla! has released the latest version of their Open Source Software. In a nutshell, the release contains fixes for 1 critical and 2 moderate vulnerabilities.

The Developers urge all 1.5.x users  to upgrade _now_

More…

Leave a comment » Filed under PHP Programming by rvdavid at 8:33.

back to top

Saturday, August 30th, 2008

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

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 $***.

More…

Leave a comment » Filed under PHP Programming, Rants by rvdavid at 17:11.

back to top

Thursday, August 14th, 2008

Security Alert for Joomla 1.5.x Users

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

Leave a comment » Filed under PHP Programming by rvdavid at 9:50.

back to top

Saturday, March 15th, 2008

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

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!

More…

4 comments » Filed under PHP Programming by rvdavid at 0:38.

back to top

Sunday, January 13th, 2008

Execute Linux commands in PHP by using backticks

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:
More…

3 comments » Filed under General Notes by rvdavid at 1:29.

back to top

Thursday, January 10th, 2008

PHP HTTPRequest Class

Note: This is is a quick example of a very basic HTTP Request Class in PHP. This would be a nice, practical introduction to classes for someone who has been looking for a place to start.

Problem: By default, request data in PHP is handled by using Super Globals ($_POST, $_GET, $_COOKIES). Globals are bad for several reasons (outside the scope of this example google here). In an effort to remedy this, we need a way to encapsulate the request data into an object. By doing this, we are centralising access to request data through the one channel - the HTTP Request object.

Class Name:HTTPRequest

Responsibilities:

  • Store “request data” in GPC order.
  • Store additional “request data” outside of the super globals referenced by a key.
  • Read stored “request data” by referencing a key.
  • Internally clean request data by handling magic_quotes_gpc and then adding slashes.
  • Allow access to data stored in GET, POST and COOKIE super globals.

Collaborators: Any - the request object is used by any other class or function that requires access to the request data.

More…

2 comments » Filed under Classes & Examples by rvdavid at 11:49.

back to top

Saturday, December 29th, 2007

Create meaningful class attributes, not ambiguous arrays, in PHP

Happy holidays guys, it’s been a while since the last update, but I’ve been busy tweaking our framework at devproducts and wrappin’ presents that I’ve not had the time to actually make any valid posts aside from the odd I shopped here and there post, so I thought it would have been best to keep quiet until I had something meaningful to say.

A couple of years ago, when I had come across some code I had coded when I had first started learning OOP. I came across an object coined “DataSpace” from frameworks like WACT which used this uber-cool pattern.

Going through some of my old code, I’ve noticed some serious flaws. This “DataSpace” been applied wayyyy too liberally throughout almost all my applications.

More…

Leave a comment » Filed under Tips for beginners by rvdavid at 14:52.

back to top

Thursday, December 6th, 2007

Classes & Examples Sub-Category

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:

More…

Leave a comment » Filed under Classes & Examples by rvdavid at 0:22.

back to top

Credits:

© rvdavid blogs: Web Development | Powered by WP 2.3.1

Tree theme modified based on headsetoptions