Development


9
Dec 09

Multiprocessing part 1: Quick & Dirty

DEC Alpha AXP 21064 microprocessor

DEC Alpha AXP 21064 microprocessor

PHP can do only one thing at a time. Usually (for websites) this isn’t a big problem because you only have to process a request. On the other hand, if you are doing something more time-consuming PHP could be to slow.

An example is my chat bot server (Mai Ocean). For each conversation I have to make a connection with a server, so for each conversation I have a socket that I have to listen and write to. So if 10 people are talking to my bot I have at least 11 socket connections (10 conversations + main server), you could imagine that this would be way to much for just one script. So how can we solve this? Continue reading →

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • email
  • Hyves
  • LinkedIn
  • Live
  • MySpace
  • Netvibes
  • PDF
  • Reddit
  • StumbleUpon
  • Technorati
  • Twitter
  • Add to favorites
  • NuJIJ
  • RSS

5
Dec 09

PHP, Hell or Heaven: Documentation

Hell or Heaven?

Hell or Heaven?

A programming language can be great but if you do not know how it works then it’s (practically) worthless. In general you can say that the documentation is a important part of a programming language. Returning to this series, we can only tag PHP as “Heaven” if it has a good documentation. Now that’s the question we should answer today.

If you have used PHP before you should already now the answer to this question. It is definitely yes. I have never heard someone saying that the documentation was bad or somehow not good enough. Even people who hate PHP can’t disprove that (of course they could try). Continue reading →

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • email
  • Hyves
  • LinkedIn
  • Live
  • MySpace
  • Netvibes
  • PDF
  • Reddit
  • StumbleUpon
  • Technorati
  • Twitter
  • Add to favorites
  • NuJIJ
  • RSS

1
Dec 09

The bootstrap: Germination of your application

Sunflower seedlings

Sunflower seedlings

After the start of your (PHP) application it will grow. You will include more and more files, execute more functions and handle more data. When you are finished processing, all memory will be released and your app will ‘die’. Summarized you could represent your application as something simple like a plant!

The first part of “it’s life” is germination, your application has to start and set up everything he needs. In more technical terms you can call this term the bootstrap. If you use a framework such as Zend Framework you’ve probably already heard from it. Using a .htacess file you direct all traffic to your bootstrap that then will startup the main application. For a person like I (who creates PHP CLI apps) the bootstrap is a way of setting important environment variables. So what should a bootstrap do? Continue reading →

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • email
  • Hyves
  • LinkedIn
  • Live
  • MySpace
  • Netvibes
  • PDF
  • Reddit
  • StumbleUpon
  • Technorati
  • Twitter
  • Add to favorites
  • NuJIJ
  • RSS

25
Nov 09

Unit testing in PHP

Unit testing with PHPUnit

Unit testing with PHPUnit

‘Everyone’ says unit testing is important. If I quote Wikipedia you should under stand why:

In computer programming, unit testing is a software verification and validation method in which a programmer tests if individual units of source code are fit for use.

Continue reading →

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • email
  • Hyves
  • LinkedIn
  • Live
  • MySpace
  • Netvibes
  • PDF
  • Reddit
  • StumbleUpon
  • Technorati
  • Twitter
  • Add to favorites
  • NuJIJ
  • RSS

24
Nov 09

Assertions, protection against yourself

When I write new code (especially objects) I tend to build in extra security measures to protect the code against myself or other developers. Please note that I do not mean users but only the people who use the code. Continue reading →

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • email
  • Hyves
  • LinkedIn
  • Live
  • MySpace
  • Netvibes
  • PDF
  • Reddit
  • StumbleUpon
  • Technorati
  • Twitter
  • Add to favorites
  • NuJIJ
  • RSS