From 11d0ea46a8852098231d5764fd7ad89e421e88b8 Mon Sep 17 00:00:00 2001
From: Steve Persch <steve.persch@pantheon.io>
Date: Mon, 27 May 2019 14:34:27 -0500
Subject: [PATCH 1/3] delete
 web/modules/custom/nerdcustom/src/StreamWrapper/CachedHttpStreamWrapper.php

---
 .../StreamWrapper/CachedHttpStreamWrapper.php | 73 -------------------
 1 file changed, 73 deletions(-)
 delete mode 100644 web/modules/custom/nerdcustom/src/StreamWrapper/CachedHttpStreamWrapper.php

diff --git a/web/modules/custom/nerdcustom/src/StreamWrapper/CachedHttpStreamWrapper.php b/web/modules/custom/nerdcustom/src/StreamWrapper/CachedHttpStreamWrapper.php
deleted file mode 100644
index a05dde44a..000000000
--- a/web/modules/custom/nerdcustom/src/StreamWrapper/CachedHttpStreamWrapper.php
+++ /dev/null
@@ -1,73 +0,0 @@
-<?php
-
-/**
- * @file
- * Statically cache file sizes during a migration.
- */
-
-// phpcs:ignoreFile
-namespace Drupal\nerdcustom\StreamWrapper;
-
-use Drupal\Core\StreamWrapper\StreamWrapperInterface;
-use GuzzleHttp\ClientInterface;
-use GuzzleHttp\Exception\ClientException;
-use GuzzleHttp\Exception\ServerException;
-use Drupal\remote_stream_wrapper\StreamWrapper\HttpStreamWrapper;
-use Drupal\Core\Database\Database;
-
-// @todo, https://github.com/stevector/nerdologues-d8/issues/173
-// these manual require statements should not be necessary.
-// Something about the autoloader is failing.
-require_once 'modules/contrib/remote_stream_wrapper/src/StreamWrapper/HttpStreamWrapper.php';
-require_once 'modules/contrib/remote_stream_wrapper/src/StreamWrapper/RemoteStreamWrapperInterface.php';
-/**
- * HTTP(s) stream wrapper.
- */
-class CachedHttpStreamWrapper extends HttpStreamWrapper {
-
-  /**
-   * {@inheritdoc}
-   */
-  public function stream_stat() {
-    // @see https://github.com/guzzle/psr7/blob/master/src/StreamWrapper.php
-    $stat = [
-      'dev' => 0,               // device number
-      'ino' => 0,               // inode number
-      'mode' => 0100000 | 0444, // inode protection (regular file + read only)
-      'nlink' => 0,             // number of links
-      'uid' => 0,               // userid of owner
-      'gid' => 0,               // groupid of owner
-      'rdev' => 0,              // device type, if inode device *
-      'size' => 0,              // size in bytes
-      'atime' => 0,             // time of last access (Unix timestamp)
-      'mtime' => 0,             // time of last modification (Unix timestamp)
-      'ctime' => 0,             // time of last inode change (Unix timestamp)
-      'blksize' => 0,           // blocksize of filesystem IO
-      'blocks' => 0,            // number of blocks allocated
-    ];
-    $files = &drupal_static(__METHOD__, array());
-
-    if (empty($files) && function_exists('drush_print') && !empty(Database::getConnectionInfo('drupal_7'))) {
-      drush_print("Loading all files from Drupal 7 database");
-      $files = [];
-      $results = Database::getConnection('default', 'drupal_7')
-        ->select('file_managed')
-        ->fields('file_managed')->execute();
-
-       foreach ($results as $result) {
-         $files[$result->uri] = [
-           'size' => $result->filesize,
-           'mtime' => $result->timestamp
-         ];
-      }
-    }
-
-    if (!empty($files[$this->uri])) {
-      $stat =  $files[$this->uri] + $stat;
-      return $stat;
-    }
-    else {
-      return parent::stream_stat();
-    }
-  }
-}

From bb8e6c36ab4af156a5cf5c3e7b7357114384d20c Mon Sep 17 00:00:00 2001
From: Steve Persch <steve.persch@pantheon.io>
Date: Mon, 27 May 2019 14:35:00 -0500
Subject: [PATCH 2/3] delete
 web/modules/custom/nerdcustom/src/NerdcustomServiceProvider.php

---
 .../src/NerdcustomServiceProvider.php         | 23 -------------------
 1 file changed, 23 deletions(-)
 delete mode 100644 web/modules/custom/nerdcustom/src/NerdcustomServiceProvider.php

diff --git a/web/modules/custom/nerdcustom/src/NerdcustomServiceProvider.php b/web/modules/custom/nerdcustom/src/NerdcustomServiceProvider.php
deleted file mode 100644
index 689a532bc..000000000
--- a/web/modules/custom/nerdcustom/src/NerdcustomServiceProvider.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-
-namespace Drupal\nerdcustom;
-
-use Drupal\Core\DependencyInjection\ContainerBuilder;
-use Drupal\Core\DependencyInjection\ServiceProviderBase;
-
-/**
- * Swaps services.
- */
-class NerdCustomServiceProvider extends ServiceProviderBase {
-
-  /**
-   * {@inheritdoc}
-   */
-  public function alter(ContainerBuilder $container) {
-    $definition = $container->getDefinition('stream_wrapper.http');
-    $definition->setClass('\Drupal\nerdcustom\StreamWrapper\CachedHttpStreamWrapper');
-    $definition = $container->getDefinition('stream_wrapper.https');
-    $definition->setClass('\Drupal\nerdcustom\StreamWrapper\CachedHttpStreamWrapper');
-  }
-
-}

From 75c7b69be25db93617da9a238c4a270ddbdadb9b Mon Sep 17 00:00:00 2001
From: Steve Persch <stevector@users.noreply.github.com>
Date: Mon, 25 Feb 2019 11:15:38 -0600
Subject: [PATCH 3/3] Update nerdcustom.services.yml

---
 web/modules/custom/nerdcustom/nerdcustom.services.yml | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/web/modules/custom/nerdcustom/nerdcustom.services.yml b/web/modules/custom/nerdcustom/nerdcustom.services.yml
index 8e77a3d4e..74325b9e9 100644
--- a/web/modules/custom/nerdcustom/nerdcustom.services.yml
+++ b/web/modules/custom/nerdcustom/nerdcustom.services.yml
@@ -2,13 +2,3 @@ services:
   nerdcustom.clipcreator:
     class: Drupal\nerdcustom\ClipCreator
     arguments: ["@entity.manager"]
-  stream_wrapper.http:
-    class: Drupal\nerdcustom\StreamWrapper\CachedHttpStreamWrapper
-    arguments: ['@http_client']
-    tags:
-      - { name: stream_wrapper, scheme: http }
-  stream_wrapper.https:
-    class: Drupal\nerdcustom\StreamWrapper\CachedHttpStreamWrapper
-    arguments: ['@http_client']
-    tags:
-      - { name: stream_wrapper, scheme: https }