[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git
|
-(directory)
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/HEAD
^
|
@@ -1 +0,0 @@
-ref: refs/heads/php7
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/branches
^
|
-(directory)
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/config
^
|
@@ -1,11 +0,0 @@
-[core]
- repositoryformatversion = 0
- filemode = true
- bare = false
- logallrefupdates = true
-[remote "origin"]
- url = https://github.com/php-memcached-dev/php-memcached.git
- fetch = +refs/heads/*:refs/remotes/origin/*
-[branch "php7"]
- remote = origin
- merge = refs/heads/php7
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/description
^
|
@@ -1 +0,0 @@
-Unnamed repository; edit this file 'description' to name the repository.
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/hooks
^
|
-(directory)
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/hooks/applypatch-msg.sample
^
|
@@ -1,15 +0,0 @@
-#!/bin/sh
-#
-# An example hook script to check the commit log message taken by
-# applypatch from an e-mail message.
-#
-# The hook should exit with non-zero status after issuing an
-# appropriate message if it wants to stop the commit. The hook is
-# allowed to edit the commit message file.
-#
-# To enable this hook, rename this file to "applypatch-msg".
-
-. git-sh-setup
-test -x "$GIT_DIR/hooks/commit-msg" &&
- exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"}
-:
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/hooks/commit-msg.sample
^
|
@@ -1,24 +0,0 @@
-#!/bin/sh
-#
-# An example hook script to check the commit log message.
-# Called by "git commit" with one argument, the name of the file
-# that has the commit message. The hook should exit with non-zero
-# status after issuing an appropriate message if it wants to stop the
-# commit. The hook is allowed to edit the commit message file.
-#
-# To enable this hook, rename this file to "commit-msg".
-
-# Uncomment the below to add a Signed-off-by line to the message.
-# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
-# hook is more suited to it.
-#
-# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
-# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
-
-# This example catches duplicate Signed-off-by lines.
-
-test "" = "$(grep '^Signed-off-by: ' "$1" |
- sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
- echo >&2 Duplicate Signed-off-by lines.
- exit 1
-}
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/hooks/post-update.sample
^
|
@@ -1,8 +0,0 @@
-#!/bin/sh
-#
-# An example hook script to prepare a packed repository for use over
-# dumb transports.
-#
-# To enable this hook, rename this file to "post-update".
-
-exec git update-server-info
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/hooks/pre-applypatch.sample
^
|
@@ -1,14 +0,0 @@
-#!/bin/sh
-#
-# An example hook script to verify what is about to be committed
-# by applypatch from an e-mail message.
-#
-# The hook should exit with non-zero status after issuing an
-# appropriate message if it wants to stop the commit.
-#
-# To enable this hook, rename this file to "pre-applypatch".
-
-. git-sh-setup
-test -x "$GIT_DIR/hooks/pre-commit" &&
- exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"}
-:
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/hooks/pre-commit.sample
^
|
@@ -1,50 +0,0 @@
-#!/bin/sh
-#
-# An example hook script to verify what is about to be committed.
-# Called by "git commit" with no arguments. The hook should
-# exit with non-zero status after issuing an appropriate message if
-# it wants to stop the commit.
-#
-# To enable this hook, rename this file to "pre-commit".
-
-if git rev-parse --verify HEAD >/dev/null 2>&1
-then
- against=HEAD
-else
- # Initial commit: diff against an empty tree object
- against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
-fi
-
-# If you want to allow non-ascii filenames set this variable to true.
-allownonascii=$(git config hooks.allownonascii)
-
-# Redirect output to stderr.
-exec 1>&2
-
-# Cross platform projects tend to avoid non-ascii filenames; prevent
-# them from being added to the repository. We exploit the fact that the
-# printable range starts at the space character and ends with tilde.
-if [ "$allownonascii" != "true" ] &&
- # Note that the use of brackets around a tr range is ok here, (it's
- # even required, for portability to Solaris 10's /usr/bin/tr), since
- # the square bracket bytes happen to fall in the designated range.
- test $(git diff --cached --name-only --diff-filter=A -z $against |
- LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
-then
- echo "Error: Attempt to add a non-ascii file name."
- echo
- echo "This can cause problems if you want to work"
- echo "with people on other platforms."
- echo
- echo "To be portable it is advisable to rename the file ..."
- echo
- echo "If you know what you are doing you can disable this"
- echo "check using:"
- echo
- echo " git config hooks.allownonascii true"
- echo
- exit 1
-fi
-
-# If there are whitespace errors, print the offending file names and fail.
-exec git diff-index --check --cached $against --
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/hooks/pre-rebase.sample
^
|
@@ -1,169 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2006, 2008 Junio C Hamano
-#
-# The "pre-rebase" hook is run just before "git rebase" starts doing
-# its job, and can prevent the command from running by exiting with
-# non-zero status.
-#
-# The hook is called with the following parameters:
-#
-# $1 -- the upstream the series was forked from.
-# $2 -- the branch being rebased (or empty when rebasing the current branch).
-#
-# This sample shows how to prevent topic branches that are already
-# merged to 'next' branch from getting rebased, because allowing it
-# would result in rebasing already published history.
-
-publish=next
-basebranch="$1"
-if test "$#" = 2
-then
- topic="refs/heads/$2"
-else
- topic=`git symbolic-ref HEAD` ||
- exit 0 ;# we do not interrupt rebasing detached HEAD
-fi
-
-case "$topic" in
-refs/heads/??/*)
- ;;
-*)
- exit 0 ;# we do not interrupt others.
- ;;
-esac
-
-# Now we are dealing with a topic branch being rebased
-# on top of master. Is it OK to rebase it?
-
-# Does the topic really exist?
-git show-ref -q "$topic" || {
- echo >&2 "No such branch $topic"
- exit 1
-}
-
-# Is topic fully merged to master?
-not_in_master=`git rev-list --pretty=oneline ^master "$topic"`
-if test -z "$not_in_master"
-then
- echo >&2 "$topic is fully merged to master; better remove it."
- exit 1 ;# we could allow it, but there is no point.
-fi
-
-# Is topic ever merged to next? If so you should not be rebasing it.
-only_next_1=`git rev-list ^master "^$topic" ${publish} | sort`
-only_next_2=`git rev-list ^master ${publish} | sort`
-if test "$only_next_1" = "$only_next_2"
-then
- not_in_topic=`git rev-list "^$topic" master`
- if test -z "$not_in_topic"
- then
- echo >&2 "$topic is already up-to-date with master"
- exit 1 ;# we could allow it, but there is no point.
- else
- exit 0
- fi
-else
- not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"`
- /usr/bin/perl -e '
- my $topic = $ARGV[0];
- my $msg = "* $topic has commits already merged to public branch:\n";
- my (%not_in_next) = map {
- /^([0-9a-f]+) /;
- ($1 => 1);
- } split(/\n/, $ARGV[1]);
- for my $elem (map {
- /^([0-9a-f]+) (.*)$/;
- [$1 => $2];
- } split(/\n/, $ARGV[2])) {
- if (!exists $not_in_next{$elem->[0]}) {
- if ($msg) {
- print STDERR $msg;
- undef $msg;
- }
- print STDERR " $elem->[1]\n";
- }
- }
- ' "$topic" "$not_in_next" "$not_in_master"
- exit 1
-fi
-
-exit 0
-
-################################################################
-
-This sample hook safeguards topic branches that have been
-published from being rewound.
-
-The workflow assumed here is:
-
- * Once a topic branch forks from "master", "master" is never
- merged into it again (either directly or indirectly).
-
- * Once a topic branch is fully cooked and merged into "master",
- it is deleted. If you need to build on top of it to correct
- earlier mistakes, a new topic branch is created by forking at
- the tip of the "master". This is not strictly necessary, but
- it makes it easier to keep your history simple.
-
- * Whenever you need to test or publish your changes to topic
- branches, merge them into "next" branch.
-
-The script, being an example, hardcodes the publish branch name
-to be "next", but it is trivial to make it configurable via
-$GIT_DIR/config mechanism.
-
-With this workflow, you would want to know:
-
-(1) ... if a topic branch has ever been merged to "next". Young
- topic branches can have stupid mistakes you would rather
- clean up before publishing, and things that have not been
- merged into other branches can be easily rebased without
- affecting other people. But once it is published, you would
- not want to rewind it.
-
-(2) ... if a topic branch has been fully merged to "master".
- Then you can delete it. More importantly, you should not
- build on top of it -- other people may already want to
- change things related to the topic as patches against your
- "master", so if you need further changes, it is better to
- fork the topic (perhaps with the same name) afresh from the
- tip of "master".
-
-Let's look at this example:
-
- o---o---o---o---o---o---o---o---o---o "next"
- / / / /
- / a---a---b A / /
- / / / /
- / / c---c---c---c B /
- / / / \ /
- / / / b---b C \ /
- / / / / \ /
- ---o---o---o---o---o---o---o---o---o---o---o "master"
-
-
-A, B and C are topic branches.
-
- * A has one fix since it was merged up to "next".
-
- * B has finished. It has been fully merged up to "master" and "next",
- and is ready to be deleted.
-
- * C has not merged to "next" at all.
-
-We would want to allow C to be rebased, refuse A, and encourage
-B to be deleted.
-
-To compute (1):
-
- git rev-list ^master ^topic next
- git rev-list ^master next
-
- if these match, topic has not merged in next at all.
-
-To compute (2):
-
- git rev-list master..topic
-
- if this is empty, it is fully merged to "master".
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/hooks/prepare-commit-msg.sample
^
|
@@ -1,36 +0,0 @@
-#!/bin/sh
-#
-# An example hook script to prepare the commit log message.
-# Called by "git commit" with the name of the file that has the
-# commit message, followed by the description of the commit
-# message's source. The hook's purpose is to edit the commit
-# message file. If the hook fails with a non-zero status,
-# the commit is aborted.
-#
-# To enable this hook, rename this file to "prepare-commit-msg".
-
-# This hook includes three examples. The first comments out the
-# "Conflicts:" part of a merge commit.
-#
-# The second includes the output of "git diff --name-status -r"
-# into the message, just before the "git status" output. It is
-# commented because it doesn't cope with --amend or with squashed
-# commits.
-#
-# The third example adds a Signed-off-by line to the message, that can
-# still be edited. This is rarely a good idea.
-
-case "$2,$3" in
- merge,)
- /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;;
-
-# ,|template,)
-# /usr/bin/perl -i.bak -pe '
-# print "\n" . `git diff --cached --name-status -r`
-# if /^#/ && $first++ == 0' "$1" ;;
-
- *) ;;
-esac
-
-# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
-# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/hooks/update.sample
^
|
@@ -1,128 +0,0 @@
-#!/bin/sh
-#
-# An example hook script to blocks unannotated tags from entering.
-# Called by "git receive-pack" with arguments: refname sha1-old sha1-new
-#
-# To enable this hook, rename this file to "update".
-#
-# Config
-# ------
-# hooks.allowunannotated
-# This boolean sets whether unannotated tags will be allowed into the
-# repository. By default they won't be.
-# hooks.allowdeletetag
-# This boolean sets whether deleting tags will be allowed in the
-# repository. By default they won't be.
-# hooks.allowmodifytag
-# This boolean sets whether a tag may be modified after creation. By default
-# it won't be.
-# hooks.allowdeletebranch
-# This boolean sets whether deleting branches will be allowed in the
-# repository. By default they won't be.
-# hooks.denycreatebranch
-# This boolean sets whether remotely creating branches will be denied
-# in the repository. By default this is allowed.
-#
-
-# --- Command line
-refname="$1"
-oldrev="$2"
-newrev="$3"
-
-# --- Safety check
-if [ -z "$GIT_DIR" ]; then
- echo "Don't run this script from the command line." >&2
- echo " (if you want, you could supply GIT_DIR then run" >&2
- echo " $0 <ref> <oldrev> <newrev>)" >&2
- exit 1
-fi
-
-if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
- echo "Usage: $0 <ref> <oldrev> <newrev>" >&2
- exit 1
-fi
-
-# --- Config
-allowunannotated=$(git config --bool hooks.allowunannotated)
-allowdeletebranch=$(git config --bool hooks.allowdeletebranch)
-denycreatebranch=$(git config --bool hooks.denycreatebranch)
-allowdeletetag=$(git config --bool hooks.allowdeletetag)
-allowmodifytag=$(git config --bool hooks.allowmodifytag)
-
-# check for no description
-projectdesc=$(sed -e '1q' "$GIT_DIR/description")
-case "$projectdesc" in
-"Unnamed repository"* | "")
- echo "*** Project description file hasn't been set" >&2
- exit 1
- ;;
-esac
-
-# --- Check types
-# if $newrev is 0000...0000, it's a commit to delete a ref.
-zero="0000000000000000000000000000000000000000"
-if [ "$newrev" = "$zero" ]; then
- newrev_type=delete
-else
- newrev_type=$(git cat-file -t $newrev)
-fi
-
-case "$refname","$newrev_type" in
- refs/tags/*,commit)
- # un-annotated tag
- short_refname=${refname##refs/tags/}
- if [ "$allowunannotated" != "true" ]; then
- echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2
- echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
- exit 1
- fi
- ;;
- refs/tags/*,delete)
- # delete tag
- if [ "$allowdeletetag" != "true" ]; then
- echo "*** Deleting a tag is not allowed in this repository" >&2
- exit 1
- fi
- ;;
- refs/tags/*,tag)
- # annotated tag
- if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1
- then
- echo "*** Tag '$refname' already exists." >&2
- echo "*** Modifying a tag is not allowed in this repository." >&2
- exit 1
- fi
- ;;
- refs/heads/*,commit)
- # branch
- if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then
- echo "*** Creating a branch is not allowed in this repository" >&2
- exit 1
- fi
- ;;
- refs/heads/*,delete)
- # delete branch
- if [ "$allowdeletebranch" != "true" ]; then
- echo "*** Deleting a branch is not allowed in this repository" >&2
- exit 1
- fi
- ;;
- refs/remotes/*,commit)
- # tracking branch
- ;;
- refs/remotes/*,delete)
- # delete tracking branch
- if [ "$allowdeletebranch" != "true" ]; then
- echo "*** Deleting a tracking branch is not allowed in this repository" >&2
- exit 1
- fi
- ;;
- *)
- # Anything else (is there anything else?)
- echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2
- exit 1
- ;;
-esac
-
-# --- Finished
-exit 0
|
|
Deleted |
memcached-3.0.0b1.tgz/.git/index
^
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/info
^
|
-(directory)
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/info/exclude
^
|
@@ -1,6 +0,0 @@
-# git ls-files --others --exclude-from=.git/info/exclude
-# Lines that start with '#' are comments.
-# For a project mostly in C, the following would be a good set of
-# exclude patterns (uncomment them if you want to use them):
-# *.[oa]
-# *~
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/logs
^
|
-(directory)
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/logs/HEAD
^
|
@@ -1 +0,0 @@
-0000000000000000000000000000000000000000 6ee96cad7be5caa1f13a1f3e5a4d5f900b9c04ce Local OBS User <obs@mgmt-desk.obs.j0ke.net> 1461307997 +0200 clone: from https://github.com/php-memcached-dev/php-memcached.git
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/logs/refs
^
|
-(directory)
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/logs/refs/heads
^
|
-(directory)
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/logs/refs/heads/php7
^
|
@@ -1 +0,0 @@
-0000000000000000000000000000000000000000 6ee96cad7be5caa1f13a1f3e5a4d5f900b9c04ce Local OBS User <obs@mgmt-desk.obs.j0ke.net> 1461307997 +0200 clone: from https://github.com/php-memcached-dev/php-memcached.git
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/logs/refs/remotes
^
|
-(directory)
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/logs/refs/remotes/origin
^
|
-(directory)
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/logs/refs/remotes/origin/HEAD
^
|
@@ -1 +0,0 @@
-0000000000000000000000000000000000000000 65ebcd5d62d6e374dadf6c335ba1736855e56f71 Local OBS User <obs@mgmt-desk.obs.j0ke.net> 1461307997 +0200 clone: from https://github.com/php-memcached-dev/php-memcached.git
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/objects
^
|
-(directory)
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/objects/info
^
|
-(directory)
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/objects/pack
^
|
-(directory)
|
|
Deleted |
memcached-3.0.0b1.tgz/.git/objects/pack/pack-cb89c0ef3a008449e7a22d3e6432e6fbbd3cdebf.idx
^
|
|
Deleted |
memcached-3.0.0b1.tgz/.git/objects/pack/pack-cb89c0ef3a008449e7a22d3e6432e6fbbd3cdebf.pack
^
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/packed-refs
^
|
@@ -1,37 +0,0 @@
-# pack-refs with: peeled
-6363a1499aa02a904556a9ae75938def9ae6ae24 refs/remotes/origin/REL1_0
-0c96d761024f62632ba9cb82e65819a3f4b229ac refs/remotes/origin/gh-pages
-65ebcd5d62d6e374dadf6c335ba1736855e56f71 refs/remotes/origin/master
-6ee96cad7be5caa1f13a1f3e5a4d5f900b9c04ce refs/remotes/origin/php7
-37555747253fd9932bebe40f8bb8ac10ebf8ce7e refs/remotes/origin/travis
-7ad95cc555ea045e6f91852a1ee93c4348587edb refs/tags/2.2.0
-03811a17f4e7eb0536a4ee3d72e096077baf2464 refs/tags/2.2.0RC1
-a555e381f063bacfeb8d71defa9e0d4d861952e4 refs/tags/2.2.0b1
-19af5302d43d866bb6552914012d496821f697a3 refs/tags/r2.0.0
-^384ade6cd7e2b0faa210e023ee202abc29332f34
-a2bdd9abbc6aedad519a929be01fbd86bb93a9ae refs/tags/r2.0.1
-^aeb14874972836ef2fadb1e7633cd85c3ea25e8e
-8c40cceee72fc3b974bcaa18902908684d6bdddc refs/tags/r2.1.0
-^09791df73d23fa7d182660e23ffbbf0753f2b2fa
-4250ac5a763f2463a3a824c8fcda33da6150b4d2 refs/tags/v0.1.0
-^792f217815c1181b3e744585ad96797870fa3064
-b0102d8f8341ca4c02811472aa9a01f2340f760c refs/tags/v0.1.1
-^15e8da9149d75fc1dd46c1b0594c3de859678ef3
-0d74180d5a64c1dfe5e7f79a688f5912fcd1c276 refs/tags/v0.1.2
-^b90130c1a66f3e479b796e8524d4eeacaee088e5
-6e3e1b5e26cc531b1330af017df7334417bf981f refs/tags/v0.1.3
-^7df4b0e9b3fadc09e663889a67a128ed015667b5
-d98d4c790174a3b7b945e4957b4471677ae4e80b refs/tags/v0.1.4
-^2c9a0d92c0d9257f1bbff4db0bf7d8eb24489877
-77ac5e2ab938b9a368f050efc9d6a869428d90eb refs/tags/v0.1.5
-^7edcdf94dd71076ea2b3e8f40e4b47c3680e8bc4
-20cdc861d165f81eab2bc781b637a68f13db65fc refs/tags/v0.2.0
-^da40d574f9499c5353bfd4bfa30dfa0a404de5bc
-83143af292ec59be22cc75fb498093cf43ec143a refs/tags/v1.0.0
-^9d4cdd502206894efb53ca192169ce6dba9781c3
-43b5b5ae6583b1040fd0edc0c5edca22db3b7b7d refs/tags/v1.0.1
-^011afc7462a7ee812028840fa22e573f3c97ad0b
-fdb53ec3ddce4a268cbcc034e706adab191da16b refs/tags/v1.0.2
-^f2718bee43d1a4f9df9bc1a41d0d3ce2b0bba1f6
-3b33e193b984fe9ea8660bb9221f3c012687f453 refs/tags/v2.0.0b2
-^1416a09d1d0e78cea5fec227744c1fe7b352017b
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/refs
^
|
-(directory)
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/refs/heads
^
|
-(directory)
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/refs/heads/php7
^
|
@@ -1 +0,0 @@
-6ee96cad7be5caa1f13a1f3e5a4d5f900b9c04ce
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/refs/remotes
^
|
-(directory)
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/refs/remotes/origin
^
|
-(directory)
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/refs/remotes/origin/HEAD
^
|
@@ -1 +0,0 @@
-ref: refs/remotes/origin/master
|
[-]
[+]
|
Deleted |
memcached-3.0.0b1.tgz/.git/refs/tags
^
|
-(directory)
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/.travis.yml
^
|
@@ -34,4 +34,4 @@
directories:
- $HOME/cache
-
\ No newline at end of file
+
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/.travis/travis.sh
^
|
@@ -67,8 +67,8 @@
}
function install_igbinary() {
- git clone https://github.com/igbinary/igbinary7.git
- pushd igbinary7
+ git clone https://github.com/igbinary/igbinary.git
+ pushd igbinary
phpize
./configure
make
@@ -79,6 +79,7 @@
function install_msgpack() {
git clone https://github.com/msgpack/msgpack-php.git
pushd msgpack-php
+ git checkout master
phpize
./configure
make
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/README.markdown
^
|
@@ -23,4 +23,4 @@
---------
* [libmemcached](http://libmemcached.org/libMemcached.html)
* [memcached](http://memcached.org/)
- * [igbinary](https://github.com/phadej/igbinary/)
+ * [igbinary](https://github.com/igbinary/igbinary)
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/memcached.ini
^
|
@@ -63,9 +63,11 @@
; which could have old data or no data at all
memcached.sess_number_of_replicas = 0
-; memcached session binary mode
-; libmemcached replicas only work if binary mode is enabled
-memcached.sess_binary = Off
+; Use the memcached binary protocol for memcached sessions (Instead of the text protocol)
+; libmemcached replicas work only if binary mode is enabled.
+; However, certain proxies (such as twemproxy) will work only if the binary protocol is disabled.
+; Default is On. In older versions of php-memcached, this setting was Off and was called memcached.sess_binary.
+memcached.sess_binary_protocol = On
; memcached session replica read randomize
memcached.sess_randomize_replica_read = Off
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/php_memcached.c
^
|
@@ -19,7 +19,6 @@
/* TODO
* - set LIBKETAMA_COMPATIBLE as the default?
* - fix unserialize(serialize($memc))
- * - ability to set binary protocol for sessions
*/
#include "php_memcached.h"
@@ -58,16 +57,18 @@
#define MEMC_G(v) (php_memcached_globals.memc.v)
#endif
- static
- int le_memc;
+static int le_memc;
-static
-int php_memc_list_entry(void)
-{
+static int php_memc_list_entry(void) {
return le_memc;
}
/****************************************
+ Protocol parameters
+****************************************/
+#define MEMC_OBJECT_KEY_MAX_LENGTH 250
+
+/****************************************
Custom options
****************************************/
#define MEMC_OPT_COMPRESSION -1001
@@ -201,14 +202,34 @@
} \
memc_user_data = (php_memc_user_data_t *) memcached_get_user_data(intern->memc);
+#define MEMC_CHECK_KEY(intern, key) \
+ if (UNEXPECTED(ZSTR_LEN(key) == 0 || \
+ ZSTR_LEN(key) > MEMC_OBJECT_KEY_MAX_LENGTH || \
+ (memcached_behavior_get(intern->memc, \
+ MEMCACHED_BEHAVIOR_BINARY_PROTOCOL) ? \
+ strchr(ZSTR_VAL(key), '\n') : \
+ strchr(ZSTR_VAL(key), ' ')))) { \
+ intern->rescode = MEMCACHED_BAD_KEY_PROVIDED; \
+ RETURN_FALSE; \
+ }
#ifdef HAVE_MEMCACHED_PROTOCOL
typedef struct {
- zend_object zo;
php_memc_proto_handler_t *handler;
+ zend_object zo;
} php_memc_server_t;
+static inline php_memc_server_t *php_memc_server_fetch_object(zend_object *obj) {
+ return (php_memc_server_t *)((char *)obj - XtOffsetOf(php_memc_server_t, zo));
+}
+#define Z_MEMC_SERVER_P(zv) php_memc_server_fetch_object(Z_OBJ_P(zv))
+
+#ifdef ZTS
+#define MEMC_SERVER_G(v) TSRMG(php_memcached_globals_id, zend_php_memcached_globals *, server.v)
+#else
+#define MEMC_SERVER_G(v) (php_memcached_globals.server.v)
+#endif
#endif
static zend_class_entry *memcached_ce = NULL;
@@ -236,9 +257,9 @@
{
if (!new_value) {
MEMC_G(compression_type) = COMPRESSION_TYPE_FASTLZ;
- } else if (!strcmp(new_value->val, "fastlz")) {
+ } else if (!strcmp(ZSTR_VAL(new_value), "fastlz")) {
MEMC_G(compression_type) = COMPRESSION_TYPE_FASTLZ;
- } else if (!strcmp(new_value->val, "zlib")) {
+ } else if (!strcmp(ZSTR_VAL(new_value), "zlib")) {
MEMC_G(compression_type) = COMPRESSION_TYPE_ZLIB;
} else {
return FAILURE;
@@ -250,20 +271,20 @@
{
if (!new_value) {
MEMC_G(serializer_type) = SERIALIZER_DEFAULT;
- } else if (!strcmp(new_value->val, "php")) {
+ } else if (!strcmp(ZSTR_VAL(new_value), "php")) {
MEMC_G(serializer_type) = SERIALIZER_PHP;
#ifdef HAVE_MEMCACHED_IGBINARY
- } else if (!strcmp(new_value->val, "igbinary")) {
+ } else if (!strcmp(ZSTR_VAL(new_value), "igbinary")) {
MEMC_G(serializer_type) = SERIALIZER_IGBINARY;
#endif // IGBINARY
#ifdef HAVE_JSON_API
- } else if (!strcmp(new_value->val, "json")) {
+ } else if (!strcmp(ZSTR_VAL(new_value), "json")) {
MEMC_G(serializer_type) = SERIALIZER_JSON;
- } else if (!strcmp(new_value->val, "json_array")) {
+ } else if (!strcmp(ZSTR_VAL(new_value), "json_array")) {
MEMC_G(serializer_type) = SERIALIZER_JSON_ARRAY;
#endif // JSON
#ifdef HAVE_MEMCACHED_MSGPACK
- } else if (!strcmp(new_value->val, "msgpack")) {
+ } else if (!strcmp(ZSTR_VAL(new_value), "msgpack")) {
MEMC_G(serializer_type) = SERIALIZER_MSGPACK;
#endif // msgpack
} else {
@@ -276,7 +297,7 @@
static
PHP_INI_MH(OnUpdateDeprecatedLockValue)
{
- if (new_value->len > 0 && strcmp(new_value->val, "not set")) {
+ if (ZSTR_LEN(new_value) > 0 && strcmp(ZSTR_VAL(new_value), "not set")) {
php_error_docref(NULL, E_DEPRECATED, "memcached.sess_lock_wait and memcached.sess_lock_max_wait are deprecated. Please update your configuration to use memcached.sess_lock_wait_min, memcached.sess_lock_wait_max and memcached.sess_lock_retries");
}
return FAILURE;
@@ -285,8 +306,8 @@
static
PHP_INI_MH(OnUpdateSessionPrefixString)
{
- if (new_value && new_value->len > 0) {
- char *ptr = new_value->val;
+ if (new_value && ZSTR_LEN(new_value) > 0) {
+ char *ptr = ZSTR_VAL(new_value);
while (*ptr != '\0') {
if (isspace (*ptr++)) {
@@ -294,7 +315,7 @@
return FAILURE;
}
}
- if (new_value->len > MEMCACHED_MAX_KEY) {
+ if (ZSTR_LEN(new_value) > MEMCACHED_MAX_KEY) {
php_error_docref(NULL, E_WARNING, "memcached.sess_prefix too long (max: %d)", MEMCACHED_MAX_KEY - 1);
return FAILURE;
}
@@ -364,14 +385,13 @@
static void php_memc_getDelayed_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool by_key);
/* Invoke PHP functions */
-static
- zend_bool s_invoke_cache_callback(zval *zobject, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string *key, zval *value);
+static zend_bool s_invoke_cache_callback(zval *zobject, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_bool with_cas, zend_string *key, zval *value);
/* Iterate result sets */
typedef zend_bool (*php_memc_result_apply_fn)(php_memc_object_t *intern, zend_string *key, zval *value, zval *cas, uint32_t flags, void *context);
static
-memcached_return php_memc_result_apply(php_memc_object_t *intern, php_memc_result_apply_fn result_apply_fn, void *context);
+memcached_return php_memc_result_apply(php_memc_object_t *intern, php_memc_result_apply_fn result_apply_fn, zend_bool fetch_delay, void *context);
static
zend_bool php_memc_mget_apply(php_memc_object_t *intern, zend_string *server_key,
@@ -431,13 +451,13 @@
char *buffer = NULL;
if (fci->object) {
- spprintf (&buffer, 0, "%s::%s", fci->object->ce->name->val, fci_cache->function_handler->common.function_name);
+ spprintf (&buffer, 0, "%s::%s", ZSTR_VAL(fci->object->ce->name), fci_cache->function_handler->common.function_name);
} else {
if (Z_TYPE (fci->function_name) == IS_OBJECT) {
- spprintf (&buffer, 0, "%s", Z_OBJCE (fci->function_name)->name->val);
+ spprintf (&buffer, 0, "%s", ZSTR_VAL(Z_OBJCE(fci->function_name)->name));
}
else {
- spprintf (&buffer, 0, "%s", Z_STRVAL (fci->function_name));
+ spprintf (&buffer, 0, "%s", Z_STRVAL(fci->function_name));
}
}
return buffer;
@@ -514,15 +534,14 @@
void s_uint64_to_zval (zval *target, uint64_t value)
{
if (value >= ((uint64_t) LONG_MAX)) {
- char *buffer;
+ zend_string *buffer;
#ifdef PRIu64
- spprintf (&buffer, 0, "%" PRIu64, value);
+ buffer = strpprintf (0, "%" PRIu64, value);
#else
/* Best effort */
- spprintf (&buffer, 0, "%llu", value);
+ buffer = strpprintf (0, "%llu", value);
#endif
- ZVAL_STRING (target, buffer);
- efree(buffer);
+ ZVAL_STR(target, buffer);
}
else {
ZVAL_LONG (target, (zend_long) value);
@@ -569,7 +588,7 @@
****************************************/
static
-memcached_return php_memc_result_apply(php_memc_object_t *intern, php_memc_result_apply_fn result_apply_fn, void *context)
+memcached_return php_memc_result_apply(php_memc_object_t *intern, php_memc_result_apply_fn result_apply_fn, zend_bool fetch_delay, void *context)
{
memcached_result_st result, *result_ptr;
memcached_return rc, status = MEMCACHED_SUCCESS;
@@ -589,7 +608,7 @@
}
else {
zend_string *key;
- zval zv_value, zv_cas;
+ zval val, zcas;
zend_bool retval;
uint64_t cas;
@@ -598,13 +617,7 @@
const char *res_key;
size_t res_key_len;
-
- ZVAL_UNDEF(&zv_value);
- if (!s_memcached_result_to_zval(intern->memc, &result, &zv_value)) {
- if (Z_TYPE(zv_value) != IS_UNDEF) {
- zval_ptr_dtor(&zv_value);
- }
-
+ if (!s_memcached_result_to_zval(intern->memc, &result, &val)) {
if (EG(exception)) {
status = MEMC_RES_PAYLOAD_FAILURE;
memcached_quit(intern->memc);
@@ -619,19 +632,21 @@
cas = memcached_result_cas(&result);
flags = memcached_result_flags(&result);
- s_uint64_to_zval(&zv_cas, cas);
+ s_uint64_to_zval(&zcas, cas);
key = zend_string_init (res_key, res_key_len, 0);
- retval = result_apply_fn(intern, key, &zv_value, &zv_cas, flags, context);
+ retval = result_apply_fn(intern, key, &val, &zcas, flags, context);
- zend_string_release (key);
- zval_ptr_dtor(&zv_value);
- zval_ptr_dtor(&zv_cas);
+ zend_string_release(key);
+ zval_ptr_dtor(&val);
+ zval_ptr_dtor(&zcas);
/* Stop iterating on false */
if (!retval) {
- /* Make sure we clear our results */
- while (memcached_fetch_result(intern->memc, &result, &rc)) {}
+ if (!fetch_delay) {
+ /* Make sure we clear our results */
+ while (memcached_fetch_result(intern->memc, &result, &rc)) {}
+ }
break;
}
}
@@ -646,7 +661,6 @@
php_memc_result_apply_fn result_apply_fn, zend_bool with_cas, void *context)
{
memcached_return status;
- memcached_result_st result;
int mget_status;
uint64_t orig_cas_flag = 0;
@@ -667,7 +681,7 @@
}
if (server_key) {
- status = memcached_mget_by_key(intern->memc, server_key->val, server_key->len, keys->mkeys, keys->mkeys_len, keys->num_valid_keys);
+ status = memcached_mget_by_key(intern->memc, ZSTR_VAL(server_key), ZSTR_LEN(server_key), keys->mkeys, keys->mkeys_len, keys->num_valid_keys);
} else {
status = memcached_mget(intern->memc, keys->mkeys, keys->mkeys_len, keys->num_valid_keys);
}
@@ -689,7 +703,7 @@
return 1;
}
- status = php_memc_result_apply(intern, result_apply_fn, context);
+ status = php_memc_result_apply(intern, result_apply_fn, 0, context);
if (s_memc_status_handle_result_code(intern, status) == FAILURE) {
return 0;
@@ -706,19 +720,19 @@
zend_bool s_invoke_new_instance_cb(zval *object, zend_fcall_info *fci, zend_fcall_info_cache *fci_cache, zend_string *persistent_id)
{
zend_bool ret = 1;
- zval retval, id;
+ zval retval;
+ zval params[2];
+ ZVAL_COPY(¶ms[0], object);
if (persistent_id) {
- ZVAL_STR(&id, persistent_id);
+ ZVAL_STR(¶ms[1], zend_string_copy(persistent_id));
} else {
- ZVAL_NULL(&id);
+ ZVAL_NULL(¶ms[1]);
}
- ZVAL_UNDEF(&retval);
-
- zend_fcall_info_argn(fci, 2, object, &id);
- fci->retval = &retval;
- fci->no_separation = 1;
+ fci->retval = &retval;
+ fci->params = params;
+ fci->param_count = 2;
if (zend_call_function(fci, fci_cache) == FAILURE) {
char *buf = php_memc_printable_func (fci, fci_cache);
@@ -727,71 +741,73 @@
ret = 0;
}
- if (Z_TYPE(retval) != IS_UNDEF) {
- zval_ptr_dtor(&retval);
- }
-
- if (EG(exception)) {
- ret = 0;
- }
+ zval_ptr_dtor(¶ms[0]);
+ zval_ptr_dtor(¶ms[1]);
+ zval_ptr_dtor(&retval);
- zend_fcall_info_args_clear(fci, 1);
return ret;
}
static
-zend_bool s_invoke_cache_callback(zval *zobject, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string *key, zval *value)
+zend_bool s_invoke_cache_callback(zval *zobject, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_bool with_cas, zend_string *key, zval *value)
{
- memcached_return rc;
zend_bool status = 0;
-
zval params[4];
zval retval;
- zval zv_key, ref_val;
- zval ref_expiration, zv_expiration;
php_memc_object_t *intern = Z_MEMC_OBJ_P(zobject);
/* Prepare params */
- ZVAL_STR(&zv_key, key);
-
- ZVAL_NULL(&ref_val);
- ZVAL_NULL(&zv_expiration);
-
- ZVAL_NEW_REF(&ref_val, value);
- ZVAL_NEW_REF(&ref_expiration, &zv_expiration);
-
ZVAL_COPY(¶ms[0], zobject);
- ZVAL_COPY(¶ms[1], &zv_key);
- ZVAL_COPY_VALUE(¶ms[2], &ref_val);
- ZVAL_COPY_VALUE(¶ms[3], &ref_expiration);
+ ZVAL_STR_COPY(¶ms[1], key); /* key */
+ ZVAL_NEW_REF(¶ms[2], value); /* value */
+
+ if (with_cas) {
+ fci->param_count = 3;
+ } else {
+ ZVAL_NEW_EMPTY_REF(¶ms[3]); /* expiration */
+ ZVAL_NULL(Z_REFVAL(params[3]));
+ fci->param_count = 4;
+ }
fci->retval = &retval;
fci->params = params;
- fci->param_count = 4;
-
- ZVAL_UNDEF(&retval);
if (zend_call_function(fci, fcc) == SUCCESS) {
if (zend_is_true(&retval)) {
- time_t expiration = zval_get_long(Z_REFVAL(ref_expiration));
- status = s_memc_write_zval (intern, MEMC_OP_SET, NULL, key, Z_REFVAL(ref_val), expiration);
- ZVAL_DUP(value, Z_REFVAL(ref_val));
+ time_t expiration;
+ zval *val = Z_REFVAL(params[2]);
+
+ if (with_cas) {
+ if (Z_TYPE_P(val) == IS_ARRAY) {
+ zval *rv = zend_hash_str_find(Z_ARRVAL_P(val), "value", sizeof("value") - 1);
+ if (rv) {
+ zval *cas = zend_hash_str_find(Z_ARRVAL_P(val), "cas", sizeof("cas") -1);
+ expiration = cas? Z_LVAL_P(cas) : 0;
+ status = s_memc_write_zval (intern, MEMC_OP_SET, NULL, key, rv, expiration);
+ }
+ /* memleak? zval_ptr_dtor(value); */
+ ZVAL_COPY(value, val);
+ }
+ } else {
+ expiration = zval_get_long(Z_REFVAL(params[3]));
+ status = s_memc_write_zval (intern, MEMC_OP_SET, NULL, key, val, expiration);
+ /* memleak? zval_ptr_dtor(value); */
+ ZVAL_COPY(value, val);
+ }
}
}
else {
s_memc_set_status(intern, MEMCACHED_NOTFOUND, 0);
}
-
-
- zval_ptr_dtor(zobject);
- zval_ptr_dtor(&zv_key);
- zval_ptr_dtor(&ref_val);
- zval_ptr_dtor(&ref_expiration);
-
- if (!Z_ISUNDEF(retval)) {
- zval_ptr_dtor(&retval);
+ zval_ptr_dtor(¶ms[0]);
+ zval_ptr_dtor(¶ms[1]);
+ zval_ptr_dtor(¶ms[2]);
+ if (!with_cas) {
+ zval_ptr_dtor(¶ms[3]);
}
+ zval_ptr_dtor(&retval);
+
return status;
}
@@ -807,18 +823,18 @@
zend_string *payload = *payload_in;
/* Additional 5% for the data */
- size_t buffer_size = (size_t) (((double) payload->len * 1.05) + 1.0);
+ size_t buffer_size = (size_t) (((double) ZSTR_LEN(payload) * 1.05) + 1.0);
char *buffer = emalloc(buffer_size);
/* Store compressed size here */
size_t compressed_size = 0;
- uint32_t original_size = payload->len;
+ uint32_t original_size = ZSTR_LEN(payload);
switch (compression_type) {
case COMPRESSION_TYPE_FASTLZ:
{
- compressed_size = fastlz_compress(payload->val, payload->len, buffer);
+ compressed_size = fastlz_compress(ZSTR_VAL(payload), ZSTR_LEN(payload), buffer);
if (compressed_size > 0) {
compress_status = 1;
@@ -830,7 +846,7 @@
case COMPRESSION_TYPE_ZLIB:
{
compressed_size = buffer_size;
- int status = compress((Bytef *) buffer, &compressed_size, (Bytef *) payload->val, payload->len);
+ int status = compress((Bytef *) buffer, &compressed_size, (Bytef *) ZSTR_VAL(payload), ZSTR_LEN(payload));
if (status == Z_OK) {
compress_status = 1;
@@ -846,23 +862,23 @@
if (!compress_status) {
php_error_docref(NULL, E_WARNING, "could not compress value");
- MEMC_VAL_DEL_FLAG(*flags, MEMC_VAL_COMPRESSED);
efree (buffer);
return 0;
}
/* This means the value was too small to be compressed, still a success */
- if (compressed_size > (payload->len * MEMC_G(compression_factor))) {
- MEMC_VAL_DEL_FLAG(*flags, MEMC_VAL_COMPRESSED);
+ if (compressed_size > (ZSTR_LEN(payload) * MEMC_G(compression_factor))) {
efree (buffer);
return 1;
}
+ MEMC_VAL_SET_FLAG(*flags, MEMC_VAL_COMPRESSED);
+
payload = zend_string_realloc(payload, compressed_size + sizeof(uint32_t), 0);
/* Copy the uin32_t at the beginning */
- memcpy(payload->val, &original_size, sizeof(uint32_t));
- memcpy(payload->val + sizeof (uint32_t), buffer, compressed_size);
+ memcpy(ZSTR_VAL(payload), &original_size, sizeof(uint32_t));
+ memcpy(ZSTR_VAL(payload) + sizeof (uint32_t), buffer, compressed_size);
efree(buffer);
zend_string_forget_hash_val(payload);
@@ -1011,7 +1027,7 @@
zend_string_forget_hash_val(payload);
/* turn off compression for values below the threshold */
- if (payload->len == 0 || payload->len < MEMC_G(compression_threshold)) {
+ if (ZSTR_LEN(payload) == 0 || ZSTR_LEN(payload) < MEMC_G(compression_threshold)) {
should_compress = 0;
}
@@ -1022,7 +1038,6 @@
zend_string_release(payload);
return NULL;
}
- MEMC_VAL_SET_FLAG(*flags, MEMC_VAL_COMPRESSED);
}
if (memc_user_data->set_udf_flags >= 0) {
@@ -1060,8 +1075,8 @@
}
}
-#define memc_write_using_fn(fn_name) payload ? fn_name(intern->memc, key->val, key->len, payload->val, payload->len, expiration, flags) : MEMC_RES_PAYLOAD_FAILURE;
-#define memc_write_using_fn_by_key(fn_name) payload ? fn_name(intern->memc, server_key->val, server_key->len, key->val, key->len, payload->val, payload->len, expiration, flags) : MEMC_RES_PAYLOAD_FAILURE;
+#define memc_write_using_fn(fn_name) payload ? fn_name(intern->memc, ZSTR_VAL(key), ZSTR_LEN(key), ZSTR_VAL(payload), ZSTR_LEN(payload), expiration, flags) : MEMC_RES_PAYLOAD_FAILURE;
+#define memc_write_using_fn_by_key(fn_name) payload ? fn_name(intern->memc, ZSTR_VAL(server_key), ZSTR_LEN(server_key), ZSTR_VAL(key), ZSTR_LEN(key), ZSTR_VAL(payload), ZSTR_LEN(payload), expiration, flags) : MEMC_RES_PAYLOAD_FAILURE;
if (server_key) {
switch (op) {
@@ -1070,7 +1085,7 @@
break;
case MEMC_OP_TOUCH:
- status = memcached_touch_by_key(intern->memc, server_key->val, server_key->len, key->val, key->len, expiration);
+ status = memcached_touch_by_key(intern->memc, ZSTR_VAL(server_key), ZSTR_LEN(server_key), ZSTR_VAL(key), ZSTR_LEN(key), expiration);
break;
case MEMC_OP_ADD:
@@ -1102,7 +1117,7 @@
break;
case MEMC_OP_TOUCH:
- status = memcached_touch(intern->memc, key->val, key->len, expiration);
+ status = memcached_touch(intern->memc, ZSTR_VAL(key), ZSTR_LEN(key), expiration);
break;
case MEMC_OP_ADD:
@@ -1174,7 +1189,7 @@
zend_resource *le;
plist_key = zend_string_alloc(sizeof("memcached:id=") + persistent_id->len - 1, 0);
- snprintf(plist_key->val, plist_key->len + 1, "memcached:id=%s", persistent_id->val);
+ snprintf(ZSTR_VAL(plist_key), plist_key->len + 1, "memcached:id=%s", ZSTR_VAL(persistent_id));
if ((le = zend_hash_find_ptr(&EG(persistent_list), plist_key)) != NULL) {
if (le->type == php_memc_list_entry()) {
@@ -1188,7 +1203,7 @@
}
if (conn_str && conn_str->len > 0) {
- intern->memc = memcached (conn_str->val, conn_str->len);
+ intern->memc = memcached (ZSTR_VAL(conn_str), ZSTR_LEN(conn_str));
}
else {
intern->memc = memcached (NULL, 0);
@@ -1267,7 +1282,7 @@
GC_REFCOUNT(&le) = 1;
/* plist_key is not a persistent allocated key, thus we use str_update here */
- if (zend_hash_str_update_mem(&EG(persistent_list), plist_key->val, plist_key->len, &le, sizeof(le)) == NULL) {
+ if (zend_hash_str_update_mem(&EG(persistent_list), ZSTR_VAL(plist_key), ZSTR_LEN(plist_key), &le, sizeof(le)) == NULL) {
zend_string_release(plist_key);
php_error_docref(NULL, E_ERROR, "could not register persistent entry");
/* not reached */
@@ -1299,12 +1314,12 @@
zend_string *key = zval_get_string(zv);
if (preserve_order && return_value) {
- add_assoc_null_ex(return_value, key->val, key->len);
+ add_assoc_null_ex(return_value, ZSTR_VAL(key), ZSTR_LEN(key));
}
- if (key->len > 0 && key->len < MEMCACHED_MAX_KEY) {
- keys_out->mkeys[idx] = key->val;
- keys_out->mkeys_len[idx] = key->len;
+ if (ZSTR_LEN(key) > 0 && ZSTR_LEN(key) < MEMCACHED_MAX_KEY) {
+ keys_out->mkeys[idx] = ZSTR_VAL(key);
+ keys_out->mkeys_len[idx] = ZSTR_LEN(key);
keys_out->strings[idx] = key;
idx++;
@@ -1328,8 +1343,8 @@
{
zval zv_keys;
- array_init (&zv_keys);
- add_next_index_stringl (&zv_keys, key->val, key->len);
+ array_init(&zv_keys);
+ add_next_index_str(&zv_keys, zend_string_copy(key));
s_hash_to_keys(keys_out, Z_ARRVAL(zv_keys), 0, NULL);
zval_ptr_dtor(&zv_keys);
@@ -1372,7 +1387,7 @@
add_assoc_long (context->return_value, "flags", (zend_long) MEMC_VAL_GET_USER_FLAGS(flags));
}
else {
- ZVAL_ZVAL(context->return_value, value, 1, 0);
+ ZVAL_COPY(context->return_value, value);
}
return 0; /* Stop after one */
}
@@ -1385,7 +1400,7 @@
zend_long get_flags = 0;
zend_string *key;
zend_string *server_key = NULL;
- zend_bool extended, mget_status;
+ zend_bool mget_status;
memcached_return status = MEMCACHED_SUCCESS;
zend_fcall_info fci = empty_fcall_info;
zend_fcall_info_cache fcc = empty_fcall_info_cache;
@@ -1403,10 +1418,10 @@
MEMC_METHOD_FETCH_OBJECT;
s_memc_set_status(intern, MEMCACHED_SUCCESS, 0);
+ MEMC_CHECK_KEY(intern, key);
context.extended = (get_flags & MEMC_GET_EXTENDED);
- ZVAL_UNDEF(return_value);
context.return_value = return_value;
s_key_to_keys(&keys, key);
@@ -1415,7 +1430,7 @@
if (!mget_status) {
if (s_memc_status_has_result_code(intern, MEMCACHED_NOTFOUND) && fci.size > 0) {
- status = s_invoke_cache_callback(object, &fci, &fcc, key, return_value);
+ status = s_invoke_cache_callback(object, &fci, &fcc, context.extended, key, return_value);
if (!status) {
zval_ptr_dtor(return_value);
@@ -1458,15 +1473,15 @@
Z_TRY_ADDREF_P(cas);
- array_init (&node);
- add_assoc_zval (&node, "value", value);
- add_assoc_zval (&node, "cas", cas);
- add_assoc_long (&node, "flags", (zend_long) MEMC_VAL_GET_USER_FLAGS(flags));
+ array_init(&node);
+ add_assoc_zval(&node, "value", value);
+ add_assoc_zval(&node, "cas", cas);
+ add_assoc_long(&node, "flags", (zend_long) MEMC_VAL_GET_USER_FLAGS(flags));
- add_assoc_zval_ex(context->return_value, key->val, key->len, &node);
+ zend_symtable_update(Z_ARRVAL_P(context->return_value), key, &node);
}
else {
- add_assoc_zval_ex(context->return_value, key->val, key->len, value);
+ zend_symtable_update(Z_ARRVAL_P(context->return_value), key, value);
}
return 1;
}
@@ -1481,8 +1496,7 @@
zend_string *server_key = NULL;
zend_long flags = 0;
MEMC_METHOD_INIT_VARS;
-
- zend_bool with_cas, retval, preserve_order, extended;
+ zend_bool retval, preserve_order;
if (by_key) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sa|l", &server_key,
@@ -1496,9 +1510,15 @@
}
MEMC_METHOD_FETCH_OBJECT;
- s_memc_set_status(intern, MEMCACHED_SUCCESS, 0);
array_init(return_value);
+ if (zend_hash_num_elements(Z_ARRVAL_P(keys)) == 0) {
+ /* BC compatible */
+ s_memc_set_status(intern, MEMCACHED_NOTFOUND, 0);
+ return;
+ }
+
+ s_memc_set_status(intern, MEMCACHED_SUCCESS, 0);
preserve_order = (flags & MEMC_GET_PRESERVE_ORDER);
s_hash_to_keys(&keys_out, Z_ARRVAL_P(keys), preserve_order, return_value);
@@ -1560,44 +1580,43 @@
Z_TRY_ADDREF_P(value);
Z_TRY_ADDREF_P(cas);
- add_assoc_stringl_ex(return_value, ZEND_STRL("key"), key->val, key->len);
- add_assoc_zval_ex(return_value, ZEND_STRL("value"), value);
+ add_assoc_str_ex(return_value, ZEND_STRL("key"), zend_string_copy(key));
+ add_assoc_zval_ex(return_value, ZEND_STRL("value"), value);
- add_assoc_zval_ex(return_value, ZEND_STRL("cas"), cas);
- add_assoc_long_ex(return_value, ZEND_STRL("flags"), MEMC_VAL_GET_USER_FLAGS(flags));
+ if (Z_LVAL_P(cas)) {
+ /* BC compatible */
+ add_assoc_zval_ex(return_value, ZEND_STRL("cas"), cas);
+ add_assoc_long_ex(return_value, ZEND_STRL("flags"), MEMC_VAL_GET_USER_FLAGS(flags));
+ }
}
static
zend_bool s_result_callback_apply(php_memc_object_t *intern, zend_string *key, zval *value, zval *cas, uint32_t flags, void *in_context)
{
zend_bool status = 1;
-
- zval retval, zv_result;
+ zval params[2];
+ zval retval;
php_memc_result_callback_ctx_t *context = (php_memc_result_callback_ctx_t *) in_context;
- array_init(&zv_result);
- s_create_result_array(key, value, cas, flags, &zv_result);
+ ZVAL_COPY(¶ms[0], context->object);
+ array_init(¶ms[1]);
- zend_fcall_info_argn(&context->fci, 2, context->object, &zv_result);
+ s_create_result_array(key, value, cas, flags, ¶ms[1]);
context->fci.retval = &retval;
+ context->fci.params = params;
context->fci.param_count = 2;
- ZVAL_UNDEF(&retval);
if (zend_call_function(&context->fci, &context->fcc) == FAILURE) {
- if (Z_TYPE(retval) != IS_UNDEF) {
- zval_ptr_dtor(&retval);
- }
php_error_docref(NULL, E_WARNING, "could not invoke result callback");
status = 0;
}
- if (Z_TYPE(retval) != IS_UNDEF) {
- zval_ptr_dtor(&retval);
- }
+ zval_ptr_dtor(&retval);
+
+ zval_ptr_dtor(¶ms[0]);
+ zval_ptr_dtor(¶ms[1]);
- zend_fcall_info_args_clear(&context->fci, 2);
- zval_ptr_dtor(&zv_result);
return status;
}
@@ -1661,14 +1680,6 @@
Returns the next result from a previous delayed request */
PHP_METHOD(Memcached, fetch)
{
- const char *res_key = NULL;
- size_t res_key_len = 0;
- const char *payload = NULL;
- size_t payload_len = 0;
- uint32_t flags = 0;
- uint64_t cas = 0;
- zval value, zv_cas;
- memcached_result_st result;
memcached_return status = MEMCACHED_SUCCESS;
MEMC_METHOD_INIT_VARS;
@@ -1680,7 +1691,7 @@
s_memc_set_status(intern, MEMCACHED_SUCCESS, 0);
array_init(return_value);
- status = php_memc_result_apply(intern, s_fetch_apply, return_value);
+ status = php_memc_result_apply(intern, s_fetch_apply, 1, return_value);
if (s_memc_status_handle_result_code(intern, status) == FAILURE) {
zval_ptr_dtor(return_value);
@@ -1706,14 +1717,6 @@
Returns all the results from a previous delayed request */
PHP_METHOD(Memcached, fetchAll)
{
- const char *res_key = NULL;
- size_t res_key_len = 0;
- const char *payload = NULL;
- size_t payload_len = 0;
- uint32_t flags;
- uint64_t cas = 0;
- zval value, entry, zv_cas;
- memcached_result_st result;
memcached_return status = MEMCACHED_SUCCESS;
MEMC_METHOD_INIT_VARS;
@@ -1725,7 +1728,7 @@
s_memc_set_status(intern, MEMCACHED_SUCCESS, 0);
array_init(return_value);
- status = php_memc_result_apply(intern, s_fetch_all_apply, return_value);
+ status = php_memc_result_apply(intern, s_fetch_all_apply, 0, return_value);
if (s_memc_status_handle_result_code(intern, status) == FAILURE) {
zval_dtor(return_value);
@@ -1792,13 +1795,8 @@
zend_string *server_key = NULL;
time_t expiration = 0;
zval *value;
- zend_string *skey, *str_key = NULL;
- ulong num_key;
- zend_string *payload;
- uint32_t flags = 0;
- uint32_t retry = 0;
- memcached_return status;
- char tmp_key[MEMCACHED_MAX_KEY];
+ zend_string *skey;
+ zend_ulong num_key;
int tmp_len = 0;
MEMC_METHOD_INIT_VARS;
@@ -1817,8 +1815,7 @@
s_memc_set_status(intern, MEMCACHED_SUCCESS, 0);
ZEND_HASH_FOREACH_KEY_VAL (Z_ARRVAL_P(entries), num_key, skey, value) {
-
- zend_string *str_key;
+ zend_string *str_key = NULL;
if (skey) {
str_key = skey;
@@ -1831,7 +1828,7 @@
}
if (!s_memc_write_zval (intern, MEMC_OP_SET, server_key, str_key, value, expiration)) {
- php_error_docref(NULL, E_WARNING, "failed to set key %s", str_key->val);
+ php_error_docref(NULL, E_WARNING, "failed to set key %s", ZSTR_VAL(str_key));
}
if (!skey) {
@@ -1917,10 +1914,6 @@
zval s_zvalue;
zval *value = NULL;
zend_long expiration = 0;
- zend_string *payload = NULL;
- uint32_t flags = 0;
- uint32_t retry = 0;
- memcached_return status;
MEMC_METHOD_INIT_VARS;
if (by_key) {
@@ -1959,6 +1952,7 @@
MEMC_METHOD_FETCH_OBJECT;
s_memc_set_status(intern, MEMCACHED_SUCCESS, 0);
+ MEMC_CHECK_KEY(intern, key);
if (memc_user_data->compression_enabled) {
/*
@@ -2016,6 +2010,7 @@
MEMC_METHOD_FETCH_OBJECT;
s_memc_set_status(intern, MEMCACHED_SUCCESS, 0);
+ MEMC_CHECK_KEY(intern, key);
cas = s_zval_to_uint64(zv_cas);
@@ -2026,9 +2021,9 @@
}
if (by_key) {
- status = memcached_cas_by_key(intern->memc, server_key->val, server_key->len, key->val, key->len, payload->val, payload->len, expiration, flags, cas);
+ status = memcached_cas_by_key(intern->memc, ZSTR_VAL(server_key), ZSTR_LEN(server_key), ZSTR_VAL(key), ZSTR_LEN(key), ZSTR_VAL(payload), ZSTR_LEN(payload), expiration, flags, cas);
} else {
- status = memcached_cas(intern->memc, key->val, key->len, payload->val, payload->len, expiration, flags, cas);
+ status = memcached_cas(intern->memc, ZSTR_VAL(key), ZSTR_LEN(key), ZSTR_VAL(payload), ZSTR_LEN(payload), expiration, flags, cas);
}
zend_string_release(payload);
@@ -2109,12 +2104,13 @@
MEMC_METHOD_FETCH_OBJECT;
s_memc_set_status(intern, MEMCACHED_SUCCESS, 0);
+ MEMC_CHECK_KEY(intern, key);
if (by_key) {
- status = memcached_delete_by_key(intern->memc, server_key->val, server_key->len, key->val,
- key->len, expiration);
+ status = memcached_delete_by_key(intern->memc, ZSTR_VAL(server_key), ZSTR_LEN(server_key), ZSTR_VAL(key),
+ ZSTR_LEN(key), expiration);
} else {
- status = memcached_delete(intern->memc, key->val, key->len, expiration);
+ status = memcached_delete(intern->memc, ZSTR_VAL(key), ZSTR_LEN(key), expiration);
}
if (s_memc_status_handle_result_code(intern, status) == FAILURE) {
@@ -2128,10 +2124,10 @@
/* {{{ -- php_memc_deleteMulti_impl */
static void php_memc_deleteMulti_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool by_key)
{
- zval *entries;
+ zval *entries, *zv, ret;
zend_string *server_key = NULL;
time_t expiration = 0;
- zval *entry;
+ zend_string *entry;
memcached_return status;
MEMC_METHOD_INIT_VARS;
@@ -2150,27 +2146,27 @@
s_memc_set_status(intern, MEMCACHED_SUCCESS, 0);
array_init(return_value);
- ZEND_HASH_FOREACH_VAL (Z_ARRVAL_P(entries), entry) {
- if (Z_TYPE_P(entry) != IS_STRING) {
- convert_to_string_ex(entry);
- }
+ ZEND_HASH_FOREACH_VAL (Z_ARRVAL_P(entries), zv) {
+ entry = zval_get_string(zv);
- if (Z_STRLEN_P(entry) == 0) {
+ if (ZSTR_LEN(entry) == 0) {
+ zend_string_release(entry);
continue;
}
if (by_key) {
- status = memcached_delete_by_key(intern->memc, server_key->val, server_key->len, Z_STRVAL_P(entry), Z_STRLEN_P(entry), expiration);
+ status = memcached_delete_by_key(intern->memc, ZSTR_VAL(server_key), ZSTR_LEN(server_key), ZSTR_VAL(entry), ZSTR_LEN(entry), expiration);
} else {
- status = memcached_delete_by_key(intern->memc, Z_STRVAL_P(entry), Z_STRLEN_P(entry), Z_STRVAL_P(entry), Z_STRLEN_P(entry), expiration);
+ status = memcached_delete_by_key(intern->memc, ZSTR_VAL(entry), ZSTR_LEN(entry), ZSTR_VAL(entry), ZSTR_LEN(entry), expiration);
}
-
if (s_memc_status_handle_result_code(intern, status) == FAILURE) {
- add_assoc_long(return_value, Z_STRVAL_P(entry), status);
+ ZVAL_LONG(&ret, status);
} else {
- add_assoc_bool(return_value, Z_STRVAL_P(entry), 1);
+ ZVAL_TRUE(&ret);
}
+ zend_symtable_update(Z_ARRVAL_P(return_value), entry, &ret);
+ zend_string_release(entry);
} ZEND_HASH_FOREACH_END();
return;
@@ -2201,6 +2197,7 @@
MEMC_METHOD_FETCH_OBJECT;
s_memc_set_status(intern, MEMCACHED_SUCCESS, 0);
+ MEMC_CHECK_KEY(intern, key);
if (offset < 0) {
php_error_docref(NULL, E_WARNING, "offset has to be > 0");
@@ -2210,15 +2207,15 @@
if ((!by_key && n_args < 3) || (by_key && n_args < 4)) {
if (by_key) {
if (incr) {
- status = memcached_increment_by_key(intern->memc, server_key->val, server_key->len, key->val, key->len, (unsigned int)offset, &value);
+ status = memcached_increment_by_key(intern->memc, ZSTR_VAL(server_key), ZSTR_LEN(server_key), ZSTR_VAL(key), ZSTR_LEN(key), (unsigned int)offset, &value);
} else {
- status = memcached_decrement_by_key(intern->memc, server_key->val, server_key->len, key->val, key->len, (unsigned int)offset, &value);
+ status = memcached_decrement_by_key(intern->memc, ZSTR_VAL(server_key), ZSTR_LEN(server_key), ZSTR_VAL(key), ZSTR_LEN(key), (unsigned int)offset, &value);
}
} else {
if (incr) {
- status = memcached_increment(intern->memc, key->val, key->len, (unsigned int)offset, &value);
+ status = memcached_increment(intern->memc, ZSTR_VAL(key), ZSTR_LEN(key), (unsigned int)offset, &value);
} else {
- status = memcached_decrement(intern->memc, key->val, key->len, (unsigned int)offset, &value);
+ status = memcached_decrement(intern->memc, ZSTR_VAL(key), ZSTR_LEN(key), (unsigned int)offset, &value);
}
}
@@ -2232,15 +2229,15 @@
}
if (by_key) {
if (incr) {
- status = memcached_increment_with_initial_by_key(intern->memc, server_key->val, server_key->len, key->val, key->len, (unsigned int)offset, initial, expiry, &value);
+ status = memcached_increment_with_initial_by_key(intern->memc, ZSTR_VAL(server_key), ZSTR_LEN(server_key), ZSTR_VAL(key), ZSTR_LEN(key), (unsigned int)offset, initial, expiry, &value);
} else {
- status = memcached_decrement_with_initial_by_key(intern->memc, server_key->val, server_key->len, key->val, key->len, (unsigned int)offset, initial, expiry, &value);
+ status = memcached_decrement_with_initial_by_key(intern->memc, ZSTR_VAL(server_key), ZSTR_LEN(server_key), ZSTR_VAL(key), ZSTR_LEN(key), (unsigned int)offset, initial, expiry, &value);
}
} else {
if (incr) {
- status = memcached_increment_with_initial(intern->memc, key->val, key->len, (unsigned int)offset, initial, expiry, &value);
+ status = memcached_increment_with_initial(intern->memc, ZSTR_VAL(key), ZSTR_LEN(key), (unsigned int)offset, initial, expiry, &value);
} else {
- status = memcached_decrement_with_initial(intern->memc, key->val, key->len, (unsigned int)offset, initial, expiry, &value);
+ status = memcached_decrement_with_initial(intern->memc, ZSTR_VAL(key), ZSTR_LEN(key), (unsigned int)offset, initial, expiry, &value);
}
}
if (s_should_retry_write(intern, status) && retries-- > 0) {
@@ -2248,11 +2245,11 @@
}
}
- if (value == UINT64_MAX) {
+ if (s_memc_status_handle_result_code(intern, status) == FAILURE) {
RETURN_FALSE;
}
- if (s_memc_status_handle_result_code(intern, status) == FAILURE) {
+ if (value == UINT64_MAX) {
RETURN_FALSE;
}
@@ -2309,15 +2306,15 @@
s_memc_set_status(intern, MEMCACHED_SUCCESS, 0);
#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX < 0x01000002
- if (host->val[0] == '/') { /* unix domain socket */
- status = memcached_server_add_unix_socket_with_weight(intern->memc, host->val, weight);
+ if (ZSTR_VAL(host)[0] == '/') { /* unix domain socket */
+ status = memcached_server_add_unix_socket_with_weight(intern->memc, ZSTR_VAL(host), weight);
} else if (memcached_behavior_get(intern->memc, MEMCACHED_BEHAVIOR_USE_UDP)) {
- status = memcached_server_add_udp_with_weight(intern->memc, host->val, port, weight);
+ status = memcached_server_add_udp_with_weight(intern->memc, ZSTR_VAL(host), port, weight);
} else {
- status = memcached_server_add_with_weight(intern->memc, host->val, port, weight);
+ status = memcached_server_add_with_weight(intern->memc, ZSTR_VAL(host), port, weight);
}
#else
- status = memcached_server_add_with_weight(intern->memc, host->val, port, weight);
+ status = memcached_server_add_with_weight(intern->memc, ZSTR_VAL(host), port, weight);
#endif
if (s_memc_status_handle_result_code(intern, status) == FAILURE) {
@@ -2335,7 +2332,6 @@
zval *servers;
zval *entry;
zval *z_host, *z_port, *z_weight = NULL;
- uint32_t weight = 0;
HashPosition pos;
int entry_size, i = 0;
memcached_server_st *list = NULL;
@@ -2359,6 +2355,10 @@
entry_size = zend_hash_num_elements(Z_ARRVAL_P(entry));
if (entry_size > 1) {
+ zend_string *host;
+ zend_long port;
+ uint32_t weight;
+
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(entry), &pos);
/* Check that we have a host */
@@ -2376,8 +2376,8 @@
continue;
}
- convert_to_string_ex(z_host);
- convert_to_long_ex(z_port);
+ host = zval_get_string(z_host);
+ port = zval_get_long(z_port);
weight = 0;
if (entry_size > 2) {
@@ -2387,12 +2387,12 @@
php_error_docref(NULL, E_WARNING, "could not get server weight for entry #%d", i+1);
}
- convert_to_long_ex(z_weight);
- weight = Z_LVAL_P(z_weight);
+ weight = zval_get_long(z_weight);
}
- list = memcached_server_list_append_with_weight(list, Z_STRVAL_P(z_host),
- Z_LVAL_P(z_port), weight, &status);
+ list = memcached_server_list_append_with_weight(list, ZSTR_VAL(host), port, weight, &status);
+
+ zend_string_release(host);
if (s_memc_status_handle_result_code(intern, status) == SUCCESS) {
i++;
@@ -2401,7 +2401,7 @@
}
i++;
/* catch-all for all errors */
- php_error_docref(NULL, E_WARNING, "could not add entry #%d to the server list", i+1);
+ php_error_docref(NULL, E_WARNING, "could not add entry #%d to the server list", i + 1);
} ZEND_HASH_FOREACH_END();
status = memcached_server_push(intern->memc, list);
@@ -2449,7 +2449,7 @@
MEMC_METHOD_FETCH_OBJECT;
s_memc_set_status(intern, MEMCACHED_SUCCESS, 0);
- server_instance = memcached_server_by_key(intern->memc, server_key->val, server_key->len, &error);
+ server_instance = memcached_server_by_key(intern->memc, ZSTR_VAL(server_key), ZSTR_LEN(server_key), &error);
if (server_instance == NULL) {
s_memc_status_handle_result_code(intern, error);
RETURN_FALSE;
@@ -2619,8 +2619,7 @@
static
memcached_return s_stat_execute_cb (php_memcached_instance_st instance, const char *key, size_t key_length, const char *value, size_t value_length, void *context)
{
- char *server_key;
- size_t server_key_len;
+ zend_string *server_key;
zend_long long_val;
double d_val;
char *buffer;
@@ -2628,14 +2627,14 @@
zval *return_value = (zval *) context;
zval *server_values;
- server_key_len = spprintf (&server_key, 0, "%s:%d", memcached_server_name(instance), memcached_server_port(instance));
- server_values = zend_hash_str_find(Z_ARRVAL_P(return_value), server_key, server_key_len);
+ server_key = strpprintf(0, "%s:%d", memcached_server_name(instance), memcached_server_port(instance));
+ server_values = zend_hash_find(Z_ARRVAL_P(return_value), server_key);
if (!server_values) {
zval zv;
array_init(&zv);
- server_values = zend_hash_str_add(Z_ARRVAL_P(return_value), server_key, server_key_len, &zv);
+ server_values = zend_hash_add(Z_ARRVAL_P(return_value), server_key, &zv);
}
spprintf (&buffer, 0, "%.*s", value_length, value);
@@ -2648,10 +2647,11 @@
add_assoc_double(server_values, key, d_val);
}
else {
- add_assoc_stringl_ex(server_values, key, key_length, value, value_length);
+ add_assoc_stringl_ex(server_values, key, key_length, (char*)value, value_length);
}
efree (buffer);
- efree (server_key);
+ zend_string_release(server_key);
+
return MEMCACHED_SUCCESS;
}
@@ -2837,21 +2837,21 @@
static
int php_memc_set_option(php_memc_object_t *intern, long option, zval *value)
{
+ zend_long lval;
memcached_return rc = MEMCACHED_FAILURE;
memcached_behavior flag;
php_memc_user_data_t *memc_user_data = memcached_get_user_data(intern->memc);
switch (option) {
case MEMC_OPT_COMPRESSION:
- convert_to_long(value);
- memc_user_data->compression_enabled = Z_LVAL_P(value) ? 1 : 0;
+ memc_user_data->compression_enabled = zval_get_long(value) ? 1 : 0;
break;
case MEMC_OPT_COMPRESSION_TYPE:
- convert_to_long(value);
- if (Z_LVAL_P(value) == COMPRESSION_TYPE_FASTLZ ||
- Z_LVAL_P(value) == COMPRESSION_TYPE_ZLIB) {
- memc_user_data->compression_type = Z_LVAL_P(value);
+ lval = zval_get_long(value);
+ if (lval == COMPRESSION_TYPE_FASTLZ ||
+ lval == COMPRESSION_TYPE_ZLIB) {
+ memc_user_data->compression_type = lval;
} else {
/* invalid compression type */
intern->rescode = MEMCACHED_INVALID_ARGUMENTS;
@@ -2861,12 +2861,13 @@
case MEMC_OPT_PREFIX_KEY:
{
+ zend_string *str;
char *key;
#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX == 0x00049000
char tmp[MEMCACHED_PREFIX_KEY_MAX_SIZE - 1];
#endif
- convert_to_string(value);
- if (Z_STRLEN_P(value) == 0) {
+ str = zval_get_string(value);
+ if (ZSTR_VAL(str) == 0) {
key = NULL;
} else {
/*
@@ -2874,25 +2875,27 @@
character of the key prefix, to avoid the issue we pad it with a '0'
*/
#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX == 0x00049000
- snprintf(tmp, sizeof(tmp), "%s0", Z_STRVAL_P(value));
+ snprintf(tmp, sizeof(tmp), "%s0", ZSTR_VAL(str));
key = tmp;
#else
- key = Z_STRVAL_P(value);
+ key = ZSTR_VAL(str);
#endif
}
if (memcached_callback_set(intern->memc, MEMCACHED_CALLBACK_PREFIX_KEY, key) == MEMCACHED_BAD_KEY_PROVIDED) {
+ zend_string_release(str);
intern->rescode = MEMCACHED_INVALID_ARGUMENTS;
php_error_docref(NULL, E_WARNING, "bad key provided");
return 0;
}
+ zend_string_release(str);
}
break;
case MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED:
flag = (memcached_behavior) option;
- convert_to_long(value);
- rc = memcached_behavior_set(intern->memc, flag, (uint64_t) Z_LVAL_P(value));
+ lval = zval_get_long(value);
+ rc = memcached_behavior_set(intern->memc, flag, (uint64_t)lval);
if (s_memc_status_handle_result_code(intern, rc) == FAILURE) {
php_error_docref(NULL, E_WARNING, "error setting memcached option: %s", memcached_strerror (intern->memc, rc));
@@ -2904,7 +2907,7 @@
* options on false case, like it does for MEMCACHED_BEHAVIOR_KETAMA
* (non-weighted) case. We have to clean up ourselves.
*/
- if (!Z_LVAL_P(value)) {
+ if (!lval) {
#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX > 0x00037000
(void)memcached_behavior_set_key_hash(intern->memc, MEMCACHED_HASH_DEFAULT);
(void)memcached_behavior_set_distribution_hash(intern->memc, MEMCACHED_HASH_DEFAULT);
@@ -2918,28 +2921,28 @@
case MEMC_OPT_SERIALIZER:
{
- convert_to_long(value);
+ lval = zval_get_long(value);
/* igbinary serializer */
#ifdef HAVE_MEMCACHED_IGBINARY
- if (Z_LVAL_P(value) == SERIALIZER_IGBINARY) {
+ if (lval == SERIALIZER_IGBINARY) {
memc_user_data->serializer = SERIALIZER_IGBINARY;
} else
#endif
#ifdef HAVE_JSON_API
- if (Z_LVAL_P(value) == SERIALIZER_JSON) {
+ if (lval == SERIALIZER_JSON) {
memc_user_data->serializer = SERIALIZER_JSON;
- } else if (Z_LVAL_P(value) == SERIALIZER_JSON_ARRAY) {
+ } else if (lval == SERIALIZER_JSON_ARRAY) {
memc_user_data->serializer = SERIALIZER_JSON_ARRAY;
} else
#endif
/* msgpack serializer */
#ifdef HAVE_MEMCACHED_MSGPACK
- if (Z_LVAL_P(value) == SERIALIZER_MSGPACK) {
+ if (lval == SERIALIZER_MSGPACK) {
memc_user_data->serializer = SERIALIZER_MSGPACK;
} else
#endif
/* php serializer */
- if (Z_LVAL_P(value) == SERIALIZER_PHP) {
+ if (lval == SERIALIZER_PHP) {
memc_user_data->serializer = SERIALIZER_PHP;
} else {
memc_user_data->serializer = SERIALIZER_PHP;
@@ -2951,23 +2954,23 @@
}
case MEMC_OPT_USER_FLAGS:
- convert_to_long(value);
+ lval = zval_get_long(value);
- if (Z_LVAL_P(value) < 0) {
+ if (lval < 0) {
memc_user_data->set_udf_flags = -1;
return 1;
}
- if (Z_LVAL_P(value) > MEMC_VAL_USER_FLAGS_MAX) {
+ if (lval > MEMC_VAL_USER_FLAGS_MAX) {
php_error_docref(NULL, E_WARNING, "MEMC_OPT_USER_FLAGS must be < %u", MEMC_VAL_USER_FLAGS_MAX);
return 0;
}
- memc_user_data->set_udf_flags = Z_LVAL_P(value);
+ memc_user_data->set_udf_flags = lval;
break;
case MEMC_OPT_STORE_RETRY_COUNT:
- convert_to_long(value);
- memc_user_data->store_retry_count = Z_LVAL_P(value);
+ lval = zval_get_long(value);
+ memc_user_data->store_retry_count = lval;
break;
default:
@@ -2979,10 +2982,10 @@
}
else {
flag = (memcached_behavior) option;
- convert_to_long(value);
+ lval = zval_get_long(value);
if (flag < MEMCACHED_BEHAVIOR_MAX) {
- rc = memcached_behavior_set(intern->memc, flag, (uint64_t) Z_LVAL_P(value));
+ rc = memcached_behavior_set(intern->memc, flag, (uint64_t)lval);
}
else {
rc = MEMCACHED_INVALID_ARGUMENTS;
@@ -3014,15 +3017,9 @@
retval = ecalloc(*num_elements, sizeof(uint32_t));
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(input), pzval) {
- long value = 0;
-
- if (Z_TYPE_P(pzval) == IS_LONG) {
- value = Z_LVAL_P(pzval);
- } else {
- value = zval_get_long(pzval);
- value = value > 0? value : 0;
- }
+ zend_long value = 0;
+ value = zval_get_long(pzval);
if (value < 0) {
php_error_docref(NULL, E_WARNING, "the map must contain positive integers");
efree (retval);
@@ -3124,14 +3121,9 @@
php_error_docref(NULL, E_WARNING, "invalid configuration option");
ok = 0;
} else {
- zval copy;
- ZVAL_DUP(©, value);
-
- if (!php_memc_set_option(intern, (long) key_index, ©)) {
+ if (!php_memc_set_option(intern, (long) key_index, value)) {
ok = 0;
}
-
- zval_dtor(©);
}
} ZEND_HASH_FOREACH_END();
@@ -3181,7 +3173,7 @@
RETURN_FALSE;
}
memc_user_data->has_sasl_data = 1;
- status = memcached_set_sasl_auth_data(intern->memc, user->val, pass->val);
+ status = memcached_set_sasl_auth_data(intern->memc, ZSTR_VAL(user), ZSTR_VAL(pass));
if (s_memc_status_handle_result_code(intern, status) == FAILURE) {
RETURN_FALSE;
@@ -3322,28 +3314,24 @@
#ifdef HAVE_MEMCACHED_PROTOCOL
static
-void php_memc_server_free_storage(php_memc_server_t *intern)
+void php_memc_server_free_storage(zend_object *object)
{
+ php_memc_server_t *intern = php_memc_server_fetch_object(object);
zend_object_std_dtor(&intern->zo);
- efree (intern);
}
-zend_object_value php_memc_server_new(zend_class_entry *ce)
+zend_object *php_memc_server_new(zend_class_entry *ce)
{
- zend_object_value retval;
php_memc_server_t *intern;
- zval *tmp;
- intern = ecalloc(1, sizeof(php_memc_server_t));
+ intern = ecalloc(1, sizeof(php_memc_server_t) + zend_object_properties_size(ce));
+
zend_object_std_init(&intern->zo, ce);
object_properties_init(&intern->zo, ce);
- intern->handler = php_memc_proto_handler_new ();
-
- retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)php_memc_server_free_storage, NULL);
- retval.handlers = &memcached_server_object_handlers;
+ intern->zo.handlers = &memcached_server_object_handlers;
- return retval;
+ return &intern->zo;
}
#endif
@@ -3366,9 +3354,9 @@
zval *return_value = (zval *) in_context;
array_init(&array);
- add_assoc_string(&array, "host", memcached_server_name(instance));
+ add_assoc_string(&array, "host", (char*)memcached_server_name(instance));
add_assoc_long(&array, "port", memcached_server_port(instance));
- add_assoc_string(&array, "type", memcached_server_type(instance));
+ add_assoc_string(&array, "type", (char*)memcached_server_type(instance));
/*
* API does not allow to get at this field.
add_assoc_long(array, "weight", instance->weight);
@@ -3381,28 +3369,28 @@
static
memcached_return s_server_cursor_version_cb(const memcached_st *ptr, php_memcached_instance_st instance, void *in_context)
{
- char *address, *version;
- size_t address_len, version_len;
-
- zval *return_value = (zval *) in_context;
+ zend_string *address, *version;
+ zval rv, *return_value = (zval *)in_context;
#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x01000009
- version_len = spprintf(&version, sizeof(version), "%d.%d.%d",
+ version = strpprintf(0, "%d.%d.%d",
memcached_server_major_version(instance),
memcached_server_minor_version(instance),
memcached_server_micro_version(instance));
#else
- version_len = spprintf(&version, sizeof(version) - 1, "%d.%d.%d",
+ version = strpprintf(0, "%d.%d.%d",
instance->major_version,
instance->minor_version,
instance->micro_version);
#endif
- address_len = spprintf(&address, 0, "%s:%d", memcached_server_name(instance), memcached_server_port(instance) - 1);
- add_assoc_stringl_ex(return_value, address, address_len, version, version_len);
+ address = strpprintf(0, "%s:%d", memcached_server_name(instance), memcached_server_port(instance) - 1);
+
+ ZVAL_STR(&rv, version);
+ zend_hash_add(Z_ARRVAL_P(return_value), address, &rv);
+
+ zend_string_release(address);
- efree(address);
- efree(version);
return MEMCACHED_SUCCESS;
}
@@ -3443,6 +3431,8 @@
decompress_status = (uncompress((Bytef *) buffer->val, &buffer->len, (Bytef *)payload, payload_len) == Z_OK);
}
+ ZSTR_VAL(buffer)[stored_length] = '\0';
+
if (!decompress_status) {
php_error_docref(NULL, E_WARNING, "could not decompress value");
zend_string_release (buffer);
@@ -3462,8 +3452,8 @@
php_unserialize_data_t var_hash;
const unsigned char *p, *max;
- p = (const unsigned char *) payload->val;
- max = p + payload->len;
+ p = (const unsigned char *) ZSTR_VAL(payload);
+ max = p + ZSTR_LEN(payload);
PHP_VAR_UNSERIALIZE_INIT(var_hash);
if (!php_var_unserialize(return_value, &p, max, &var_hash)) {
@@ -3479,7 +3469,7 @@
case MEMC_VAL_IS_IGBINARY:
#ifdef HAVE_MEMCACHED_IGBINARY
- if (igbinary_unserialize((uint8_t *) payload->val, payload->len, return_value)) {
+ if (igbinary_unserialize((uint8_t *) ZSTR_VAL(payload), ZSTR_LEN(payload), return_value)) {
ZVAL_FALSE(return_value);
php_error_docref(NULL, E_WARNING, "could not unserialize value with igbinary");
return 0;
@@ -3495,7 +3485,7 @@
#ifdef HAVE_JSON_API
{
php_memc_user_data_t *memc_user_data = memcached_get_user_data(memc);
- php_json_decode(return_value, payload->val, payload->len, (memc_user_data->serializer == SERIALIZER_JSON_ARRAY), PHP_JSON_PARSER_DEFAULT_DEPTH);
+ php_json_decode(return_value, ZSTR_VAL(payload), ZSTR_LEN(payload), (memc_user_data->serializer == SERIALIZER_JSON_ARRAY), PHP_JSON_PARSER_DEFAULT_DEPTH);
}
#else
ZVAL_FALSE(return_value);
@@ -3506,7 +3496,7 @@
case MEMC_VAL_IS_MSGPACK:
#ifdef HAVE_MEMCACHED_MSGPACK
- php_msgpack_unserialize(return_value, payload->val, payload->len);
+ php_msgpack_unserialize(return_value, ZSTR_VAL(payload), ZSTR_LEN(payload));
#else
ZVAL_FALSE(return_value);
php_error_docref(NULL, E_WARNING, "could not unserialize value, no msgpack support");
@@ -3551,28 +3541,28 @@
break;
case MEMC_VAL_IS_LONG:
- ZVAL_LONG(return_value, strtol(data->val, NULL, 10));
+ ZVAL_LONG(return_value, strtol(ZSTR_VAL(data), NULL, 10));
break;
case MEMC_VAL_IS_DOUBLE:
{
- if (payload_len == 8 && memcmp(data->val, "Infinity", 8) == 0) {
+ if (zend_string_equals_literal(data, "Infinity")) {
ZVAL_DOUBLE(return_value, php_get_inf());
}
- else if (payload_len == 9 && memcmp(data->val, "-Infinity", 9) == 0) {
+ else if (zend_string_equals_literal(data, "-Infinity")) {
ZVAL_DOUBLE(return_value, -php_get_inf());
}
- else if (payload_len == 3 && memcmp(data->val, "NaN", 3) == 0) {
+ else if (zend_string_equals_literal(data, "NaN")) {
ZVAL_DOUBLE(return_value, php_get_nan());
}
else {
- ZVAL_DOUBLE(return_value, zend_strtod(data->val, NULL));
+ ZVAL_DOUBLE(return_value, zend_strtod(ZSTR_VAL(data), NULL));
}
}
break;
case MEMC_VAL_IS_BOOL:
- ZVAL_BOOL(return_value, payload_len > 0 && data->val[0] == '1');
+ ZVAL_BOOL(return_value, payload_len > 0 && ZSTR_VAL(data)[0] == '1');
break;
case MEMC_VAL_IS_SERIALIZED:
@@ -3584,14 +3574,10 @@
default:
php_error_docref(NULL, E_WARNING, "unknown payload type");
- retval = 0;
break;
}
zend_string_release(data);
- if (!retval) {
- zval_ptr_dtor(return_value);
- }
return retval;
}
@@ -3618,8 +3604,8 @@
zval *pce_z;
if ((pce_z = zend_hash_str_find(CG(class_table),
- "runtimeexception",
- sizeof("RuntimeException") - 1)) != NULL) {
+ "runtimeexception",
+ sizeof("RuntimeException") - 1)) != NULL) {
pce = Z_CE_P(pce_z);
spl_ce_RuntimeException = pce;
return pce;
@@ -3629,11 +3615,7 @@
}
}
#endif
-#if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION < 2)
- return zend_exception_get_default();
-#else
return zend_exception_get_default();
-#endif
}
@@ -3644,8 +3626,8 @@
{
if (fci->size > 0) {
zval_ptr_dtor(&fci->function_name);
- if (fci->object_ptr != NULL) {
- zval_ptr_dtor(&fci->object_ptr);
+ if (fci->object) {
+ OBJ_RELEASE(fci->object);
}
}
}
@@ -3655,19 +3637,19 @@
{
int i;
zend_bool rc;
- zend *address;
+ zend_string *address;
php_memc_server_t *intern;
- intern = Z_MEMC_OBJ_P(getThis());
+ intern = Z_MEMC_SERVER_P(getThis());
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &address) == FAILURE) {
return;
}
- rc = php_memc_proto_handler_run (intern->handler, address);
+ rc = php_memc_proto_handler_run(intern->handler, address);
for (i = MEMC_SERVER_ON_MIN + 1; i < MEMC_SERVER_ON_MAX; i++) {
- s_destroy_cb (&MEMC_G(server.callbacks) [i].fci);
+ s_destroy_cb(&MEMC_SERVER_G(callbacks) [i].fci);
}
RETURN_BOOL(rc);
@@ -3690,14 +3672,14 @@
}
if (fci.size > 0) {
- s_destroy_cb (&MEMC_G(server.callbacks) [event].fci);
+ s_destroy_cb (&MEMC_SERVER_G(callbacks) [event].fci);
- MEMC_G(server.callbacks) [event].fci = fci;
- MEMC_G(server.callbacks) [event].fci_cache = fci_cache;
+ MEMC_SERVER_G(callbacks) [event].fci = fci;
+ MEMC_SERVER_G(callbacks) [event].fci_cache = fci_cache;
- Z_ADDREF_P (fci.function_name);
- if (fci.object_ptr) {
- Z_ADDREF_P (fci.object_ptr);
+ Z_TRY_ADDREF(fci.function_name);
+ if (fci.object) {
+ GC_REFCOUNT(fci.object)++;
}
}
RETURN_BOOL(rc);
@@ -4427,7 +4409,9 @@
#ifdef HAVE_MEMCACHED_PROTOCOL
memcpy(&memcached_server_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+ memcached_server_object_handlers.offset = XtOffsetOf(php_memc_server_t, zo);
memcached_server_object_handlers.clone_obj = NULL;
+ memcached_server_object_handlers.free_obj = php_memc_server_free_storage;
INIT_CLASS_ENTRY(ce, "MemcachedServer", memcached_server_class_methods);
memcached_server_ce = zend_register_internal_class(&ce);
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/php_memcached_private.h
^
|
@@ -195,7 +195,6 @@
/* For deprecated values */
zend_long no_effect;
-
#ifdef HAVE_MEMCACHED_PROTOCOL
struct {
php_memc_server_cb_t callbacks [MEMC_SERVER_ON_MAX];
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/php_memcached_server.c
^
|
@@ -29,19 +29,15 @@
#define MEMC_MAKE_ZVAL_COOKIE(my_zcookie, my_ptr) \
do { \
- char *cookie_buf; \
- spprintf (&cookie_buf, 0, "%p", my_ptr); \
- MAKE_STD_ZVAL(my_zcookie); \
- ZVAL_STRING(my_zcookie, cookie_buf, 0); \
+ zend_string *cookie_buf; \
+ cookie_buf = strpprintf(0, "%p", my_ptr); \
+ ZVAL_STR(&my_zcookie, cookie_buf); \
} while (0)
#define MEMC_MAKE_RESULT_CAS(my_zresult_cas, my_result_cas) \
do { \
my_result_cas = 0; \
- if (Z_TYPE_P(my_zresult_cas) != IS_NULL) { \
- convert_to_double (my_zresult_cas); \
- my_result_cas = (uint64_t) Z_DVAL_P(my_zresult_cas); \
- } \
+ my_result_cas = zval_get_double(my_zresult_cas); \
} while (0)
@@ -78,9 +74,7 @@
efree (buf);
}
if (retval_ptr) {
- convert_to_long (retval_ptr);
- retval = Z_LVAL_P(retval_ptr);
- zval_ptr_dtor(&retval_ptr);
+ retval = zval_get_long(retval_ptr);
}
return retval;
}
@@ -223,10 +217,7 @@
retval = s_invoke_php_callback (&MEMC_GET_CB(event), params, 7);
- if (Z_TYPE(zresult) != IS_LONG) {
- convert_to_long (&zresult);
- }
- *result = (uint64_t) Z_LVAL(zresult);
+ *result = (uint64_t)zval_get_long(zresult);
MEMC_MAKE_RESULT_CAS(zresult_cas, *result_cas);
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/php_memcached_session.c
^
|
@@ -390,8 +390,8 @@
PS_CLOSE_FUNC(memcached)
{
- memcached_st *memc = PS_GET_MOD_DATA();
php_memcached_user_data *user_data;
+ memcached_st *memc = PS_GET_MOD_DATA();
if (!memc) {
php_error_docref(NULL, E_WARNING, "Session is not allocated, check session.save_path value");
@@ -453,7 +453,7 @@
time_t expiration = s_session_expiration(maxlifetime);
if (!memc) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session is not allocated, check session.save_path value");
+ php_error_docref(NULL, E_WARNING, "Session is not allocated, check session.save_path value");
return FAILURE;
}
@@ -482,7 +482,7 @@
memcached_st *memc = PS_GET_MOD_DATA();
if (!memc) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session is not allocated, check session.save_path value");
+ php_error_docref(NULL, E_WARNING, "Session is not allocated, check session.save_path value");
return FAILURE;
}
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/001.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Check for memcached presence
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
echo "memcached extension is available";
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/add.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached::add()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/append.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached::append()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/bad_construct.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached construct with bad arguments
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/bug_16084.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached: Bug #16084 (Crash when addServers is called with an associative array)
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
$servers = array ( 0 => array ( 'KEYHERE' => 'localhost', 11211, 3 ), );
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/bug_16959.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached: Bug #16959 (getMulti + BINARY_PROTOCOL problem)
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/bug_17137.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Change prefix, pecl bug #17137
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/bug_18639.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached::getServerByKey(): Bug pecl#18639 (Segfault in getServerByKey)
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
@@ -14,9 +14,9 @@
bool(true)
array(3) {
["host"]=>
- string(9) "127.0.0.1"
+ string(9) "%s"
["port"]=>
- int(11211)
+ int(%d)
["weight"]=>
int(%r[01]%r)
}
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/cachecallback.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached::get() with cache callback
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/callback_exception.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
make sure that callback exception behaves correctly
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/callback_exception_2.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Callback initializer throws and dies
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/cas.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached fetch cas & set cas
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/cas_multi.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached multi fetch cas & set cas
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/check_if_persistent.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Check if persistent object is persistent
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip";
+<?php include dirname(__FILE__) . "/skipif.inc";
?>
--FILE--
<?php
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/check_if_pristine.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Check if persistent object is new or an old persistent one
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip";
+<?php include dirname(__FILE__) . "/skipif.inc";
?>
--FILE--
<?php
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/clone.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Test cloning
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
$s = new stdClass();
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/compression_types.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached compression test
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/conf_persist.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Conf settings persist.
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/config.inc
^
|
@@ -21,7 +21,9 @@
echo "Failed to set options" . PHP_EOL;
$memcached->addServer($host, $port);
- $memcached->flush ();
+ if ($memcached->flush() === false) {
+ return NULL;
+ }
return $memcached;
}
@@ -64,3 +66,8 @@
),
);
}
+
+function memc_get_version($memc) {
+ $version = $memc->getVersion();
+ return array_pop($version);
+}
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/construct.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached constructor
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
$m = new Memcached();
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/construct_persistent.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
persistent memcached connection
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
$m1 = new Memcached('id1');
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/default_behavior.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Default behaviors
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/deleted.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached store & fetch type correctness
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/deletemulti.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Delete multi
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/deletemultitypes.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Delete multi key types
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/add_bykey.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::addByKey()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
$m->delete('foo');
var_dump($m->addByKey('foo', 'foo', 1, 10));
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/addserver_unixdomain.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached::addServer() unix doamin socket
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--CLEAN--
<?php
unlink('/tmp/memc_test_unix_socket');
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/append_bykey.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::appendByKey()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
$m->setOption(Memcached::OPT_COMPRESSION, false);
var_dump($m->setByKey('foo', 'foo', 'bar', 10));
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/cas_bykey.phpt
^
|
@@ -1,19 +1,19 @@
--TEST--
Memcached::casByKey()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('127.0.0.1', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
$m->delete('cas_test');
-$cas_token = null;
$m->setByKey('keffe', 'cas_test', 10);
-$v = $m->getbyKey('keffe', 'cas_test', null, $cas_token);
+$v = $m->getbyKey('keffe', 'cas_test', null, Memcached::GET_EXTENDED);
-if (is_null($cas_token)) {
+$cas_token = $v["cas"];
+if (empty($cas_token)) {
echo "Null cas token for key: cas_test value: 10\n";
return;
}
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/cas_invalid_key.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::cas() with strange key
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
error_reporting(0);
var_dump($m->cas(0, '', true, 10));
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/delete_bykey.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::deleteByKey()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('127.0.0.1', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
$m->setByKey('keffe', 'eisaleeoo', "foo");
var_dump($m->getByKey('keffe', 'eisaleeoo'));
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/deletemulti_nonstringkeys.phpt
^
|
@@ -1,12 +1,11 @@
--TEST--
Delete multi with integer keys
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('127.0.0.1', 11211, 1);
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
$data = array(
1 => '1-data',
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/extreme_floats.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Extreme floats: max, min, Inf, -Inf, and NaN
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('127.0.0.1', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
$m->set('float_inf', INF);
$m->set('float_ninf', -INF);
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/fetch.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached getDelayed() and fetch() with and without cas
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
@@ -33,8 +33,8 @@
}
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
$data = array(
'foo' => 'foo-data',
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/fetch_badunserialize.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::fetch() with bad unserialize
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
class Foo implements Serializable {
public $serialize_throws = false;
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/fetchall_badunserialize.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::fetch() with bad unserialize
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
class Foo implements Serializable {
public $serialize_throws = false;
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/get.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::get()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
$m->delete('foo');
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/get_bykey.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::getByKey()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
$m->set('foo', 1, 10);
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/get_bykey_cas.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::getByKey() with CAS
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
function the_callback(Memcached $memc, $key, &$value) {
echo "called\n";
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/get_udp.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::set()/delete() UDP
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('127.0.0.1', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
$m_udp = new Memcached();
$m_udp->setOption(Memcached::OPT_USE_UDP, true);
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/getdelayed_badserver.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached::getDelayedByKey() with bad server
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
$m = new Memcached();
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/getdelayed_badunserialize.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::getDelayed() with bad unserialize
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
class Foo implements Serializable {
public $serialize_throws = false;
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/getdelayed_bykey.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::getDelayedByKey()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
$data = array(
'foo' => 'foo-data',
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/getdelayed_bykey_cas.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::getDelayedByKey() with CAS
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
$data = array(
'foo' => 'foo-data',
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/getdelayed_cbthrows.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::getDelayedByKey() with callback exception
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
$data = array(
'foo' => 'foo-data',
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/getdelayed_nonstring_keys.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached getDelayed non string keys
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
class Bar {
public function __toString() {
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/getmulti_badserver.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached::getMulti() bad server
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
$m = new Memcached();
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/getmulti_badunserialize.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::getMulti() with bad unserialize
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
class Foo implements Serializable {
public function __sleep() {
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/getmulti_bykey.phpt
^
|
@@ -1,22 +1,20 @@
--TEST--
Memcached::getMultiByKey()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
$m->set('foo', 1, 10);
$m->set('bar', 2, 10);
$m->delete('baz');
-$cas = array();
-var_dump($m->getMultiByKey('foo', array('foo', 'bar', 'baz'), $cas, Memcached::GET_PRESERVE_ORDER));
+var_dump($m->getMultiByKey('foo', array('foo', 'bar', 'baz'), Memcached::GET_PRESERVE_ORDER));
echo $m->getResultMessage(), "\n";
-$cas = array();
-var_dump($m->getMultiByKey('foo', array(), $cas, Memcached::GET_PRESERVE_ORDER));
+var_dump($m->getMultiByKey('foo', array(), Memcached::GET_PRESERVE_ORDER));
echo $m->getResultMessage(), "\n";
--EXPECT--
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/getmulti_empty.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::getMulti() with empty array
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
$v = $m->getMulti(array());
var_dump($v);
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/getmulti_partial_error.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::getMulti() partial error
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
$data = array();
for ($i = 0; $i < 1000; $i++) {
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/getversion.phpt
^
|
@@ -1,13 +1,14 @@
--TEST--
Memcached::getVersion()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
$m = new Memcached();
var_dump($m->getVersion());
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . "/config.inc";
+$m = memc_get_instance ();
$stats = $m->getVersion();
var_dump($stats);
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/locale_float.phpt
^
|
@@ -2,14 +2,15 @@
Float should not consider locale
--SKIPIF--
<?php
- if (!extension_loaded("memcached")) die("skip extension not loaded";
- if (!setlocale(LC_NUMERIC, "fi_FI", 'sv_SV', 'nl_NL')) {
- die("skip no suitable locale");
- }
+include dirname(dirname(__FILE__)) . "/skipif.inc";
+if (!setlocale(LC_NUMERIC, "fi_FI", 'sv_SV', 'nl_NL')) {
+ die("skip no suitable locale");
+}
--FILE--
<?php
-$memcache = new Memcached();
-$memcache->addServer('127.0.0.1', 11211);
+
+include dirname(dirname(__FILE__)) . '/config.inc';
+$memcache = memc_get_instance ();
setlocale(LC_NUMERIC,
"fi_FI", 'sv_SV', 'nl_NL');
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/moduleinfo.phpt
^
|
@@ -2,7 +2,7 @@
Memcached::phpinfo()
--SKIPIF--
<?php
-if (!extension_loaded("memcached")) print "skip";
+include dirname(dirname(__FILE__)) . "/skipif.inc";
if (!Memcached::HAVE_SESSION) print "skip";
?>
--FILE--
@@ -19,20 +19,4 @@
--EXPECTF--
memcached
memcached support => enabled
-memcached.compression_factor => %f => %f
-memcached.compression_threshold => %d => %d
-memcached.compression_type => %s => %s
-memcached.serializer => %s => %s
-memcached.sess_binary => %d => %d
-memcached.sess_connect_timeout => %d => %d
-memcached.sess_consistent_hash => %d => %d
-memcached.sess_lock_expire => %d => %d
-memcached.sess_lock_max_wait => %d => %d
-memcached.sess_lock_wait => %d => %d
-memcached.sess_locking => %d => %d
-memcached.sess_number_of_replicas => %d => %d
-memcached.sess_prefix => %s => %s
-memcached.sess_randomize_replica_read => %d => %d
-memcached.sess_remove_failed => %d => %d
-%rmemcached.use_sasl => %d => %d
-|%rmemcached.store_retry_count => %d => %d
\ No newline at end of file
+%A
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/prepend_bykey.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::appendByKey()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
$m->setOption(Memcached::OPT_COMPRESSION, false);
var_dump($m->setByKey('foo', 'foo', 'bar', 10));
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/replace_bykey.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::replaceByKey()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
error_reporting(0);
$m->delete('foo');
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/serializer/serializer_php.phpt
^
|
@@ -2,12 +2,12 @@
Serializer basic
--SKIPIF--
<?php
- if (!extension_loaded("memcached")) print "skip";
+include dirname(dirname(dirname(__FILE__))) . "/skipif.inc";
?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(dirname(__FILE__))) . '/config.inc';
+$m = memc_get_instance ();
$serializer = Memcached::SERIALIZER_PHP;
if (isset($_ENV['TEST_MEMC_SERIALIZER'])) {
eval(sprintf('$serializer = %s;', $_ENV['TEST_MEMC_SERIALIZER']));
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/serializer/serializer_php_bad_serialize.phpt
^
|
@@ -2,7 +2,7 @@
Serializer: exception while serializing
--SKIPIF--
<?php
- if (!extension_loaded("memcached")) print "skip";
+ include dirname(__FILE__) . "/skipif.inc";
if ($_ENV['TEST_MEMC_SERIALIZER'] == 'Memcached::SERIALIZER_JSON') {
echo "skip skip when using JSON";
}
@@ -30,8 +30,8 @@
}
}
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(dirname(__FILE__))) . '/config.inc';
+$m = memc_get_instance ();
$serializer = Memcached::SERIALIZER_PHP;
if (isset($_ENV['TEST_MEMC_SERIALIZER'])) {
eval(sprintf('$serializer = %s;', $_ENV['TEST_MEMC_SERIALIZER']));
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/serializer/serializer_php_bad_unserialize.phpt
^
|
@@ -2,10 +2,10 @@
Serializer: exception while unserializing
--SKIPIF--
<?php
- if (!extension_loaded("memcached")) print "skip";
- if ($_ENV['TEST_MEMC_SERIALIZER'] == 'Memcached::SERIALIZER_JSON') {
- echo "skip skip when using JSON";
- }
+include dirname(dirname(dirname(__FILE__))) . "/skipif.inc";
+if ($_ENV['TEST_MEMC_SERIALIZER'] == 'Memcached::SERIALIZER_JSON') {
+ echo "skip skip when using JSON";
+}
--FILE--
<?php
class Foo implements Serializable {
@@ -26,8 +26,8 @@
}
}
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(dirname(__FILE__))) . '/config.inc';
+$m = memc_get_instance ();
$serializer = Memcached::SERIALIZER_PHP;
if (isset($_ENV['TEST_MEMC_SERIALIZER'])) {
eval(sprintf('$serializer = %s;', $_ENV['TEST_MEMC_SERIALIZER']));
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/serializer_igbinary.phpt
^
|
@@ -2,7 +2,7 @@
Serialize igbinary
--SKIPIF--
<?php
- if (!extension_loaded("memcached")) print "skip";
+ include dirname(__FILE__) . "/skipif.inc";
if (!extension_loaded('igbinary')) echo "skip no igbinary loaded";
if (!Memcached::HAVE_IGBINARY) echo "skip igbinary support not enabled";
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/serializer_json.phpt
^
|
@@ -2,7 +2,7 @@
Serialize JSON
--SKIPIF--
<?php
- if (!extension_loaded("memcached")) print "skip";
+ include dirname(__FILE__) . "/skipif.inc";
if (!extension_loaded('json')) echo "skip no JSON loaded";
if (!Memcached::HAVE_JSON) echo "skip JSON support not enabled";
?>
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/session_gc.phpt
^
|
@@ -2,7 +2,10 @@
Session expiration
--SKIPIF--
<?php
-if (!extension_loaded("memcached")) print "skip";
+include dirname(dirname(__FILE__)) . "/skipif.inc";
+if (MEMC_SERVER_HOST != "127.0.0.1" || MEMC_SERVER_PORT != 11211) {
+ die("skip ini require specific setting\n");
+}
if (!Memcached::HAVE_SESSION) print "skip";
?>
--INI--
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/set_bykey.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::setByKey()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
var_dump($m->setByKey('foo', 'foo', 1, 10));
echo $m->getResultMessage(), "\n";
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/set_comp_below_factor.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Compress below factor and fail to plain.
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
ini_set('memcached.compression_threshold', 100);
ini_set('memcached.compression_factor', 10);
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/set_default_serializer.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Set default serializer
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/set_invalid_serializer.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Set invalid serializer
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/setget_zero_factor.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Compress with 0 factor and get
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
ini_set('memcached.compression_factor', 0);
$array = range(1, 20000, 1);
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/setmulti_badserialize.phpt
^
|
@@ -1,11 +1,11 @@
--TEST--
Memcached::setMultiByKey() with bad serialize
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
class Foo implements Serializable {
public function __sleep() {
@@ -42,6 +42,6 @@
var_dump($m->getByKey('kef', 'foo'));
--EXPECT--
-
+Memcached::setMultiByKey(): failed to set key foo
1234
int(10)
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/setmulti_bykey.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached::setMultiByKey()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
@@ -28,8 +28,8 @@
}
-$m = new Memcached();
-$m->addServer('localhost', 11211, 1);
+include dirname(dirname(__FILE__)) . '/config.inc';
+$m = memc_get_instance ();
$data = array(
'foo' => 'foo-data',
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/stats.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached::getStats()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
$m = new Memcached();
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/experimental/stats_badserver.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached::getStats() with bad server
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include dirname(dirname(__FILE__)) . "/skipif.inc";?>
--FILE--
<?php
$m = new Memcached();
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/expire.phpt
^
|
@@ -3,7 +3,9 @@
--XFAIL--
https://code.google.com/p/memcached/issues/detail?id=275
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip";
+<?php
+$min_version = "1.4.8";
+include dirname(__FILE__) . "/skipif.inc";
if (!method_exists("memcached", "touch")) die ("skip memcached::touch is not available");
?>
--FILE--
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/flush_buffers.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Test flushing buffers
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/get_flags.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached::get/getMulti() flags
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/getdelayed.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached getDelayed callback
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/getmulti.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached::getMulti()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/getserverbykey.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached::getServerByKey()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
error_reporting(0);
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/getserverlist.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
getServerList
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
$servers = array ( 0 => array ( 'KEYHERE' => 'localhost', 11211, 3 ), );
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/gh_155.phpt
^
|
@@ -2,8 +2,8 @@
Test for bug 155
--SKIPIF--
<?php
-if (!extension_loaded("memcached"))
- print "skip";
+$min_version = "1.4.8";
+include dirname(__FILE__) . "/skipif.inc";
if (Memcached::LIBMEMCACHED_VERSION_HEX < 0x01000016) die ('skip too old libmemcached');
?>
--FILE--
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/gh_21.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Test for Github issue 21
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/gh_77.phpt
^
|
@@ -1,8 +1,10 @@
--TEST--
Test for Github issue #77
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip";
- if (Memcached::LIBMEMCACHED_VERSION_HEX < 0x01000016) die ('skip too old libmemcached');
+<?php
+$min_version = "1.4.8";
+include dirname(__FILE__) . "/skipif.inc";
+if (Memcached::LIBMEMCACHED_VERSION_HEX < 0x01000016) die ('skip too old libmemcached');
?>
--FILE--
<?php
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/gh_90.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Test for GH #90
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/gh_93.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Test for Github issue #93 (double and long overflow)
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/incrdecr.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached::increment() Memcached::decrement()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
@@ -10,8 +10,11 @@
echo "Not there\n";
$m->delete('foo');
var_dump($m->increment('foo', 1));
+var_dump($m->getResultCode());
var_dump($m->decrement('foo', 1));
+var_dump($m->getResultCode());
var_dump($m->get('foo'));
+var_dump($m->getResultCode());
echo "Normal\n";
$m->set('foo', 1);
@@ -37,8 +40,11 @@
--EXPECT--
Not there
bool(false)
+int(16)
bool(false)
+int(16)
bool(false)
+int(16)
Normal
int(1)
int(2)
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/incrdecr_bykey.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached::incrementByKey() Memcached::decrementByKey()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/incrdecr_initial.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached::increment() Memcached::decrement() with initial support
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/incrdecr_invalid_key.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached::increment() Memcached::decrement() with invalid key
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/invalid_options.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Get version
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/invoke_callback.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Test that callback is invoked on new object
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
@@ -24,9 +24,9 @@
[0]=>
array(3) {
["host"]=>
- string(9) "127.0.0.1"
+ string(9) "%s"
["port"]=>
- int(11211)
+ int(%d)
["type"]=>
string(3) "TCP"
}
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/invoke_callback_2.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Use callback initializer
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/invoke_callback_twice.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Test that callback is invoked on new object only once
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/keys.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Test different kind of keys
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
@@ -16,9 +16,18 @@
var_dump ($binary->set ('binary key with spaces', 'this is a test'));
var_dump ($binary->getResultCode () == Memcached::RES_SUCCESS);
+var_dump ($binary->set ('binarykeywithnewline' . PHP_EOL, 'this is a test'));
+var_dump ($binary->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED);
+
var_dump ($ascii->set ('ascii key with spaces', 'this is a test'));
var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED);
+var_dump ($binary->set ('asciikeywithnewline' . PHP_EOL, 'this is a test'));
+var_dump ($binary->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED);
+
+var_dump ($ascii->set (''/*empty key*/, 'this is a test'));
+var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED);
+
var_dump ($ascii->set (str_repeat ('1234567890', 512), 'this is a test'));
var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED);
@@ -29,6 +38,12 @@
bool(true)
bool(false)
bool(true)
+bool(false)
+bool(true)
+bool(false)
+bool(true)
+bool(false)
+bool(true)
bool(false)
bool(true)
OK
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/localserver.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached local server test
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/multi_order.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached GET_PRESERVE_ORDER flag in getMulti
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/no-not-found.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Test that correct return value is returned
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/options.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached options
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
$m = new Memcached();
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/pr_75.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Wrong return values for binary protocol
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/prepend.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached::prepend()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/replace.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached::replace()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/rescode.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached result codes.
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/session_badconf_emptyprefix.phpt
^
|
@@ -2,7 +2,7 @@
Session bad configurations, prefix
--SKIPIF--
<?php
-if (!extension_loaded("memcached")) print "skip";
+include dirname(__FILE__) . "/skipif.inc";
if (!Memcached::HAVE_SESSION) print "skip";
?>
--INI--
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/session_badconf_locktime.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Session bad configurations, lock wait time
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip";
+<?php include dirname(__FILE__) . "/skipif.inc";
print "skip skip until timeout in memcached set"
?>
--INI--
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/session_badconf_prefix.phpt
^
|
@@ -2,7 +2,7 @@
Session bad configurations, prefix
--SKIPIF--
<?php
- if (!extension_loaded("memcached")) print "skip";
+ include dirname(__FILE__) . "/skipif.inc";
if (!Memcached::HAVE_SESSION) print "skip";
?>
--INI--
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/session_badconf_servers.phpt
^
|
@@ -2,7 +2,7 @@
Session bad configurations, invalid save path (server list)
--SKIPIF--
<?php
-if (!extension_loaded("memcached")) print "skip";
+include dirname(__FILE__) . "/skipif.inc";
if (!Memcached::HAVE_SESSION) print "skip";
?>
--INI--
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/session_basic.phpt
^
|
@@ -2,7 +2,7 @@
Session basic open, write, destroy
--SKIPIF--
<?php
-if (!extension_loaded("memcached")) print "skip";
+include dirname(__FILE__) . "/skipif.inc";
if (!Memcached::HAVE_SESSION) print "skip";
?>
--INI--
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/session_basic2.phpt
^
|
@@ -2,7 +2,7 @@
Session basic open, write, destroy
--SKIPIF--
<?php
-if (!extension_loaded("memcached")) print "skip";
+include dirname(__FILE__) . "/skipif.inc";
if (!Memcached::HAVE_SESSION) print "skip";
?>
--INI--
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/session_basic3.phpt
^
|
@@ -2,7 +2,7 @@
Session basic open, write, destroy
--SKIPIF--
<?php
-if (!extension_loaded("memcached")) print "skip";
+include dirname(__FILE__) . "/skipif.inc";
if (!Memcached::HAVE_SESSION) print "skip";
?>
--INI--
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/session_lock.phpt
^
|
@@ -2,7 +2,7 @@
Session lock
--SKIPIF--
<?php
-if (!extension_loaded("memcached")) print "skip";
+include dirname(__FILE__) . "/skipif.inc";
if (!Memcached::HAVE_SESSION) print "skip";
?>
--INI--
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/session_regenerate.phpt
^
|
@@ -2,7 +2,7 @@
Session regenerate
--SKIPIF--
<?php
-if (!extension_loaded("memcached")) print "skip";
+include dirname(__FILE__) . "/skipif.inc";
if (!Memcached::HAVE_SESSION) print "skip";
?>
--INI--
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/set_large.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
set large data
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/setmulti.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached::setMulti()
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/setoptions.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Set options using setOptions
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
$m = new Memcached();
|
[-]
[+]
|
Added |
memcached-3.0.0b1.tgz/tests/skipif.inc
^
|
@@ -0,0 +1,16 @@
+<?php
+if (!extension_loaded("memcached")) {
+ die("skip memcached is not loaded\n");
+}
+
+include dirname(__FILE__) . "/config.inc";
+
+if (($m = memc_get_instance()) === NULL) {
+ die ("skip can not connect to server\n");
+}
+
+if (isset($min_version)) {
+ if (version_compare(memc_get_version($m), $min_version, "<")) {
+ die("skip version of server pool is too old, $min_version is required\n");
+ }
+}
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/stats.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Check stats
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/touch_binary.phpt
^
|
@@ -1,8 +1,10 @@
--TEST--
Touch in binary mode
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip";
- if (Memcached::LIBMEMCACHED_VERSION_HEX < 0x01000016) die ('skip too old libmemcached');
+<?php
+$min_version = "1.4.8"; //TOUCH is added since 1.4.8
+include dirname(__FILE__) . "/skipif.inc";
+if (Memcached::LIBMEMCACHED_VERSION_HEX < 0x01000016) die ('skip too old libmemcached');
?>
--FILE--
<?php
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/types_igbinary.phpt
^
|
@@ -2,7 +2,7 @@
Memcached store & fetch type and value correctness using igbinary serializer
--SKIPIF--
<?php
-if (!extension_loaded("memcached")) print "skip";
+include dirname(__FILE__) . "/skipif.inc";
if (!Memcached::HAVE_IGBINARY) print "skip igbinary not enabled";
?>
--FILE--
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/types_igbinary_multi.phpt
^
|
@@ -2,7 +2,7 @@
Memcached multi store & multi fetch type and value correctness using igbinary serializer
--SKIPIF--
<?php
-if (!extension_loaded("memcached")) print "skip";
+include dirname(__FILE__) . "/skipif.inc";
if (!Memcached::HAVE_IGBINARY) print "skip igbinary not enabled";
?>
--FILE--
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/types_json.phpt
^
|
@@ -2,7 +2,7 @@
Memcached store & fetch type and value correctness using JSON serializer
--SKIPIF--
<?php
-if (!extension_loaded("memcached")) print "skip";
+include dirname(__FILE__) . "/skipif.inc";
if (!Memcached::HAVE_JSON) print "skip json not enabled";
?>
--FILE--
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/types_json_multi.phpt
^
|
@@ -2,7 +2,7 @@
Memcached multi store & multi fetch type and value correctness using JSON serializer
--SKIPIF--
<?php
-if (!extension_loaded("memcached")) print "skip";
+include dirname(__FILE__) . "/skipif.inc";
if (!Memcached::HAVE_JSON) print "skip json not enabled";
?>
--FILE--
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/types_msgpack.phpt
^
|
@@ -2,7 +2,7 @@
Memcached store & fetch type and value correctness using msgpack serializer
--SKIPIF--
<?php
-if (!extension_loaded("memcached")) print "skip";
+include dirname(__FILE__) . "/skipif.inc";
if (!Memcached::HAVE_MSGPACK) print "skip msgpack not enabled";
?>
--FILE--
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/types_msgpack_multi.phpt
^
|
@@ -2,7 +2,7 @@
Memcached multi store & fetch type and value correctness using msgpack serializer
--SKIPIF--
<?php
-if (!extension_loaded("memcached")) print "skip";
+include dirname(__FILE__) . "/skipif.inc";
if (!Memcached::HAVE_MSGPACK) print "skip msgpack not enabled";
?>
--FILE--
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/types_php.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached store & fetch type and value correctness using PHP serializer
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/types_php_multi.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached multi store & fetch type and value correctness using PHP serializer
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/undefined_set.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Set with undefined key and value
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/user-flags.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Memcached user flags
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/vbucket.phpt
^
|
@@ -2,7 +2,7 @@
Memcached virtual buckets
--SKIPIF--
<?php
-if (!extension_loaded("memcached")) die ("skip");
+include dirname(__FILE__) . "/skipif.inc";
if (!defined("Memcached::DISTRIBUTION_VIRTUAL_BUCKET")) die ("skip DISTRIBUTION_VIRTUAL_BUCKET not defined");
?>
--FILE--
@@ -45,4 +45,4 @@
Warning: Memcached::setBucket(): the map must contain positive integers in %s on line %d
bool(false)
-OK
\ No newline at end of file
+OK
|
[-]
[+]
|
Changed |
memcached-3.0.0b1.tgz/tests/version.phpt
^
|
@@ -1,7 +1,7 @@
--TEST--
Get version
--SKIPIF--
-<?php if (!extension_loaded("memcached")) print "skip"; ?>
+<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
|