From 79db1e4439efdab86a6de52a7d190895107dd7c0 Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Sun, 14 Dec 2008 10:08:59 -0800 Subject: [PATCH] First import --- .cvsignore | 44 +++++++++++ .gitignore | 1 + CREDITS | 2 + EXPERIMENTAL | 5 ++ LICENSE | 68 ++++++++++++++++ README | 70 +++++++++++++++++ config.m4 | 58 ++++++++++++++ config.w32 | 17 ++++ manual/Makefile | 24 ++++++ manual/file-entities.ent | 3 + manual/functions.xml | 0 manual/manual.xml.in | 37 +++++++++ manual/memcached/configure.xml | 43 ++++++++++ manual/memcached/reference.xml | 53 +++++++++++++ memcached-api.php | 140 +++++++++++++++++++++++++++++++++ memcached.c | 113 ++++++++++++++++++++++++++ memcached.dsp | 112 ++++++++++++++++++++++++++ package.xml | 50 ++++++++++++ package2.xml | 71 +++++++++++++++++ php_memcached.h | 93 ++++++++++++++++++++++ 20 files changed, 1004 insertions(+) create mode 100644 .cvsignore create mode 100644 .gitignore create mode 100644 CREDITS create mode 100644 EXPERIMENTAL create mode 100644 LICENSE create mode 100644 README create mode 100644 config.m4 create mode 100644 config.w32 create mode 100644 manual/Makefile create mode 100644 manual/file-entities.ent create mode 100644 manual/functions.xml create mode 100644 manual/manual.xml.in create mode 100644 manual/memcached/configure.xml create mode 100644 manual/memcached/reference.xml create mode 100644 memcached-api.php create mode 100644 memcached.c create mode 100644 memcached.dsp create mode 100644 package.xml create mode 100644 package2.xml create mode 100644 php_memcached.h diff --git a/.cvsignore b/.cvsignore new file mode 100644 index 0000000..1d9af54 --- /dev/null +++ b/.cvsignore @@ -0,0 +1,44 @@ +*.lo +*.la +.deps +.libs +Makefile +Makefile.fragments +Makefile.global +Makefile.objects +acinclude.m4 +aclocal.m4 +autom4te.cache +build +config.cache +config.guess +config.h +config.h.in +config.log +config.nice +config.status +config.sub +configure +configure.in +conftest +conftest.c +include +install-sh +libtool +ltmain.sh +missing +mkinstalldirs +modules +scan_makefile_in.awk +*.dsw +*.plg +*.opt +*.ncb +Release +Release_inline +Debug +Release_TS +Release_TSDbg +Release_TS_inline +Debug_TS +memcached*.tgz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/CREDITS b/CREDITS new file mode 100644 index 0000000..c9cf9bd --- /dev/null +++ b/CREDITS @@ -0,0 +1,2 @@ +memcached +Andrei Zmievski diff --git a/EXPERIMENTAL b/EXPERIMENTAL new file mode 100644 index 0000000..6443e99 --- /dev/null +++ b/EXPERIMENTAL @@ -0,0 +1,5 @@ +this extension is experimental, +its functions may change their names +or move to extension all together +so do not rely to much on them +you have been warned! diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d4335c2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,68 @@ +-------------------------------------------------------------------- + The PHP License, Version 3.0 +Copyright (c) 1999 - 2003 The PHP Group. All rights reserved. +-------------------------------------------------------------------- + +Redistribution and use in source and binary forms, with or without +modification, is permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + 3. The name "PHP" must not be used to endorse or promote products + derived from this software without prior written permission. For + written permission, please contact group@php.net. + + 4. Products derived from this software may not be called "PHP", nor + may "PHP" appear in their name, without prior written permission + from group@php.net. You may indicate that your software works in + conjunction with PHP by saying "Foo for PHP" instead of calling + it "PHP Foo" or "phpfoo" + + 5. The PHP Group may publish revised and/or new versions of the + license from time to time. Each version will be given a + distinguishing version number. + Once covered code has been published under a particular version + of the license, you may always continue to use it under the terms + of that version. You may also choose to use such covered code + under the terms of any subsequent version of the license + published by the PHP Group. No one other than the PHP Group has + the right to modify the terms applicable to covered code created + under this License. + + 6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes PHP, freely available from + ". + +THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND +ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP +DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- + +This software consists of voluntary contributions made by many +individuals on behalf of the PHP Group. + +The PHP Group can be contacted via Email at group@php.net. + +For more information on the PHP Group and the PHP project, +please see . + +This product includes the Zend Engine, freely available at +. diff --git a/README b/README new file mode 100644 index 0000000..3d4d2c1 --- /dev/null +++ b/README @@ -0,0 +1,70 @@ +This is a standalone PHP extension created using CodeGen_PECL 1.1.2 + +HACKING +======= + +There are two ways to modify an extension created using CodeGen_PECL: + +1) you can modify the generated code as with any other PHP extension + +2) you can add custom code to the CodeGen_PECL XML source and re-run pecl-gen + +The 2nd approach may look a bit complicated but you have be aware that any +manual changes to the generated code will be lost if you ever change the +XML specs and re-run PECL-Gen. All changes done before have to be applied +to the newly generated code again. +Adding code snippets to the XML source itself on the other hand may be a +bit more complicated but this way your custom code will always be in the +generated code no matter how often you rerun CodeGen_PECL. + + +BUILDING ON UNIX etc. +===================== + +To compile your new extension, you will have to execute the following steps: + +1. $ ./phpize +2. $ ./configure [--with-memcached=...] +3. $ make +4. $ make test +5. $ [sudo] make install + + + +BUILDING ON WINDOWS +=================== + +The extension provides the VisualStudio V6 project file + + memcached.dsp +To compile the extension you open this file using VisualStudio, +select the apropriate configuration for your installation +(either "Release_TS" or "Debug_TS") and create "php_memcached.dll" + +After successfull compilation you have to copy the newly +created "memcached.dll" to the PHP +extension directory (default: C:\PHP\extensions). + + +TESTING +======= + +You can now load the extension using a php.ini directive + + extension="memcached.[so|dll]" + +or load it at runtime using the dl() function + + dl("memcached.[so|dll]"); + +The extension should now be available, you can test this +using the extension_loaded() function: + + if (extension_loaded("memcached")) + echo "memcached loaded :)"; + else + echo "something is wrong :("; + +The extension will also add its own block to the output +of phpinfo(); + diff --git a/config.m4 b/config.m4 new file mode 100644 index 0000000..eddbd97 --- /dev/null +++ b/config.m4 @@ -0,0 +1,58 @@ +dnl +dnl $ Id: $ +dnl + +PHP_ARG_WITH(memcached, libmemcached,[ --with-memcached[=DIR] With memcached support]) + + +if test "$PHP_MEMCACHED" != "no"; then + + + if test -r "$PHP_MEMCACHED/include/libmemcached/memcached.h"; then + PHP_MEMCACHED_DIR="$PHP_MEMCACHED" + else + AC_MSG_CHECKING(for memcached in default path) + for i in /usr /usr/local; do + if test -r "$i/include/libmemcached/memcached.h"; then + PHP_MEMCACHED_DIR=$i + AC_MSG_RESULT(found in $i) + break + fi + done + if test "x" = "x$PHP_MEMCACHED_DIR"; then + AC_MSG_ERROR(not found) + fi + fi + + + export OLD_CPPFLAGS="$CPPFLAGS" + export CPPFLAGS="$CPPFLAGS $INCLUDES -DHAVE_MEMCACHED" + export CPPFLAGS="$OLD_CPPFLAGS" + + PHP_ADD_INCLUDE($PHP_MEMCACHED_DIR/include) + export OLD_CPPFLAGS="$CPPFLAGS" + export CPPFLAGS="$CPPFLAGS $INCLUDES -DHAVE_MEMCACHED" + + AC_MSG_CHECKING(PHP version) + AC_TRY_COMPILE([#include ], [ +#if PHP_VERSION_ID < 40000 +#error this extension requires at least PHP version 4.0.0 +#endif +], +[AC_MSG_RESULT(ok)], +[AC_MSG_ERROR([need at least PHP 4.0.0])]) + + AC_CHECK_HEADER([libmemcached/memcached.h], [], AC_MSG_ERROR('libmemcached/memcached.h' header not found)) + export CPPFLAGS="$OLD_CPPFLAGS" + PHP_SUBST(MEMCACHED_SHARED_LIBADD) + + PHP_ADD_LIBRARY_WITH_PATH(memcached, $PHP_MEMCACHED_DIR/lib, MEMCACHED_SHARED_LIBADD) + + + PHP_SUBST(MEMCACHED_SHARED_LIBADD) + AC_DEFINE(HAVE_MEMCACHED, 1, [ ]) + + PHP_NEW_EXTENSION(memcached, memcached.c , $ext_shared) + +fi + diff --git a/config.w32 b/config.w32 new file mode 100644 index 0000000..8b10efb --- /dev/null +++ b/config.w32 @@ -0,0 +1,17 @@ +// $ Id: $ +// vim:ft=javascript + +ARG_WITH('memcached', 'libmemcached extension', 'no'); + +if (PHP_MEMCACHED == "yes") { + + if (!CHECK_LIB("memcached.lib", "memcached", PHP_MEMCACHED)) { + ERROR("memcached: library 'memcached' not found"); + } + + if (!CHECK_HEADER_ADD_INCLUDE("libmemcached/memcached.h", "CFLAGS_MEMCACHED")) { + ERROR("memcached: header 'libmemcached/memcached.h' not found"); + } + EXTENSION("memcached", "memcached.c"); + AC_DEFINE("HAVE_MEMCACHED", 1, "memcached support"); +} diff --git a/manual/Makefile b/manual/Makefile new file mode 100644 index 0000000..ad24441 --- /dev/null +++ b/manual/Makefile @@ -0,0 +1,24 @@ +# +all: html + +confcheck: + @if test "x$(PHPDOC)" = "x"; then echo PHPDOC not set; exit 3; fi + +manual.xml: manual.xml.in + sed -e's:@PHPDOC@:$(PHPDOC):g' < manual.xml.in > manual.xml + +html: confcheck manual.xml + rm -rf html; mkdir html + SP_ENCODING=XML SP_CHARSET_FIXED=YES openjade -D $(PHPDOC) -wno-idref -c $(PHPDOC)/docbook/docbook-dsssl/catalog -c $(PHPDOC)/phpbook/phpbook-dsssl/defaults/catalog -d $(PHPDOC)/phpbook/phpbook-dsssl/html.dsl -V use-output-dir -t sgml $(PHPDOC)/phpbook/phpbook-xml/phpdocxml.dcl manual.xml + +bightml: confcheck manual.xml + rm -rf html; mkdir html + SP_ENCODING=XML SP_CHARSET_FIXED=YES openjade -D $(PHPDOC) -wno-idref -c $(PHPDOC)/docbook/docbook-dsssl/catalog -c $(PHPDOC)/phpbook/phpbook-dsssl/defaults/catalog -d $(PHPDOC)/phpbook/phpbook-dsssl/html.dsl -V nochunks -t sgml $(PHPDOC)/phpbook/phpbook-xml/phpdocxml.dcl manual.xml > manual.html + +tex: manual.tex + +manual.tex: confcheck manual.xml + SP_ENCODING=XML SP_CHARSET_FIXED=YES openjade -D $(PHPDOC) -wno-idref -c $(PHPDOC)/docbook/docbook-dsssl/catalog -c $(PHPDOC)/phpbook/phpbook-dsssl/defaults/catalog -d $(PHPDOC)/phpbook/phpbook-dsssl/print.dsl -t tex $(PHPDOC)/phpbook/phpbook-xml/phpdocxml.dcl manual.xml + +pdf: manual.tex + pdfjadetex manual.tex && pdfjadetex manual.tex && pdfjadetex manual.tex diff --git a/manual/file-entities.ent b/manual/file-entities.ent new file mode 100644 index 0000000..1c32584 --- /dev/null +++ b/manual/file-entities.ent @@ -0,0 +1,3 @@ + + + diff --git a/manual/functions.xml b/manual/functions.xml new file mode 100644 index 0000000..e69de29 diff --git a/manual/manual.xml.in b/manual/manual.xml.in new file mode 100644 index 0000000..348fa68 --- /dev/null +++ b/manual/manual.xml.in @@ -0,0 +1,37 @@ + + + + + +%language-defs; +%language-snippets; + + + + + + +%language-defs.default; +%language-snippets.default; +%extensions.default; + + + + + + + +%global.entities; +%file.entities; + + + +%missing-entities; +]> + + + &reference.memcached.reference; + diff --git a/manual/memcached/configure.xml b/manual/memcached/configure.xml new file mode 100644 index 0000000..0eccbfa --- /dev/null +++ b/manual/memcached/configure.xml @@ -0,0 +1,43 @@ + +
+ &reftitle.required; +This extension requires the following library: memcached +This extension requires the following header: libmemcached/memcached.h + +
+ + +
+ &reftitle.install; + Requires memcached + +
+ + +
+ &reftitle.runtime; + &no.config; + +
+ + + diff --git a/manual/memcached/reference.xml b/manual/memcached/reference.xml new file mode 100644 index 0000000..541ae4e --- /dev/null +++ b/manual/memcached/reference.xml @@ -0,0 +1,53 @@ + + + + libmemcached extension + memcached + + +
+ &reftitle.intro; + + Extension for interfacing with memcache servers via libmemcached library. + + +
+ + &reference.memcached.configure; + +
+ &reftitle.resources; + &no.resource; +
+ +
+ &reftitle.constants; + &no.constants; +
+ +
+ +&reference.memcached.functions; + +
+ + diff --git a/memcached-api.php b/memcached-api.php new file mode 100644 index 0000000..f2eb46c --- /dev/null +++ b/memcached-api.php @@ -0,0 +1,140 @@ + | + +----------------------------------------------------------------------+ +*/ + +/* $ Id: $ */ + +#include "php_memcached.h" + +#if HAVE_MEMCACHED + +/* {{{ memcached_functions[] */ +function_entry memcached_functions[] = { + { NULL, NULL, NULL } +}; +/* }}} */ + + +/* {{{ memcached_module_entry + */ +zend_module_entry memcached_module_entry = { + STANDARD_MODULE_HEADER, + "memcached", + memcached_functions, + PHP_MINIT(memcached), /* Replace with NULL if there is nothing to do at php startup */ + PHP_MSHUTDOWN(memcached), /* Replace with NULL if there is nothing to do at php shutdown */ + PHP_RINIT(memcached), /* Replace with NULL if there is nothing to do at request start */ + PHP_RSHUTDOWN(memcached), /* Replace with NULL if there is nothing to do at request end */ + PHP_MINFO(memcached), + "0.1.0", + STANDARD_MODULE_PROPERTIES +}; +/* }}} */ + +#ifdef COMPILE_DL_MEMCACHED +ZEND_GET_MODULE(memcached) +#endif + + +/* {{{ PHP_MINIT_FUNCTION */ +PHP_MINIT_FUNCTION(memcached) +{ + + /* add your stuff here */ + + return SUCCESS; +} +/* }}} */ + + +/* {{{ PHP_MSHUTDOWN_FUNCTION */ +PHP_MSHUTDOWN_FUNCTION(memcached) +{ + + /* add your stuff here */ + + return SUCCESS; +} +/* }}} */ + + +/* {{{ PHP_RINIT_FUNCTION */ +PHP_RINIT_FUNCTION(memcached) +{ + /* add your stuff here */ + + return SUCCESS; +} +/* }}} */ + + +/* {{{ PHP_RSHUTDOWN_FUNCTION */ +PHP_RSHUTDOWN_FUNCTION(memcached) +{ + /* add your stuff here */ + + return SUCCESS; +} +/* }}} */ + + +/* {{{ PHP_MINFO_FUNCTION */ +PHP_MINFO_FUNCTION(memcached) +{ + php_info_print_box_start(0); + php_printf("

libmemcached extension

\n"); + php_printf("

Version 0.1.0

\n"); + php_printf("

Authors:

\n"); + php_printf("

Andrei Zmievski <andrei@php.net> (lead)

\n"); + php_info_print_box_end(); + +} +/* }}} */ + +#endif /* HAVE_MEMCACHED */ + + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim: noet sw=4 ts=4 fdm=marker: + */ diff --git a/memcached.dsp b/memcached.dsp new file mode 100644 index 0000000..3ce6a2e --- /dev/null +++ b/memcached.dsp @@ -0,0 +1,112 @@ +# Microsoft Developer Studio Project File - Name="memcached" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=memcached - Win32 Debug_TS +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "memcached.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "memcached.mak" CFG="memcached - Win32 Debug_TS" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "memcached - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "memcached - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "memcached - Win32 Release_TS" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_TS" +# PROP BASE Intermediate_Dir "Release_TS" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_TS" +# PROP Intermediate_Dir "Release_TS" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MEMCACHED_EXPORTS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "PHP_EXPORTS" /D "COMPILE_DL_MEMCACHED" /D ZTS=1 /D HAVE_MEMCACHED=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x407 /d "NDEBUG" +# ADD RSC /l 0x407 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib memcached.lib /nologo /dll /machine:I386 +# ADD LINK32 php4ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib memcached.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS\php_memcached.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" + +!ELSEIF "$(CFG)" == "memcached - Win32 Debug_TS" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_TS" +# PROP BASE Intermediate_Dir "Debug_TS" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_TS" +# PROP Intermediate_Dir "Debug_TS" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MEMCACHED_EXPORTS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_MEMCACHED" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MEMCACHED=1 /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x407 /d "_DEBUG" +# ADD RSC /l 0x407 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib memcached.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 php4ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib memcached.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS\php_memcached.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" + +!ENDIF + +# Begin Target + +# Name "memcached - Win32 Release_TS" +# Name "memcached - Win32 Debug_TS" + +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + +# Begin Source File + +SOURCE=./memcached.c +# End Source File + +# End Group + +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" + +# Begin Source File + +SOURCE=.\php_memcached.h +# End Source File +# End Group +# End Target +# End Project diff --git a/package.xml b/package.xml new file mode 100644 index 0000000..9e85c33 --- /dev/null +++ b/package.xml @@ -0,0 +1,50 @@ + + + + + memcached + libmemcached extension + + Extension for interfacing with memcache servers via libmemcached library. + + + PHP + + + + + + + + andrei + Andrei Zmievski + andrei@php.net + lead + + + + + 0.0.1 + devel + unknown + 2008-12-14 + + + + + + + + + + + + + + + + + + + + diff --git a/package2.xml b/package2.xml new file mode 100644 index 0000000..5356ebb --- /dev/null +++ b/package2.xml @@ -0,0 +1,71 @@ + + + + memcached + pecl.php.net + + libmemcached extension + + + Extension for interfacing with memcache servers via libmemcached library. + + + + Andrei Zmievski + andrei + andrei@php.net + yes + + + 2008-12-14 + + 0.0.1 + 0.0.1 + + + devel + devel + + + PHP + + +none + + + + + + + + + + + + + + + + + + 4.0.0 + + + 1.4.0a1 + + + + + memcached + + + + + + diff --git a/php_memcached.h b/php_memcached.h new file mode 100644 index 0000000..494be40 --- /dev/null +++ b/php_memcached.h @@ -0,0 +1,93 @@ +/* + +----------------------------------------------------------------------+ + | This source file is subject to version 3.0 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_0.txt. | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Andrei Zmievski | + +----------------------------------------------------------------------+ +*/ + +/* $ Id: $ */ + +#ifndef PHP_MEMCACHED_H +#define PHP_MEMCACHED_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#ifdef HAVE_MEMCACHED + +#include +#include +#include +#include +#ifdef __cplusplus +} // extern "C" +#endif +#include +#ifdef __cplusplus +extern "C" { +#endif + +extern zend_module_entry memcached_module_entry; +#define phpext_memcached_ptr &memcached_module_entry + +#ifdef PHP_WIN32 +#define PHP_MEMCACHED_API __declspec(dllexport) +#else +#define PHP_MEMCACHED_API +#endif + +PHP_MINIT_FUNCTION(memcached); +PHP_MSHUTDOWN_FUNCTION(memcached); +PHP_RINIT_FUNCTION(memcached); +PHP_RSHUTDOWN_FUNCTION(memcached); +PHP_MINFO_FUNCTION(memcached); + +#ifdef ZTS +#include "TSRM.h" +#endif + +#define FREE_RESOURCE(resource) zend_list_delete(Z_LVAL_P(resource)) + +#define PROP_GET_LONG(name) Z_LVAL_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC)) +#define PROP_SET_LONG(name, l) zend_update_property_long(_this_ce, _this_zval, #name, strlen(#name), l TSRMLS_CC) + +#define PROP_GET_DOUBLE(name) Z_DVAL_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC)) +#define PROP_SET_DOUBLE(name, d) zend_update_property_double(_this_ce, _this_zval, #name, strlen(#name), d TSRMLS_CC) + +#define PROP_GET_STRING(name) Z_STRVAL_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC)) +#define PROP_GET_STRLEN(name) Z_STRLEN_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC)) +#define PROP_SET_STRING(name, s) zend_update_property_string(_this_ce, _this_zval, #name, strlen(#name), s TSRMLS_CC) +#define PROP_SET_STRINGL(name, s, l) zend_update_property_stringl(_this_ce, _this_zval, #name, strlen(#name), s, l TSRMLS_CC) + + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif /* PHP_HAVE_MEMCACHED */ + +#endif /* PHP_MEMCACHED_H */ + + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */