<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>[announce] php: mcache extension 1.0</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2523" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Hey John,</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Glad to see you've made some progress with this. I use the 
PECL extension and would be happy to</FONT></DIV>
<DIV><FONT size=2>use something based off of Sean's libmemcache. Can this 
extension be compiled in statically like the</FONT></DIV>
<DIV><FONT size=2>PECL extension?</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>I'd also like to see some more benchmarks when you get a 
chance. Documentation included inside the source tarball would be helpful as 
well, a README or INSTALL file.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Thanks.</FONT></DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=johnm@klir.com href="mailto:johnm@klir.com">John McCaskey</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=johnm@klir.com 
  href="mailto:johnm@klir.com">John McCaskey</A> ; <A 
  title=memcached@lists.danga.com 
  href="mailto:memcached@lists.danga.com">memcached@lists.danga.com</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Cc:</B> <A title=sean@chittenden.org 
  href="mailto:sean@chittenden.org">Sean Chittenden</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, January 18, 2005 10:33 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [announce] php: mcache extension 
  1.0</DIV>
  <DIV><BR></DIV><!-- Converted from text/plain format -->
  <P><FONT size=2>See attached source code.&nbsp;<BR><BR>Unfortunately 
  libmemcache uses the "%hu" and "%zu" format specifiers which at least on my 
  box (linux 2.6.10, php 4.3.10) break inside of php extensions for some reason, 
  so to make this actually compile you must patch your libmemcache 1.2.0 source 
  to just use "%u", use the attached patch file for this.<BR><BR>Then to install 
  the extension follow the below steps after extracting:<BR>$ phpize<BR>$ 
  ./configure --with-mcache=/path/to/patched/libmemcache/source/<BR>$ make<BR>$ 
  make install<BR><BR>then add mcache.so to your php.ini.<BR><BR><BR>You can 
  look at the following examples for usage, or view the mcache.c file which has 
  PECL standard comments about the functions.<BR><BR>&lt;?php<BR><BR>$mc = 
  memcache();<BR><BR>$mc-&gt;add_server('127.0.0.1', 
  '11211');<BR>$mc-&gt;add_server('127.0.0.1', 
  '11212');<BR><BR>$mc-&gt;set('key1', 'value_one');<BR>$mc-&gt;add('key2', 
  'value_two');<BR>$mc-&gt;replace('key2', 'two_value');<BR><BR>// This returns 
  FALSE on miss<BR>$val = $mc-&gt;get('key1');<BR><BR>// This returns an 
  associative array with<BR>// an entry for each key found, a miss will simply 
  result<BR>// in no entry in the array for that key.<BR>$val = 
  $mc-&gt;get(Array('key1', 
  'key2'));<BR><BR>$mc-&gt;delete('key1');<BR><BR>?&gt;<BR><BR>Thats the basics, 
  the remaining supported commands are: stats, incr, decr, flush_all, which 
  should be pretty easy to figure out.<BR><BR>Please feel free to send feedback 
  and/or bug fixes :)&nbsp; This is my first php extension although I'm 
  experienced in both php and c, writing primarily c code lately.&nbsp; So I 
  wouldn't be shocked to find that I haven't done everything 
  perfectly.<BR><BR>Oh, and finally a note on licensing, I've left in the php 
  header which claims the code is subject to the php license.&nbsp; I'm not sure 
  how the php license works and if I can change it freely to whatever license I 
  want or what.&nbsp; I basically don't care what you do with this, feel free to 
  use it and make changes, redistribute, use in commercial projects, 
  whatever.&nbsp; If you are concerned about the license feel free to contact 
  me.<BR><BR>--<BR>John A. McCaskey<BR>Software Development Engineer<BR>Klir 
  Technologies, 
Inc.<BR>johnm@klir.com<BR>206.902.2027<BR><BR><BR></FONT></P></BLOCKQUOTE></BODY></HTML>