Giter Club home page Giter Club logo

php-forex-quotes's People

Contributors

aditi-mi avatar bricktownseo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-forex-quotes's Issues

No error handling in ForexDataClient

ForexDataClient class, getQuotes function does not handle errors returned from the API.

For example, if quota has been exceeded, API returns something like:

{
  "error": true
  "message": "Your quota has been used fully.  Quotas reset at midnight EST. If you have any questions please email us at [email protected]"
}

but code ignores that and just tries to read quote data - which doesn't exist and PHP notices get thrown.

[6.0.0] Unwanted "print" in ForexDataClient

Hello,

Our company just met an issue with your newest v6.0.0 library.
There is a redundant print used in getQuotes() method. This resulted in malformed API response in our application. (debugging-relic perhaps?)

print("Here pairs". strlen($pairs));

Our walk-around for this bug was to cut off buffered output:

ob_start(); 
$result = $client->getQuotes(); 
ob_end_clean();

... but it is kind of dirty way. We hope that you could clean it up so we all can have a little more pretty code. :-)

Thanks in advance!
Kind regards,
Mike

Undefined offset: 2

Sometime use websocket to receive prices will happen exception "Receive server happen exception => Undefined offset: 2" ! Here is my code

try {
            $this->webSocket_client->onUpdate(function ($symbol, $data) {
                echo "[" . Carbon::now('Asia/Taipei')->toDateTimeString() . "] Receive {$symbol} ..." . PHP_EOL;
                echo "[" . Carbon::now('Asia/Taipei')->toDateTimeString() . "] Price => " . var_dump($data) . PHP_EOL;
                try {
                    $price = round($data['price'], 6);
                    $id = $this->product_list[$symbol];
                    $this->product_redisServer->hset($id, 'price', $price);
                } catch (\Exception $exception) {
                    echo "[" . Carbon::now('Asia/Taipei')->toDateTimeString() . "] Receive price happen exception => {$exception->getMessage()}" . PHP_EOL;
                }
            });

            $this->webSocket_client->onMessage(function ($message) {
                echo $message;
            });

            $this->webSocket_client->connect(function ($client) {
                //Subscribe to an array of currency pairs
                $client->subscribeTo([
                    'EURUSD',
                    'USDJPY',
                    'AUDUSD',
                    'GBPUSD',
                    'EURGBP',
                    'EURJPY',
                    'GBPJPY',
                    'BTCUSD',
                    'ETHUSD',
                    'XAUUSD',
                    'XAGUSD'
                ]);
            });
        } catch (\Exception $exception) {
            echo "[" . Carbon::now('Asia/Taipei')->toDateTimeString() . "] Receive server happen exception => {$exception->getMessage()}" . PHP_EOL;
        }

Not installed using composer

I am installing this package using composer but it requires php 5.6.4 but I am having the php 7.0 version

below error occurred

Problem 1
- Installation request for oneforge/forexquotes 2.0.8 -> satisfiable by oneforge/forexquotes[2.0.8].
- oneforge/forexquotes 2.0.8 requires php >=5.6.4 -> your PHP version (7.0.28-0ubuntu0.16.04.1) overridden by "config.platform.php" version (5.6) does not satisfy that requirement.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.