Page MenuHomePhorge

No OneTemporary

Size
3 KB
Referenced Files
None
Subscribers
None
diff --git a/src/app/Console/Commands/Data/Import/ExchangerateCommand.php b/src/app/Console/Commands/Data/Import/OpenExchangeRatesCommand.php
similarity index 82%
rename from src/app/Console/Commands/Data/Import/ExchangerateCommand.php
rename to src/app/Console/Commands/Data/Import/OpenExchangeRatesCommand.php
index 29bb10b2..8a21f5fd 100644
--- a/src/app/Console/Commands/Data/Import/ExchangerateCommand.php
+++ b/src/app/Console/Commands/Data/Import/OpenExchangeRatesCommand.php
@@ -1,48 +1,49 @@
<?php
namespace App\Console\Commands\Data\Import;
use App\Console\Command;
-class ExchangerateCommand extends Command
+class OpenExchangeRatesCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
- protected $signature = 'data:import:exchangerates {sourceCurrency}';
+ protected $signature = 'data:import:open-exchange-rates';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Fetches exchangerates from openexchangerates.org';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
- $sourceCurrency = strtoupper($this->argument('sourceCurrency'));
+ $sourceCurrency = 'CHF';
+
$rates = \App\Backends\OpenExchangeRates::retrieveRates($sourceCurrency);
//
// export
//
$file = resource_path("exchangerates-$sourceCurrency.php");
$out = "<?php return [\n";
foreach ($rates as $countryCode => $rate) {
$out .= sprintf(" '%s' => '%s',\n", $countryCode, $rate);
}
$out .= "];\n";
file_put_contents($file, $out);
}
}
diff --git a/src/app/Console/Commands/Data/ImportCommand.php b/src/app/Console/Commands/Data/ImportCommand.php
index 2e9849e9..1fed8ab5 100644
--- a/src/app/Console/Commands/Data/ImportCommand.php
+++ b/src/app/Console/Commands/Data/ImportCommand.php
@@ -1,54 +1,55 @@
<?php
namespace App\Console\Commands\Data;
use Illuminate\Console\Command;
class ImportCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'data:import';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$commands = [
- Import\CountriesCommand::class,
- Import\IP4NetsCommand::class,
- Import\IP6NetsCommand::class
+ #Import\CountriesCommand::class,
+ Import\OpenExchangeRatesCommand::class,
+ #Import\IP4NetsCommand::class,
+ #Import\IP6NetsCommand::class
];
foreach ($commands as $command) {
$execution = new $command();
$execution->output = $this->output;
$execution->handle();
}
return 0;
}
}

File Metadata

Mime Type
text/x-diff
Expires
Sat, Jan 31, 1:50 PM (1 d, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
426318
Default Alt Text
(3 KB)

Event Timeline