Skip to content

Commit

Permalink
add image content
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Sep 24, 2020
1 parent 1137c57 commit 506fb73
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/proxy/ClientBuild.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ class ClientBuild extends BaseObject

public $requestCloseUrl;

/**
* @var string The Url to the remote storage system which provides the file returnning the file content. The url will recieved an fileId param as well as buildToken and machine params.
*/
public $fileProviderUrl;

/**
* @var string The Url to the remote storage system which provides the image returnning the file content. The url will recieved an fileId param as well as buildToken and machine params.
*/
public $imageProviderUrl;

public $machineIdentifier;
Expand Down
18 changes: 15 additions & 3 deletions src/proxy/ClientTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,11 @@ private function request($offset)
/**
* Write the given data to the database.
*
* @param $data
* @param array $data
* @throws \yii\db\Exception
* @return int
*/
private function insertData($data)
private function insertData(array $data)
{
$inserted = $this->getDb()->createCommand()->batchInsert(
$this->getName(),
Expand All @@ -313,7 +313,13 @@ private function insertData($data)
return $inserted;
}

protected function cleanUpMatchRow($row)
/**
* Clean Up matching Rows
*
* @param array $row
* @return array
*/
protected function cleanUpMatchRow(array $row)
{
$data = [];
foreach ($row as $key => $item) {
Expand All @@ -327,6 +333,12 @@ protected function cleanUpMatchRow($row)
return $data;
}

/**
* Clean Up Batch Insert Fields
*
* @param array $fields
* @return array
*/
protected function cleanUpBatchInsertFields(array $fields)
{
$data = [];
Expand Down
3 changes: 3 additions & 0 deletions tests/admin/proxy/ClientTransferTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ public function testTransfer()
],
]);

$build->fileProviderUrl = 'https://luya.io/images/logo/0.2x/luya_logo@0.2x.png';
$build->imageProviderUrl = 'https://luya.io/images/logo/0.2x/luya_logo@0.2x.png';

$transfer = new ClientTransfer([
'build' => $build,
]);
Expand Down

0 comments on commit 506fb73

Please sign in to comment.