-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[!!!][FEATURE] Use the latest Bynder SDK #14
base: master
Are you sure you want to change the base?
Conversation
Relies on permanent token now instead of API tokens
Is required to be compatible with upcoming TYPO3 releases
$field_values = [ | ||
'pid' => 0, | ||
'tstamp' => $this->executionTime, | ||
'crdate' => $this->executionTime, | ||
'name' => 'Bynder', | ||
'description' => 'Automatically created during the installation of EXT:bynder', | ||
'driver' => BynderDriver::KEY, | ||
'configuration' => '', | ||
'is_online' => 1, | ||
'is_browsable' => 1, | ||
'is_public' => 1, | ||
'is_writable' => 0, | ||
'is_default' => 0, | ||
// We use the processed file folder of the default storage as fallback | ||
'processingfolder' => '1:/_processed_/', | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can pass this directory to the insert
without instantiating a variable.
$field_values = [ | ||
'pid' => 0, | ||
'tstamp' => $this->executionTime, | ||
'title' => 'Bynder', | ||
'description' => 'Automatically created during the installation of EXT:bynder', | ||
'path' => '', | ||
'base' => $storageUid, | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
|
||
/** | ||
* @param ProcessedFile $processedFile | ||
* @return bool | ||
* @param \BeechIt\Bynder\Service\BynderService $bynderService |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param \BeechIt\Bynder\Service\BynderService $bynderService | |
* @param BynderService $bynderService |
Shouldn't it be sufficient as you have the use statement above?
if ($resourceObject->getProperty('bynder_url')) { | ||
$publicUrl = $resourceObject->getProperty('bynder_url'); | ||
} else { | ||
$publicUrl = ConfigurationUtility::getUnavailableImage($relativeToCurrentScript); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about this?
if ($resourceObject->getProperty('bynder_url')) { | |
$publicUrl = $resourceObject->getProperty('bynder_url'); | |
} else { | |
$publicUrl = ConfigurationUtility::getUnavailableImage($relativeToCurrentScript); | |
} | |
$publicUrl = $resourceObject->getProperty('bynder_url') ?: ConfigurationUtility::getUnavailableImage($relativeToCurrentScript); |
*/ | ||
public function dumpFileContents($identifier) | ||
{ | ||
try { | ||
$downloadLocation = $this->getAssetBankManager()->getMediaDownloadLocation($identifier)->wait(); | ||
readfile($downloadLocation['s3_file'], 0); | ||
readfile($downloadLocation['s3_file'], false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can speed up everything if you add the global namespace to the native php functions.
readfile($downloadLocation['s3_file'], false); | |
\readfile($downloadLocation['s3_file'], false); |
NOTE: This changes the authentication from user specific tokens to permanent tokens which can be created in http://yourbynder.domain.com/pysettings/permanent-tokens/
As the SDK finds the old solution obsolete, they want you to use this or the OAuth apps credentials.
Check: https://github.com/Bynder/bynder-php-sdk/blob/master/sample/sample.php
In this PR:
Todo after this: