Browse Source

php cleanup

pull/793/head
Eli Zoller 4 years ago
parent
commit
9a16c4373b
  1. 12
      src/Flysystem/Adapter/FedoraAdapter.php

12
src/Flysystem/Adapter/FedoraAdapter.php

@ -11,7 +11,7 @@ use GuzzleHttp\Psr7;
use GuzzleHttp\Psr7\Response; use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Psr7\StreamWrapper; use GuzzleHttp\Psr7\StreamWrapper;
use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface; use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface;
use \DateTime; use DateTime;
/** /**
* Fedora adapter for Flysystem. * Fedora adapter for Flysystem.
@ -257,13 +257,13 @@ class FedoraAdapter implements AdapterInterface {
$headers = []; $headers = [];
$date = new DateTime(); $date = new DateTime();
$timestamp = $date->format("D, d M Y H:i:s O"); $timestamp = $date->format("D, d M Y H:i:s O");
// create version in Fedora. // Create version in Fedora.
try { try {
\Drupal::logger('flysystem')->info('right before make version ' . $status); \Drupal::logger('flysystem')->info('right before make version ' . $fedora_url);
$response = $this->fedora->createVersion( $response = $this->fedora->createVersion(
$fedora_url, $fedora_url,
$timestamp, $timestamp,
null, NULL,
$headers $headers
); );
$status = $response->getStatusCode(); $status = $response->getStatusCode();
@ -277,8 +277,8 @@ class FedoraAdapter implements AdapterInterface {
} }
// Return the response from Fedora. // Return the response from Fedora.
\Drupal::logger('flysystem')->info('past making a version with status ' . $status); \Drupal::logger('flysystem')->info('past making a version with status ' . $status);
// return $response; }
} catch (Exception $e) { 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");
} }
} }

Loading…
Cancel
Save