Skip to content

Commit 4048537

Browse files
committed
Travis travis..
1 parent 239623e commit 4048537

File tree

2 files changed

+69
-3
lines changed

2 files changed

+69
-3
lines changed

Diff for: .travis.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ before_script:
2323
- make
2424
- make install
2525
- cd ..
26-
- sudo apt-get update
27-
- sudo apt-get install php-pear php5-dev
28-
- pecl install igbinary
26+
- git clone [email protected]:igbinary/igbinary.git
27+
- cd igbinary
28+
- phpize
29+
- ./configure
30+
- make
31+
- make install
32+
- cd ..
2933

3034

3135
script:

Diff for: tests/config.inc

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
3+
define ("MEMC_SERVER_HOST", "127.0.0.1");
4+
define ("MEMC_SERVER_PORT", 11211);
5+
6+
function memc_get_instance ()
7+
{
8+
$memcached = new Memcached();
9+
$memcached->addServer(MEMC_SERVER_HOST, MEMC_SERVER_PORT);
10+
$memcached->flush ();
11+
return $memcached;
12+
}
13+
14+
function memc_run_test ($test_function, $options = array ())
15+
{
16+
foreach ($options as $option_set) {
17+
$memc = memc_get_instance ();
18+
19+
foreach ($option_set ['options'] as $key => $value) {
20+
if ($memc->setOption ($key, $value) == false) {
21+
die ('Failed to set option: ' . $key);
22+
}
23+
}
24+
$test_function ($memc, $option_set);
25+
}
26+
echo "TEST DONE" . PHP_EOL;
27+
}
28+
29+
function memc_create_combinations ($name, $serializer, $ignore_object_type = false)
30+
{
31+
return array (
32+
array (
33+
'title' => "$name serializer, ascii protocol",
34+
'options' => array (
35+
Memcached::OPT_SERIALIZER => $serializer
36+
),
37+
'ignore_object_type' => $ignore_object_type
38+
),
39+
array (
40+
'title' => "$name serializer, binary protocol",
41+
'options' => array (
42+
Memcached::OPT_BINARY_PROTOCOL => true,
43+
Memcached::OPT_SERIALIZER => $serializer
44+
),
45+
'ignore_object_type' => $ignore_object_type
46+
),
47+
);
48+
}
49+
50+
function memc_get_serializer_options ()
51+
{
52+
$options = memc_create_combinations ('PHP', Memcached::SERIALIZER_PHP);
53+
54+
if (defined ('Memcached::HAVE_IGBINARY')) {
55+
$options = array_merge ($options, memc_create_combinations ('igbinary', Memcached::SERIALIZER_IGBINARY));
56+
}
57+
58+
if (defined ('Memcached::HAVE_JSON')) {
59+
$options = array_merge ($options, memc_create_combinations ('JSON', Memcached::SERIALIZER_JSON, true));
60+
}
61+
return $options;
62+
}

0 commit comments

Comments
 (0)