deemru / WavesKit

Waves Platform Development Kit for PHP
https://packagist.org/packages/deemru/waveskit
MIT License
24 stars 8 forks source link

Request: Add method to get Data by providing a regexp #8

Closed sunchaser68 closed 5 years ago

sunchaser68 commented 5 years ago

Proposal to add a method to retrieve Data by specifying a regexp. The engine should extract all keys satisfying a certain regexp.

There could be a performance problem if the regexp expression extract too many items, maybe a limit can be added.

Alternatively please evaluate an API to extract all data from an address so it can be processed in an array

deemru commented 5 years ago

Actually you can already use fetch() for your custom requests:

define( 'WK_CURL_TIMEOUT', 30 ); // 30 seconds request timeout instead of 5 seconds by default

$wk = new WavesKit();
$data = $wk->fetch( '/addresses/data/3P8M8XGF2uzDazV5fzdKNxrbC3YqCWScKxw?matches=[$].*' );
$records = $wk->json_decode( $data );
foreach( $records as $record )
    $wk->log( 'i', json_encode( $record ) );

Currently there is no plan to implement more for that.

sunchaser68 commented 5 years ago

Thank you deemru