PHP code example of hxy2015 / yii2-hbase

1. Go to this page and download the library: Download hxy2015/yii2-hbase library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hxy2015 / yii2-hbase example snippets


return [
    //....
    'components' => [
        'hbase' => [
            'class' => 'hxy2015\hbase\Connection',
            'host' => 'localhost',
            'port' => '8080',
        ],
    ]
];

Yii::get('hbase')->tables()->table('user')->row('12')->put('base_info:name', 'huangxiaohu');


# 取某一列族数据
Yii::$app->get('hbase')->tables()->table('user')->row('12')->get('base_info');

# 取某一列数据
Yii::$app->get('hbase')->tables()->table('user')->row('12')->get('base_info:name');