Skip to content

Commit 79db1e4

Browse files
author
Andrei Zmievski
committed
First import
0 parents  commit 79db1e4

20 files changed

+1004
-0
lines changed

.cvsignore

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
*.lo
2+
*.la
3+
.deps
4+
.libs
5+
Makefile
6+
Makefile.fragments
7+
Makefile.global
8+
Makefile.objects
9+
acinclude.m4
10+
aclocal.m4
11+
autom4te.cache
12+
build
13+
config.cache
14+
config.guess
15+
config.h
16+
config.h.in
17+
config.log
18+
config.nice
19+
config.status
20+
config.sub
21+
configure
22+
configure.in
23+
conftest
24+
conftest.c
25+
include
26+
install-sh
27+
libtool
28+
ltmain.sh
29+
missing
30+
mkinstalldirs
31+
modules
32+
scan_makefile_in.awk
33+
*.dsw
34+
*.plg
35+
*.opt
36+
*.ncb
37+
Release
38+
Release_inline
39+
Debug
40+
Release_TS
41+
Release_TSDbg
42+
Release_TS_inline
43+
Debug_TS
44+
memcached*.tgz

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.swp

CREDITS

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
memcached
2+
Andrei Zmievski

EXPERIMENTAL

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
this extension is experimental,
2+
its functions may change their names
3+
or move to extension all together
4+
so do not rely to much on them
5+
you have been warned!

LICENSE

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
--------------------------------------------------------------------
2+
The PHP License, Version 3.0
3+
Copyright (c) 1999 - 2003 The PHP Group. All rights reserved.
4+
--------------------------------------------------------------------
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, is permitted provided that the following conditions
8+
are met:
9+
10+
1. Redistributions of source code must retain the above copyright
11+
notice, this list of conditions and the following disclaimer.
12+
13+
2. Redistributions in binary form must reproduce the above copyright
14+
notice, this list of conditions and the following disclaimer in
15+
the documentation and/or other materials provided with the
16+
distribution.
17+
18+
3. The name "PHP" must not be used to endorse or promote products
19+
derived from this software without prior written permission. For
20+
written permission, please contact [email protected].
21+
22+
4. Products derived from this software may not be called "PHP", nor
23+
may "PHP" appear in their name, without prior written permission
24+
from [email protected]. You may indicate that your software works in
25+
conjunction with PHP by saying "Foo for PHP" instead of calling
26+
it "PHP Foo" or "phpfoo"
27+
28+
5. The PHP Group may publish revised and/or new versions of the
29+
license from time to time. Each version will be given a
30+
distinguishing version number.
31+
Once covered code has been published under a particular version
32+
of the license, you may always continue to use it under the terms
33+
of that version. You may also choose to use such covered code
34+
under the terms of any subsequent version of the license
35+
published by the PHP Group. No one other than the PHP Group has
36+
the right to modify the terms applicable to covered code created
37+
under this License.
38+
39+
6. Redistributions of any form whatsoever must retain the following
40+
acknowledgment:
41+
"This product includes PHP, freely available from
42+
<http://www.php.net/>".
43+
44+
THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND
45+
ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
46+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
47+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP
48+
DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
49+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
50+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
51+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
52+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
53+
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
54+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
55+
OF THE POSSIBILITY OF SUCH DAMAGE.
56+
57+
--------------------------------------------------------------------
58+
59+
This software consists of voluntary contributions made by many
60+
individuals on behalf of the PHP Group.
61+
62+
The PHP Group can be contacted via Email at [email protected].
63+
64+
For more information on the PHP Group and the PHP project,
65+
please see <http://www.php.net>.
66+
67+
This product includes the Zend Engine, freely available at
68+
<http://www.zend.com>.

README

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
This is a standalone PHP extension created using CodeGen_PECL 1.1.2
2+
3+
HACKING
4+
=======
5+
6+
There are two ways to modify an extension created using CodeGen_PECL:
7+
8+
1) you can modify the generated code as with any other PHP extension
9+
10+
2) you can add custom code to the CodeGen_PECL XML source and re-run pecl-gen
11+
12+
The 2nd approach may look a bit complicated but you have be aware that any
13+
manual changes to the generated code will be lost if you ever change the
14+
XML specs and re-run PECL-Gen. All changes done before have to be applied
15+
to the newly generated code again.
16+
Adding code snippets to the XML source itself on the other hand may be a
17+
bit more complicated but this way your custom code will always be in the
18+
generated code no matter how often you rerun CodeGen_PECL.
19+
20+
21+
BUILDING ON UNIX etc.
22+
=====================
23+
24+
To compile your new extension, you will have to execute the following steps:
25+
26+
1. $ ./phpize
27+
2. $ ./configure [--with-memcached=...]
28+
3. $ make
29+
4. $ make test
30+
5. $ [sudo] make install
31+
32+
33+
34+
BUILDING ON WINDOWS
35+
===================
36+
37+
The extension provides the VisualStudio V6 project file
38+
39+
memcached.dsp
40+
To compile the extension you open this file using VisualStudio,
41+
select the apropriate configuration for your installation
42+
(either "Release_TS" or "Debug_TS") and create "php_memcached.dll"
43+
44+
After successfull compilation you have to copy the newly
45+
created "memcached.dll" to the PHP
46+
extension directory (default: C:\PHP\extensions).
47+
48+
49+
TESTING
50+
=======
51+
52+
You can now load the extension using a php.ini directive
53+
54+
extension="memcached.[so|dll]"
55+
56+
or load it at runtime using the dl() function
57+
58+
dl("memcached.[so|dll]");
59+
60+
The extension should now be available, you can test this
61+
using the extension_loaded() function:
62+
63+
if (extension_loaded("memcached"))
64+
echo "memcached loaded :)";
65+
else
66+
echo "something is wrong :(";
67+
68+
The extension will also add its own block to the output
69+
of phpinfo();
70+

config.m4

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
dnl
2+
dnl $ Id: $
3+
dnl
4+
5+
PHP_ARG_WITH(memcached, libmemcached,[ --with-memcached[=DIR] With memcached support])
6+
7+
8+
if test "$PHP_MEMCACHED" != "no"; then
9+
10+
11+
if test -r "$PHP_MEMCACHED/include/libmemcached/memcached.h"; then
12+
PHP_MEMCACHED_DIR="$PHP_MEMCACHED"
13+
else
14+
AC_MSG_CHECKING(for memcached in default path)
15+
for i in /usr /usr/local; do
16+
if test -r "$i/include/libmemcached/memcached.h"; then
17+
PHP_MEMCACHED_DIR=$i
18+
AC_MSG_RESULT(found in $i)
19+
break
20+
fi
21+
done
22+
if test "x" = "x$PHP_MEMCACHED_DIR"; then
23+
AC_MSG_ERROR(not found)
24+
fi
25+
fi
26+
27+
28+
export OLD_CPPFLAGS="$CPPFLAGS"
29+
export CPPFLAGS="$CPPFLAGS $INCLUDES -DHAVE_MEMCACHED"
30+
export CPPFLAGS="$OLD_CPPFLAGS"
31+
32+
PHP_ADD_INCLUDE($PHP_MEMCACHED_DIR/include)
33+
export OLD_CPPFLAGS="$CPPFLAGS"
34+
export CPPFLAGS="$CPPFLAGS $INCLUDES -DHAVE_MEMCACHED"
35+
36+
AC_MSG_CHECKING(PHP version)
37+
AC_TRY_COMPILE([#include <php_version.h>], [
38+
#if PHP_VERSION_ID < 40000
39+
#error this extension requires at least PHP version 4.0.0
40+
#endif
41+
],
42+
[AC_MSG_RESULT(ok)],
43+
[AC_MSG_ERROR([need at least PHP 4.0.0])])
44+
45+
AC_CHECK_HEADER([libmemcached/memcached.h], [], AC_MSG_ERROR('libmemcached/memcached.h' header not found))
46+
export CPPFLAGS="$OLD_CPPFLAGS"
47+
PHP_SUBST(MEMCACHED_SHARED_LIBADD)
48+
49+
PHP_ADD_LIBRARY_WITH_PATH(memcached, $PHP_MEMCACHED_DIR/lib, MEMCACHED_SHARED_LIBADD)
50+
51+
52+
PHP_SUBST(MEMCACHED_SHARED_LIBADD)
53+
AC_DEFINE(HAVE_MEMCACHED, 1, [ ])
54+
55+
PHP_NEW_EXTENSION(memcached, memcached.c , $ext_shared)
56+
57+
fi
58+

config.w32

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// $ Id: $
2+
// vim:ft=javascript
3+
4+
ARG_WITH('memcached', 'libmemcached extension', 'no');
5+
6+
if (PHP_MEMCACHED == "yes") {
7+
8+
if (!CHECK_LIB("memcached.lib", "memcached", PHP_MEMCACHED)) {
9+
ERROR("memcached: library 'memcached' not found");
10+
}
11+
12+
if (!CHECK_HEADER_ADD_INCLUDE("libmemcached/memcached.h", "CFLAGS_MEMCACHED")) {
13+
ERROR("memcached: header 'libmemcached/memcached.h' not found");
14+
}
15+
EXTENSION("memcached", "memcached.c");
16+
AC_DEFINE("HAVE_MEMCACHED", 1, "memcached support");
17+
}

manual/Makefile

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#
2+
all: html
3+
4+
confcheck:
5+
@if test "x$(PHPDOC)" = "x"; then echo PHPDOC not set; exit 3; fi
6+
7+
manual.xml: manual.xml.in
8+
sed -e's:@PHPDOC@:$(PHPDOC):g' < manual.xml.in > manual.xml
9+
10+
html: confcheck manual.xml
11+
rm -rf html; mkdir html
12+
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
13+
14+
bightml: confcheck manual.xml
15+
rm -rf html; mkdir html
16+
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
17+
18+
tex: manual.tex
19+
20+
manual.tex: confcheck manual.xml
21+
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
22+
23+
pdf: manual.tex
24+
pdfjadetex manual.tex && pdfjadetex manual.tex && pdfjadetex manual.tex

manual/file-entities.ent

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<!ENTITY reference.memcached.reference SYSTEM './memcached/reference.xml'>
2+
<!ENTITY reference.memcached.configure SYSTEM './memcached/configure.xml'>
3+
<!ENTITY reference.memcached.functions SYSTEM './functions.xml'>

manual/functions.xml

Whitespace-only changes.

manual/manual.xml.in

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version='1.0' encoding='UTF-8' ?>
2+
<!DOCTYPE book PUBLIC '-//OASIS//DTD DocBook XML V4.1.2//EN'
3+
'@PHPDOC@/dtds/dbxml-4.1.2/docbookx.dtd' [
4+
5+
<!-- Add translated specific definitions and snippets -->
6+
<!ENTITY % language-defs SYSTEM '@PHPDOC@/en/language-defs.ent'>
7+
<!ENTITY % language-snippets SYSTEM '@PHPDOC@/en/language-snippets.ent'>
8+
9+
%language-defs;
10+
%language-snippets;
11+
12+
<!-- Fallback to English definitions and snippets (in case of missing translation) -->
13+
<!ENTITY % language-defs.default SYSTEM '@PHPDOC@/en/language-defs.ent'>
14+
<!ENTITY % language-snippets.default SYSTEM '@PHPDOC@/en/language-snippets.ent'>
15+
<!ENTITY % extensions.default SYSTEM '@PHPDOC@/en/extensions.ent'>
16+
17+
%language-defs.default;
18+
%language-snippets.default;
19+
%extensions.default;
20+
21+
<!-- All global entities for the XML files -->
22+
<!ENTITY % global.entities SYSTEM '@PHPDOC@/entities/global.ent'>
23+
24+
<!ENTITY % file.entities SYSTEM './file-entities.ent'>
25+
26+
<!-- Include all external DTD parts defined previously -->
27+
%global.entities;
28+
%file.entities;
29+
30+
<!-- Autogenerated missing entites and IDs to make build work -->
31+
<!ENTITY % missing-entities SYSTEM '@PHPDOC@/entities/missing-entities.ent'>
32+
%missing-entities;
33+
]>
34+
35+
<book id='manual' lang='en'>
36+
&reference.memcached.reference;
37+
</book>

manual/memcached/configure.xml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
<section id='memcached.requirements'>
3+
&reftitle.required;
4+
<para>This extension requires the following library: memcached</para>
5+
<para>This extension requires the following header: libmemcached/memcached.h</para>
6+
7+
</section>
8+
9+
10+
<section id='memcached.install'>
11+
&reftitle.install;
12+
<para>Requires <literal>memcached</literal></para>
13+
14+
</section>
15+
16+
17+
<section id='memcached.configuration'>
18+
&reftitle.runtime;
19+
&no.config;
20+
21+
</section>
22+
23+
24+
<!-- Keep this comment at the end of the file
25+
Local variables:
26+
mode: sgml
27+
sgml-omittag:t
28+
sgml-shorttag:t
29+
sgml-minimize-attributes:nil
30+
sgml-always-quote-attributes:t
31+
sgml-indent-step:1
32+
sgml-indent-data:t
33+
indent-tabs-mode:nil
34+
sgml-parent-document:nil
35+
sgml-default-dtd-file:"../../../manual.ced"
36+
sgml-exposed-tags:nil
37+
sgml-local-catalogs:nil
38+
sgml-local-ecat-files:nil
39+
End:
40+
vim600: syn=xml fen fdm=syntax fdl=2 si
41+
vim: et tw=78 syn=sgml
42+
vi: ts=1 sw=1
43+
-->

0 commit comments

Comments
 (0)