Skip to content

Commit

Permalink
Updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
imanilchaudhari committed Nov 22, 2017
1 parent d664b85 commit 443129f
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 7 deletions.
1 change: 1 addition & 0 deletions Cache/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace imanilchaudhari\CurrencyConverter\Cache\Adapter;

use DateInterval;
Expand Down
1 change: 1 addition & 0 deletions Cache/Adapter/CacheAdapterInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace imanilchaudhari\CurrencyConverter\Cache\Adapter;

interface CacheAdapterInterface
Expand Down
1 change: 1 addition & 0 deletions Cache/Adapter/FileSystem.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace imanilchaudhari\CurrencyConverter\Cache\Adapter;

class FileSystem extends AbstractAdapter
Expand Down
1 change: 1 addition & 0 deletions CurrencyConverterInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace imanilchaudhari\CurrencyConverter;

interface CurrencyConverterInterface
Expand Down
1 change: 1 addition & 0 deletions Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace imanilchaudhari\CurrencyConverter\Exception;

interface ExceptionInterface
Expand Down
1 change: 1 addition & 0 deletions Exception/RunTimeException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace imanilchaudhari\CurrencyConverter\Exception;

class RuntimeException extends \RuntimeException implements ExceptionInterface
Expand Down
1 change: 1 addition & 0 deletions Provider/ProviderInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace imanilchaudhari\CurrencyConverter\Provider;

interface ProviderInterface
Expand Down
1 change: 1 addition & 0 deletions Provider/YahooApi.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace imanilchaudhari\CurrencyConverter\Provider;

class YahooApi implements ProviderInterface
Expand Down
46 changes: 41 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ This extension will help to find out current currency conversion rate. This exte

Why Use It
-----------
* Reliable Rate, Uses Yahoo API
* Conversion without curreny code(from country code)
* Caching of rate, to avoid connecting to Yahoo again and again ( Working on caching )
* Reliable Rate. Uses Yahoo API, Open Exchange Rates API.
* Conversion without curreny code (from country code).
* Caching of rate, to avoid connecting to Yahoo again and again.

Important Notice
----------------
As of recent changes on Yahoo Terms of Service. As such, the service is being discontinued. I highly recommend you to use [Open Exchange Rates API](http://openexchangerates.org/). As suggested by [chaimleich](https://github.com/chaimleich) on this [pull request](https://github.com/imanilchaudhari/yii2-currency-converter/pull/3). You can find Open Exchnage Rates working example below.

Requirements
-----------
Expand All @@ -23,13 +27,13 @@ The preferred way to install this extension is through [composer](http://getcomp
Either run

```
php composer.phar require --prefer-dist imanilchaudhari/yii2-currency-converter "dev-master"
php composer.phar require --prefer-dist imanilchaudhari/yii2-currency-converter "1.0"
```

or add

```
"imanilchaudhari/yii2-currency-converter": "dev-master"
"imanilchaudhari/yii2-currency-converter": "1.0"
```

to the require section of your `composer.json` file.
Expand Down Expand Up @@ -299,3 +303,35 @@ $currencies = [
];

```

Contributors
-------
* [Robot72](https://github.com/Robot72 "Robot72")
* [chaimleich](https://github.com/chaimleich "chaimleich")

Open Exchange Rates APi Integration
-----------------------------------
Here is a code snippets suggested by [chaimleich](https://github.com/chaimleich) on [this pull request](https://github.com/imanilchaudhari/yii2-currency-converter/pull/3).
```php

use Yii;
use imanilchaudhari\CurrencyConverter\Provider\OpenExchangeRatesApi;

class CurrencyConverter extends \imanilchaudhari\CurrencyConverter\CurrencyConverter
{
/**
* @inheritdoc
*/
public function getRateProvider()
{
if (!$this->rateProvider) {
$this->setRateProvider(new OpenExchangeRatesApi([
'appId' => Yii::$app->params['openExchangeRate']['appId'],
]));
}

return $this->rateProvider;
}
}
```

3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"authors": [
{
"name": "Anil Chaudhari",
"email": "caanil90@gmail.com"
"email": "imanilchaudhari@gmail.com"
}
],
"minimum-stability": "stable",
Expand All @@ -17,7 +17,6 @@
"url": "https://github.com/imanilchaudhari/yii2-currency-converter.git"
}
],

"require": {
"php": ">=5.4.0",
"yiisoft/yii2": "*"
Expand Down

0 comments on commit 443129f

Please sign in to comment.