initial commit
[m6w6/m6w6.github.io] / _posts / 2004-08-25-extapr-exercise-or-joke.md
1 ---
2 title: ext/apr - exercise or joke?
3 author: m6w6
4 tags:
5 - PHP
6 ---
7
8 Well yes, it started as an exercise (and others thought it is a joke) ;)
9
10 My intention was to export apr_md5_encode() to php which generates MD5
11 password hashes similar to those found in .htpasswd files. [PEARs
12 File_Passwd](http://pear.php.net/package/File_Passwd) already does that, but
13 with plain vanilla PHP - generating one password takes about 0.2 seconds and
14 more.
15
16 Currently I'm trying to make apr_threads usable - wouldn't threads in PHP be
17 cool? Yes, they'd definitly be :) It's just a segfault away from working ;)
18
19 ```php
20 class Thread1 extends APR_Thread {
21 function run() {
22 // do some work
23 }
24 }
25 class Thread2 extends APR_Thread {
26 function run() {
27 // do some concurrent work
28 }
29 }
30 new Thread1;
31 new Thread2;
32 ```
33
34 Thanks to Derick, Sara and the whole php.pecl gang - I wouldn't have managed
35 to get that far without their tremendous help!