thobbs / phpcassa

PHP client library for Apache Cassandra
thobbs.github.com/phpcassa
MIT License
248 stars 78 forks source link

warning generated in cf->get when columns=null and column_start populated #29

Closed sdolgy closed 13 years ago

sdolgy commented 13 years ago

Maybe this is by design, but just incase:

Sample code:

        $cf = new ColumnFamily(getConn(), 'entity_relations');
        $rows = $cf->get($uid, $columns=null, $column_start=array('foo:')); 

Error: PHP Warning: mb_detect_encoding() expects parameter 1 to be string, array given in /mnt/hgfs/workspace/core/include/columnfamily.php on line 865 PHP Warning: utf8_encode() expects parameter 1 to be string, array given in /mnt/hgfs/workspace/core/include/columnfamily.php on line 866"

Idea is to list all columns that start with "foo:"

thobbs commented 13 years ago

This is expected behavior, although something better than that PHP warning would be nice. $column_start should be a string (or int or UUID if your comparator_type is LongType, TimeUUIDType, etc).

sdolgy commented 13 years ago

may i suggest on https://github.com/thobbs/phpcassa/blob/master/columnfamily.php#L872:

if (!is_array($value) && mb_detect_encoding($value, "UTF-8") != "UTF-8")

to stop the warning being generated....?