Skip to content

Commit

Permalink
Prepare to more downloaders
Browse files Browse the repository at this point in the history
  • Loading branch information
JanGalek committed Jan 24, 2017
1 parent 46da537 commit 3703792
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ or manual edit composer.json in your project

```json
"require": {
"galek/exchange-rate": "^0.2.2"
"galek/exchange-rate": "^0.2.6"
}
```

Expand Down
5 changes: 5 additions & 0 deletions src/Galek/Utils/Exchange/Downloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ public function __construct($validate, $tempDir, $url = null)
}
}

public function setTempDir($tempDir)
{
$this->tempDir = $tempDir;
}

/**
* [setUrl description]
* @param [type] $url [description]
Expand Down
8 changes: 8 additions & 0 deletions src/Galek/Utils/Exchange/Exchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ abstract class Exchange implements IExchange
/** @var string Bank currency */
public $currency = "EUR";

/** @var string Path to temp dir with permisions */
public $tempDir;

/** @var Downloader */
public $downloader;

public function __construct($tempDir = null)
{
$this->setTempDir($tempDir);
Expand All @@ -29,6 +33,10 @@ public function setTempDir($tempDir)
} else {
$this->tempDir = $tempDir;
}

if ($this->downloader !== null) {
$this->downloader->setTempDir($this->tempDir);
}
}

public function transferBasicCurrency($currency, $amount = 1, $round = false)
Expand Down

0 comments on commit 3703792

Please sign in to comment.