|
|
|
@ -250,16 +250,14 @@ class FedoraAdapter implements AdapterInterface {
|
|
|
|
|
* {@inheritdoc} |
|
|
|
|
*/ |
|
|
|
|
public function write($path, $contents, Config $config) { |
|
|
|
|
\Drupal::logger('flysystem adapter')->info('in write for flysystem'); |
|
|
|
|
if ($this->has($path)) { |
|
|
|
|
\Drupal::logger('flysystem adapter')->info('in write for flysystem and already exists in fedora'); |
|
|
|
|
$fedora_url = $path; |
|
|
|
|
$headers = []; |
|
|
|
|
$date = new DateTime(); |
|
|
|
|
$timestamp = $date->format("D, d M Y H:i:s O"); |
|
|
|
|
// Create version in Fedora. |
|
|
|
|
try { |
|
|
|
|
\Drupal::logger('flysystem')->info('right before make version ' . $fedora_url); |
|
|
|
|
\Drupal::logger('flysystem')->info('Request being sent to Fedora to make a version for ' . $fedora_url); |
|
|
|
|
$response = $this->fedora->createVersion( |
|
|
|
|
$fedora_url, |
|
|
|
|
$timestamp, |
|
|
|
@ -275,11 +273,9 @@ class FedoraAdapter implements AdapterInterface {
|
|
|
|
|
$status |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
// Return the response from Fedora. |
|
|
|
|
\Drupal::logger('flysystem')->info('past making a version with status ' . $status); |
|
|
|
|
} |
|
|
|
|
catch (\Exception $e) { |
|
|
|
|
\Drupal::logger('flysystem')->error('Caught exception when creating version: ', $e->getMessage(), "\n"); |
|
|
|
|
\Drupal::logger('flysystem')->error('Caught exception when creating version: ' . $e->getMessage() . "\n"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -404,3 +400,4 @@ class FedoraAdapter implements AdapterInterface {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|