Skip to content

Commit 59c6f40

Browse files
committed
Merge pull request #49 from datastax/PHP-22
PHP-22
2 parents 1d6e16b + 1d7815c commit 59c6f40

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+4647
-182
lines changed

Diff for: CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# 1.0.0
2+
3+
Features:
4+
5+
* Added schema metadata support (via `Cassandra\Session::schema()`).
6+
* Added types API (via `Cassandra\Type` static methods).
7+
8+
Bug Fixes:
9+
10+
* [PHP-40] Fixed invalid pointer being free'd
11+
* [PHP-43] Fixed timeout handling in `Cassandra\ExecutionOptions`
12+
* [PHP-44] Fixed memory leak
13+
114
# 1.0.0-rc
215

316
Features:

Diff for: ext/config.m4

+16
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,20 @@ if test "$PHP_CASSANDRA" != "no"; then
5858
src/Cassandra/PreparedStatement.c \
5959
src/Cassandra/BatchStatement.c \
6060
src/Cassandra/Rows.c \
61+
src/Cassandra/Column.c \
62+
src/Cassandra/DefaultColumn.c \
63+
src/Cassandra/DefaultKeyspace.c \
64+
src/Cassandra/DefaultSchema.c \
65+
src/Cassandra/DefaultTable.c \
66+
src/Cassandra/Keyspace.c \
67+
src/Cassandra/Schema.c \
68+
src/Cassandra/Table.c \
69+
src/Cassandra/Type.c \
70+
src/Cassandra/Type/Collection.c \
71+
src/Cassandra/Type/Map.c \
72+
src/Cassandra/Type/Scalar.c \
73+
src/Cassandra/Type/Set.c \
74+
src/Cassandra/Type/Custom.c \
6175
";
6276

6377
CASSANDRA_TYPES="\
@@ -86,6 +100,7 @@ if test "$PHP_CASSANDRA" != "no"; then
86100
util/math.c \
87101
util/ref.c \
88102
util/result.c \
103+
util/types.c \
89104
util/uuid_gen.c \
90105
";
91106

@@ -105,6 +120,7 @@ if test "$PHP_CASSANDRA" != "no"; then
105120
PHP_ADD_BUILD_DIR($ext_builddir/src/Cassandra/Cluster)
106121
PHP_ADD_BUILD_DIR($ext_builddir/src/Cassandra/Exception)
107122
PHP_ADD_BUILD_DIR($ext_builddir/src/Cassandra/SSLOptions)
123+
PHP_ADD_BUILD_DIR($ext_builddir/src/Cassandra/Type)
108124
PHP_ADD_BUILD_DIR($ext_builddir/util)
109125
PHP_SUBST(CASSANDRA_SHARED_LIBADD)
110126
PHP_SUBST(CASSANDRA_CFLAGS)

Diff for: ext/config.w32

+17-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,22 @@ if (PHP_CASSANDRA != "no" &&
6767
"Timeuuid.c " +
6868
"Uuid.c " +
6969
"UuidInterface.c " +
70-
"Varint.c", "cassandra");
70+
"Varint.c" +
71+
"Column.c" +
72+
"DefaultColumn.c" +
73+
"DefaultKeyspace.c" +
74+
"DefaultSchema.c" +
75+
"DefaultTable.c" +
76+
"Keyspace.c" +
77+
"Schema.c" +
78+
"Table.c" +
79+
"Type.c", "cassandra");
80+
ADD_SOURCES(configure_module_dirname + "/src/Cassandra/Type",
81+
"Collection.c" +
82+
"Map.c" +
83+
"Scalar.c" +
84+
"Set.c" +
85+
"Custom.c", "cassandra");
7186
ADD_SOURCES(configure_module_dirname + "/src/Cassandra/Cluster",
7287
"Builder.c", "cassandra");
7388
ADD_SOURCES(configure_module_dirname + "/src/Cassandra/Exception",
@@ -107,6 +122,7 @@ if (PHP_CASSANDRA != "no" &&
107122
"math.c " +
108123
"ref.c " +
109124
"result.c " +
125+
"types.c " +
110126
"uuid_gen.c", "cassandra");
111127

112128
ADD_FLAG("LDFLAGS_CASSANDRA",
@@ -142,4 +158,3 @@ if (PHP_CASSANDRA != "no" &&
142158
ERROR("Unable to locate DataStax C/C++ driver or its dependencies");
143159
}
144160
}
145-

Diff for: ext/doc/Cassandra/Cluster.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface Cluster
3030
*
3131
* @return Session Session instance
3232
*/
33-
public function connect($keyspace = null);
33+
function connect($keyspace = null);
3434

3535
/**
3636
* Creates a new Session instance.
@@ -39,5 +39,5 @@ public function connect($keyspace = null);
3939
*
4040
* @return Future A Future Session instance
4141
*/
42-
public function connectAsync($keyspace = null);
42+
function connectAsync($keyspace = null);
4343
}

Diff for: ext/doc/Cassandra/Column.php

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
3+
/**
4+
* Copyright 2015 DataStax, Inc.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
namespace Cassandra;
20+
21+
/**
22+
* A PHP representation of a column
23+
*/
24+
interface Column
25+
{
26+
/**
27+
* Returns the name of the column.
28+
* @return string|null Name of the column or null
29+
*/
30+
function name();
31+
32+
/**
33+
* Returns the type of the column.
34+
* @return Cassandra\Type Type of the column
35+
*/
36+
function type();
37+
38+
/**
39+
* Returns whether the column is in descending or ascending order.
40+
* @return boolean Whether the column is stored in descending order.
41+
*/
42+
function isReversed();
43+
44+
/**
45+
* Returns true for static columns.
46+
* @return boolean Whether the column is static
47+
*/
48+
function isStatic();
49+
50+
/**
51+
* Returns true for frozen columns.
52+
* @return boolean Whether the column is frozen
53+
*/
54+
function isFrozen();
55+
56+
/**
57+
* Returns name of the index if defined.
58+
* @return string|null Name of the index if defined
59+
*/
60+
function indexName();
61+
62+
/**
63+
* Returns index options if present.
64+
* @return string|null Index options if present
65+
*/
66+
function indexOptions();
67+
}

Diff for: ext/doc/Cassandra/DefaultColumn.php

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?php
2+
3+
/**
4+
* Copyright 2015 DataStax, Inc.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
namespace Cassandra;
20+
21+
/**
22+
* A PHP representation of a column
23+
*/
24+
final class DefaultColumn implements Column
25+
{
26+
/**
27+
* {@inheritDoc}
28+
*
29+
* @return string|null Name of the column or null
30+
*/
31+
public function name() {}
32+
33+
/**
34+
* {@inheritDoc}
35+
*
36+
* @return Cassandra\Type Type of the column
37+
*/
38+
public function type() {}
39+
40+
/**
41+
* {@inheritDoc}
42+
*
43+
* @return boolean Whether the column is stored in descending order.
44+
*/
45+
public function isReversed() {}
46+
47+
/**
48+
* {@inheritDoc}
49+
*
50+
* @return boolean Whether the column is static
51+
*/
52+
public function isStatic() {}
53+
54+
/**
55+
* {@inheritDoc}
56+
*
57+
* @return boolean Whether the column is frozen
58+
*/
59+
public function isFrozen() {}
60+
61+
/**
62+
* {@inheritDoc}
63+
*
64+
* @return string|null Name of the index if defined
65+
*/
66+
public function indexName() {}
67+
68+
/**
69+
* {@inheritDoc}
70+
*
71+
* @return string|null Index options if present
72+
*/
73+
public function indexOptions() {}
74+
}

Diff for: ext/doc/Cassandra/DefaultKeyspace.php

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?php
2+
3+
/**
4+
* Copyright 2015 DataStax, Inc.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
namespace Cassandra;
20+
21+
/**
22+
* A PHP representation of a keyspace
23+
*/
24+
final class DefaultKeyspace implements Keyspace
25+
{
26+
/**
27+
* {@inheritDoc}
28+
*
29+
* @return string Name
30+
*/
31+
public function name() {}
32+
33+
/**
34+
* {@inheritDoc}
35+
*
36+
* @return string Replication class
37+
*/
38+
public function replicationClassName() {}
39+
40+
/**
41+
* {@inheritDoc}
42+
*
43+
* @return string Replication options
44+
*/
45+
public function replicationOptions() {}
46+
47+
/**
48+
* {@inheritDoc}
49+
*
50+
* @return string Whether durable writes are enabled
51+
*/
52+
public function hasDurableWrites() {}
53+
54+
/**
55+
* {@inheritDoc}
56+
*
57+
* @param string $name Table name
58+
* @return Cassandra\Table|null Table instance or null
59+
*/
60+
public function table($name) {}
61+
62+
/**
63+
* {@inheritDoc}
64+
*
65+
* @return array An array of `Cassandra\Table` instances
66+
*/
67+
public function tables() {}
68+
}

Diff for: ext/doc/Cassandra/DefaultSchema.php

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
/**
4+
* Copyright 2015 DataStax, Inc.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
namespace Cassandra;
20+
21+
/**
22+
* A PHP representation of a schema
23+
*/
24+
final class DefaultSchema implements Schema
25+
{
26+
/**
27+
* {@inheritDoc}
28+
*
29+
* @param string $name Name of the keyspace to get
30+
* @return Cassandra\Keyspace|null Keyspace instance or null
31+
*/
32+
public function keyspace($name) {}
33+
34+
/**
35+
* {@inheritDoc}
36+
*
37+
* @return array An array of `Cassandra\Keyspace` instances.
38+
*/
39+
public function keyspaces() {}
40+
}

Diff for: ext/doc/Cassandra/DefaultSession.php

+7
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@
2525
*/
2626
final class DefaultSession implements Session
2727
{
28+
/**
29+
* {@inheritDoc}
30+
*
31+
* @return Schema current schema.
32+
*/
33+
public function schema() {}
34+
2835
/**
2936
* {@inheritDoc}
3037
*

0 commit comments

Comments
 (0)