The SpiteShow
Really?

I seriously can’t find Senior PHP developers. I’ve never taken more than four weeks to find a new developer, but for some reason we just can’t find someone we like for the position.

If by some magical chance I get on the Tumblr radar and you see this and you are or know a PHP developer local to Northern Jersey (10minute train ride out of NY Penn) get in touch.

eFashionSolutions.com is an ecommerce company with a relaxed environment and some cool projects about to start. You just need to bring to the table: PHP5, MySQL, MVC, OOP, JavaScript and some ecommerce experience is a major plus.

Help!

What happened to LAMP?

I look at some of these emails I get from people on LinkedIn talking about LAMP positions they are trying to fill, and it would appear the LAMP acronym has turned into a word describing developers who use anything other than Microsoft based languages.

I can see Python and Perl getting crowbared into the definition, at least they start with the letter ‘P’ but when did Ruby On Rails get added to the wonderful world of LAMP?

Listen, LAMP for me means: Linux, Apache, MySQL and PHP

Stop messing with my acronyms, get your own!

Coda VS TextMate

I’ve been trying to like TextMate but I can’t really get over the lack of autocomplete for PHP. I am sure some where there is bundle for it, I just haven’t found it yet. Coda has been much better in terms of PHP support, but there is something about TextMate that keeps me coming back to try again…

Every once in awhile I’ll fire up Zend IDE for old time’s sake

Damn MS and its special characters

I don’t know about you, but I have a bunch of people using the tools my team and I develop at work who constantly copy-and-paste from MS Word bringing all of its wonderful special characters with it. Then they save and it gets into the database and to the live site…which of course leads to them calling me to ask about the strange symbols in product descriptions. Two problems here: the developer isn’t cleaning his data well enough before sending to the database, and then the staff here can’t figure out how to open notepad but can figure out how to turn their ‘smart’ quotes back on no matter how often we disable it on them.

So in case you suffer this same burden, here is a very simple function you can use to clean up your strings:

function cleanUpString($string) {
	return str_replace(
		array(
			chr(145),
			chr(146),
			chr(147),
			chr(148),
			chr(151),
			chr(133),
			chr(130)
		),
		array(
			"'",
			"'",
			'"',
			'"',
			'-',
			'...',
			','
		),
		$string
	);
}
PHP LIBS

Listen development teams working for companies that provide code LIBs to make implementation easier for your clients: DON’T USE AUTOLOAD. What if your client uses that shit too? Should we have to modify your poorly coded LIB broken up across 60 files? If you are going to use autoload, how about you use some sort of naming convention for your files? How about instead of using autoload to crawl entire directories (60 files!) looking for files that match a string you pass autoload, you just require the files the old way?

Also, let’s not leave white space after your closing ‘?>’ tags. They rape my sessions. How about instead you just don’t use ‘?>’ in your ‘all PHP’ scripts? It isn’t required you know.

I hate you guys. Seriously.

PHP Object stuff

marco:

Can PHP do this?

(new Whatever())->function();

It gives me a parse error and makes me do this instead:

$w = new Whatever(); $w->function();

But you can do this perfectly well:

$w->function()->otherFunction();

One hack is to define a function with the same name as the class that returns an instance:

function Whatever() { return new Whatever(); }
/* ... */
Whatever()->function()->otherFunction();

But that’s a hack.

I do this with some of my stuff:


class Test
{
	protected function __construct() {
		// some config stuff...set some stuff
	}
	
	static function getInstance() {
		return new Test();
	}
	
	public function printMsg($msg) {
		print $msg;
		return $this;
	}
	
	public function arg() {
		print 'I AM AN ANGRY METHOD!';
		return $this;
	}
}

Test::getInstance()->printMsg('this is a test')->arg();

Of course I do more interesting stuff with it than prints…model stuff and what have you.

Zend Framework Cache

So at work I am already using the Zend Framework for my main project. I’m mostly leading the development and design of the project, but my team seems pretty into the framework so far. So point for me on choosing it as our starting point I suppose. Lately though, I have been finding myself more and more annoyed with it.

Don’t get me wrong, the code is great. They are pretty clever with their session management and their MVC approach is pretty clean, but lately the lackluster documentation is killing me. It usually isn’t enough to visit their site or run PHPDocumentor, you have to play with and maybe even dissect the LIB to figure out what your boundaries are. The time wasted is killing me here.

And for whatever reason, Zend_Cache is pretty annoying. It isn’t nearly as robust as most of the rest of the LIB, and writes its files with scores of hyphens; those hyphens seem to be the bane of my development environment here. If I hardcode a file name in for a cache file, everything is fine…if I leave it as it was, the page takes over a minute to load and doesn’t even finish writing the cache file.

I’m half tempted to rewrite pieces of the file, but it goes against my own rules in regards to editing the Zend LIB and who has the time really? The hyphens being used as delimeters in the file names aren’t even in a VAR, they are strings appended when needed ($root = $someVar . ‘—-’ . $crap . ‘—-‘;).

Marco responded to my last post saying they (Tumblr and Davidville) use mostly a homebrew framework…I think that is pretty much the same direction I’ll be moving in.

PHP Framework?

I’ve been spending a little time tonight white-boarding out some ideas and Apps I will be working on shortly on the side; both alone and with some other developers.

During my planning tonight, I started to think about the first few bits of code and started wondering…do I use the great Zend Framework I have been using at my day job, or do I start my own? The benefit of Zend is it is done already and very tight. Doing my own will keep the code base much smaller and more focused on what I need from it though.

Regardless, I love working on these types of things. Like when I was writing plugins and all sorts of crazy shit for Wordpress while I was with Dow Jones. I wonder if the Tumblr guys are using a framework or if it is all home brew.