ADSL Traffic import
This commit is contained in:
11
app/Classes/External/Supplier.php
vendored
11
app/Classes/External/Supplier.php
vendored
@@ -26,7 +26,7 @@ abstract class Supplier
|
||||
* @param array $args
|
||||
* @return mixed
|
||||
*/
|
||||
protected function connect(array $args=[])
|
||||
public function connect(array $args=[])
|
||||
{
|
||||
if ($x=$this->mustPause()) {
|
||||
Log::error('API Throttle, waiting .',['m'=>__METHOD__]);
|
||||
@@ -80,7 +80,7 @@ abstract class Supplier
|
||||
* @param Collection $expect
|
||||
* @return Collection
|
||||
*/
|
||||
protected function getColumns(string $line,Collection $expect): Collection
|
||||
public function getColumns(string $line,Collection $expect): Collection
|
||||
{
|
||||
$fields = collect(explode(',',$line))->filter();
|
||||
$this->_columns = $expect;
|
||||
@@ -98,11 +98,16 @@ abstract class Supplier
|
||||
* @param string $key
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getColumnKey(string $key)
|
||||
public function getColumnKey(string $key)
|
||||
{
|
||||
return $this->_columns->search($key);
|
||||
}
|
||||
|
||||
public function header(): array
|
||||
{
|
||||
return static::$header;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the supplier has API throttling...
|
||||
*
|
||||
|
31
app/Classes/External/Supplier/ExetelVisp.php
vendored
Normal file
31
app/Classes/External/Supplier/ExetelVisp.php
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\External\Supplier;
|
||||
|
||||
use App\Classes\External\Supplier;
|
||||
|
||||
/**
|
||||
* Class ExetelVisp
|
||||
* Handles interacting with Exetel VISP
|
||||
*
|
||||
* @package App\Classes\External\Payments
|
||||
*/
|
||||
class ExetelVisp extends Supplier
|
||||
{
|
||||
protected $login_user_field = 'username';
|
||||
protected $login_pass_field = 'password';
|
||||
protected $date_field = 'date';
|
||||
|
||||
protected static $header = [
|
||||
'Login',
|
||||
'Date',
|
||||
'Peak upload',
|
||||
'Peak download',
|
||||
'Off peak upload',
|
||||
'Off peak download',
|
||||
];
|
||||
|
||||
// Exetel provides data in CSV format, eg:
|
||||
// Login, Date, Peak upload, Peak download, Off peak upload, Off peak download\n
|
||||
// 0301408987@graytech.net.au,2020-05-02,41.35,41.04,49.22,27.69\n
|
||||
}
|
Reference in New Issue
Block a user