Commit graph

7 commits

Author SHA1 Message Date
Max Semenik
a01f75245c CDB support: never refer to it as just "DB" in messages, it confuses people 2010-11-03 17:04:56 +00:00
Alexandre Emsenhuber
7b79d94515 * Standardised file description headers
* Added some descriptions
* Added @file where needed
2010-08-14 17:42:40 +00:00
Aaron Schulz
77486d4c65 Sanity check $this->handle on close() 2009-08-13 20:42:19 +00:00
Brion Vibber
edb3e45825 64-bit host compatibility for hash function in pure-PHP implementation of CDB reader/writer.
This fixes the problem where localization cache files generated under command-line and web were incompatible on Mac OS X when using $wgCacheDirectory instead of l10n_cache table in database.
(Apple ships a 64-bit Apache+mod_php but only a 32-bit CLI php binary, and neither has the cda extension present by default.)

Confirmed hash compatibility with native cda extension by running Tim's maintenance/cdb-test.php on 32-bit and 64-bit Ubuntu installs:

32 bit before patch:
brion@bribuntu:~/src/phase3$ php maintenance/cdb-test.php 
Write test...
e5d9cbbcd0137b281da400bb213820fa  php.cdb
e5d9cbbcd0137b281da400bb213820fa  dba.cdb
Read test...
Done.


32-bit after patch:
brion@bribuntu:~/src/phase3$ php maintenance/cdb-test.php 
Write test...
84108f6dab5c34823333169ca05eb5c3  php.cdb
84108f6dab5c34823333169ca05eb5c3  dba.cdb
Read test...
Done.
brion@bribuntu:~/src/phase3$ 


64-bit before patch:
brion@bribuntu64:~/src/phase3$ php maintenance/cdb-test.php 
Write test...
188d06832d321b20e88e9d0200242efc  php.cdb
14e0225466464003d21496204f12d20c  dba.cdb <- note mismatch!
Read test...
Done.


64-bit after patch:
brion@bribuntu64:~/src/phase3$ php maintenance/cdb-test.php 
Write test...
d244a877c9639e27c79aa1bdbcaee3c2  php.cdb
d244a877c9639e27c79aa1bdbcaee3c2  dba.cdb <- now matches!
Read test...
Done.

YESSSS
2009-07-24 22:15:23 +00:00
Aaron Schulz
6f265ace06 Avoid some silly unlink notices 2009-07-24 09:22:51 +00:00
Tim Starling
0cbc00e3ef Optimised the CDB hash function, now roughly twice as fast for large strings. Most of the saving came from removing the function calls. Retested. 2009-06-22 06:41:48 +00:00
Tim Starling
d93ea4874e Added PHP port of CDB, with abstraction layer. Tested for correctness with a differential fuzz tester, not yet benchmarked. The idea is to open up new applications for CDB, and benefit both shell and shared hosting users.
Ported existing uses of CDB to the new abstraction layer.
2009-06-20 15:59:56 +00:00