Archive for the ‘PHP’ Category

WampServer + Eclipse = Great!

Friday, October 23rd, 2009

I just recently got my new laptop (Acer Aspire 8730 for CAD 900!) and it’s excellent despite being a behemoth. Anyhow – I decided to take a new approach to work stuff, so instead of installing AppServ as I’d formally used, I decided to go with WampServer – and I’m glad that I did. WampServer essentially does what AppServ did for me, but I like it more already. It incorporates some stuff like cURL without additional fuss, and it apparently makes it easier to switch between PHP versions. Honestly – after having used WampServer – even for this short amount of time – I see absolutely no reason to use AppServ, but I certainly don’t think AppServ is necessarily terrible. I encourage you to check WampServer out if you’re doing any PHP development work.

Anyhow – I also am just starting to realize the full benefits of Eclipse and the advantages and convenience that it offers, particularly with respect to CVS. It finally clicked that I could just point my Eclipse workspace to my WampServer directory, and then checkout my CVS project there while adding the config files to .cvsignore. This would seem really intuitive, but it always seems to be these “obvious” things that end up taking up copious amounts of my time.

I’m also generally focussing on getting better at using CVS and knowing proper development practices – I found an excellent article that does a good job of explaining branching with eclipse that you might want to check out. We have a new workmate as well, and she’s experienced with development practices, and hopefully some of that will rub off on me in the weeks to come as well.

I know it may seem that all I write about these days is work, but I’ve really been quite busy apart from a long weekend in Shanghai recently. I’ll try to get some non-work blog updates posted soon ;)

osCommerce working without register_globals

Monday, September 28th, 2009

Confirmed working and committed to CVS!

I also took the time to check out the osCommerce site itself and found that they’re very close to lauching osCommerce 3.0 – that’s definitely good news. The development road map looks strikingly to my own, however, and that’s disheartening, as I’m sort of stuck on my own branch / platform at this point. It will be interesting to see the new engine, but all in all I’m not terribly worried that it will be so much better than mine as to make my past development work worthless / pointless, as open source projects are rather notoriously ragtag.

I suppose now, the next moment to look forward to is when I can compare osCommerce 3.0 to my own ecommerce platform. As far as this small step – I’ll post a working example of my heavily modified osCommerce site working once it’s launched live (probably a few weeks).

osCommerce without register_globals!

Wednesday, September 23rd, 2009

I’ve now rewritten most of osCommerce w/ OOP style code, integrated it with Smarty, and am on the verge of having it 100% functional without register_globals. Needless to say, this is a very momentous moment for me, as I’ve spent the better part of three years doing this. The question that I pose myself now, though, is whether to eventually release my work to the osCommerce team, or, given that the changes I’ve implemented are so far reaching, to start my own open source shopping cart project.

The other question, obviously, is whether or not there is much demand for yet *another* open source shopping cart. I would argue that there is, because a ton of the open source shopping cart software that I’ve seen has been absolute garbage (osCommerce included), but perhaps more research is needed. I also might completely remove all osCommerce code / design from my work and create my own site that provides ad-supported usage of the new engine without releasing my source code. Lots of possibilities.

Will post again once I’ve confirmed everything is working fine with register_globals turned off.

Great PHP Development Platform: Eclipse

Wednesday, August 12th, 2009

I’ve been writing PHP for a rather long time, and up until just recently I did it the old school way – I used EditPlus (basically notepad with syntax highlighting). I give you Eclipse:

Downloads Page

I was recently introduced to this excellent development platform, and I haven’t looked back. Besides taking care of little things like completing matching braces and being able to double click on a function (even user defined) for its description or being able to tell if a method overrides a parent method, it also has a great CVS plug-in. I’m still actually just figuring that part out, but already it’s making programming a lot more enjoyable for me by taking away a lot of the “dirty work”. I highly recommend Eclipse to PHP developers.

Rug website projekt

Thursday, December 4th, 2008

A project that the company is working on is finally going to be launched. What’s exciting about this project is not the subject matter or content, it’s the engine. The engine is a heavily customized OSCommerce – as much as OSCommerce sucks, I’m confident that my platform is the way of future for our company. It uses Smarty, and a lot of the engine has been completely rewritten. There is still work left to do, but it’s already a very portable and reasonably robust engine that functions somewhat uniquely.

This is the project site: http://bigrugrack.com

Rugs, anyone?

array to real list

Wednesday, November 26th, 2008

Very simple function, but some newbie might have use for it; could also probably be integrated with Smarty if it’s not already. Probably should add some error throwing in here, but this works for my purposes.

Enjoy:

<?php

	// turns an array into a "real list"

function array_to_real_list( $array ) {

	$str = '';

	$last_part = array_pop($array);

	foreach ( $array as $part ) {
		$str .= trim($part) . ', ';
	}

	$str .= 'and ' . $last_part;

  return $str;

}

/*	Usage example: ----------------------------------------

	$array = array('lettuce', 'tomato', 'corn', 'ranch salad dressing');

echo array_to_real_list($array); // lettuce, tomato, corn, and ranch salad dressing

----------------------------------------------------------- */