New and shiny

by Patrick on September 5, 2010

Know what time it is? Time for an update!

I was too busy to write something over here. But since this is about to change (hopefully), I thought it is the right time for a relaunch of patrickburke.de

  • Everything’s in English now. No german version anymore. I decied to kick the german version because the audience for non-english speaking guys is soooo tiny in this biz, that I won’t waste my time on writing everything twice anymore. Furthermore I have to say that this was a fairly dumb idea, but whatever.
  • The blog is now based directly under patrickburke.de, any other projects will get their own subdirectory. The blog is the main purpose, that’s why it belongs where it is now.
  • New design, you may noticed it already.
  • More posts, yeah I know, sounds like an empty promise, but I’ll try it for real. Seriously :)
  • More Zend Framework, I noticed most people which get here are searching for Zend Framework resources, so I thought it would be a good idea to post more about this masterpiece of PHP.

My busyness was caused by a fairly big project at work (I should write about that…). This project is about to get finished anytime soon, thus flushing my brain in order to be able to pay attention to some less important things.

So stay tuned for some code snippets, shit happening to me or anyhting else which is worth taking notice.

Spam niceties

by Patrick on August 26, 2010

I just pissed myself laughing. I read the spam comments just for fun and found this little masterpiece:

Porn? I have seen the blogmaster in a gay gangbang movie the other day, he was high on pills and was taking cock in every hole, that horny gayass cocksucker son of a bitch.
The author of this blog is dumbass motherfucker, he is a faggyass pillpopping maniac.

And I’m still laughing, these guys really have humour :)

But to make that clear: That’s just not true.

Who hasn’t yet, who wants again?

by Patrick on November 16, 2009

UPDATE: Google Wave Now Open For All!
Thus: Invitations aren’t needed anymore; log in and feel great :)

UPDATE: 13 left.

UPDATE: It seems like everyone who is already registered at Google Wave gets eight more invitations to give away. Therefore I’ve got a total of 14 invitations for you guys.

A few weeks ago I got an invitation to Google Wave. Now that I’ve shared most of my invitations I thought “do something noble!”. There are 9 invitations left.

I don’t like quizzes and the like, therefore I’ll do it quick and easy: The first nine visitors which find this article and comment to it will recieve an invitation. Of course I need an eMail adress, otherwise I won’t be able to invote you. You need to create a Google account in order to use Google Wave, either after being invited or prior to that.

Google recommends these browser: Internet Explorer 6, Firefox 3.5, Safari 4 und Google Chrome.

Just kidding, of course the IE isn’t able to handle Wave, neither 6 nor 7 nor 8, only the other three browsers are recommended by Google. Opera (10.01) has some problems displaying Wave. I for one recommend using Iron, the none-Google version of Chrome. Why? Because of the fast JavaScript Engine and because of the none-Google. Seriously, I myself installed Iron, Firefox just isn’t that fast, at least when it comes to executing JS. Probably a fast PC helps out, I don’t know because of the lack of the latter.

But when chatting over Wave with an appropriate performance you can see the others typing, which I didn’t believe at first. Just a little advice: Google Wave is in preview status, this means it breaks sometimes, lags a little, etc.

Now let the games begin!

Zend_Acl autoloader?

by Patrick on July 30, 2009

Again about Zend Framework.

When I read the documentation of  Zend_Acl for the first time, I thought “My god, you want me to load the whole ACL structure at each request? You can’t be serious.”

Of course not. Again asking Google for help I quickly found a dynamic ACL loader in the framework’s Wiki. That’s it! Works great, but it was a little difficult to use objects as resource/role IDs, even if they implemented  Zend_Acl_Resource_Interface and Zend_Acl_Role_Interface respectively. Therefore I simply overwrote the according method and added the missing desired functionality.

Nonsense! Why? Quite simply: I already had written my own version of Zend_Acl::isAllowed() (not overwritten, my version is part of an ACL plugin which doesn’t inherit from Zend_Acl), which in turn uses Zend_Acl::isAllowed() to determine whether Peter has acces or not (A placeholder which I use all the time, you can type it so fast. No, my password don’t contain it. ;) ).

Anyway, my version of ::isAlllowed() loads all needed roles and resources when invoked (of course with a check whether this has been done already), fetches the rights data from database, uses Zend_Acl::allow() and -::deny() respectively to set the user rights and at the end it uses Zend_Acl::isAllowed() to finally determine what Peter’s rights are. The ACL object should be declared as static to not reinvent the wheel each time the method is invoked.

Zend_Layout: Layouts per module

by Patrick on July 24, 2009

Today I was confronted with the problem to assign a single layout.phtml to each module of a Zend Application. At first I thought it’d be done easily with an application.ini line like this one:

admin.resources.layout.layoutPath = path/to/layout

(whereas “admin” is the module name). But as often, pressing F5 brought disillusion, it doesn’t work this way.

A quick Google search said, that writing a Front Controller plugin which searches for a layout.phtml file by module name is the solution to all my problems. Actually this was exactly what I wanted, but there had to be a way without adding extra code to the application.

So I didn’t settle with this plugin and tried some other things until an error message opened my eyes. In fact, Zend also searches for layout files in the /scripts/views/ dir of each module. Everything I had to do was removing the “resources.layout.*” settings from my application.ini and adding a layout.phtml file to each of the latter named dirs and – voilà – each module used his own layout script; awesome, isn’t it?

Speed

by Patrick on February 3, 2009

Again, it’s just about a Website, but hey: Writing articles is for free.

This time it’s phpbench.com. Chris Vincent compares a lot of frequent PHP code snippets in terms of speed. Often, only milliseconds do the difference, but every little helps ;)

I will try to stick to some rules to get even the very last millisecond.

AJAX loader!

by Patrick on February 2, 2009

Far better than http://www.ajaxload.info: http://preloaders.net
That site offers 3 dimensional loaders too :)

Should I use tables for layout?

by Patrick on November 12, 2008

Just found a very cool website: shoudiusetablesforlayout.com

Spontaneous I felt responsible for spreading this link to the whole world; felt responsible to fight against the injustice in webdesign and take a step towards the end of the martyrdomof Firefox, Opera, Safari and their standardsphil (heck, it’s greek… does it make any sense in english?) friends.

UPDATE: Look at the source code. Best Chuck Norris phrase ever…

Smarty 3

by Patrick on November 3, 2008

My favourite in terms of templates develops further!

Take part in the development of Smarty 3 at the Smarty Developers Group or chat a little about this awesome template engine here in the Smarty Discussion Group.