Loading modules/lightning_media_bulk_upload/lightning_media_bulk_upload.install +6 −4 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ * Contains installation and update functions for Lightning Media Bulk Upload. */ use Drupal\Core\Archiver\Zip; use Drupal\Core\Archiver\Tar; use GuzzleHttp\RequestOptions; /** Loading @@ -27,7 +27,7 @@ function lightning_media_bulk_upload_update_9001(array &$sandbox) { } // Allow the destination directory to be overridden in tests. $destination = $sandbox[__FUNCTION__] ?? Drupal::root() . '/libraries/dropzone'; $destination = $sandbox[__FUNCTION__] ?? Drupal::root() . '/libraries'; // Ensure the destination exists and is writable, or abort the update. /** @var \Drupal\Core\File\FileSystemInterface $file_system */ Loading @@ -45,14 +45,16 @@ function lightning_media_bulk_upload_update_9001(array &$sandbox) { } Drupal::httpClient() ->request('GET', 'https://github.com/dropzone/dropzone/releases/download/v5.9.3/dist.zip', [ ->request('GET', 'https://github.com/dropzone/dropzone-packagist/archive/refs/tags/v5.7.3.tar.gz', [ RequestOptions::SINK => $file, ]); $archiver = new Zip($file); $archiver = new Tar($file); $archiver->extract($destination); rename("$destination/dropzone-packagist-5.7.3", "$destination/dropzone"); $file_system->delete($file); $destination .= '/dropzone'; return t('The Dropzone JavaScript library was installed in %destination. Remember to add it to your version control system.', [ '%destination' => $destination, ]); Loading modules/lightning_media_bulk_upload/tests/fixtures/dropzone.tar.gz 0 → 100644 +654 B File added.No diff preview for this file type. View file modules/lightning_media_bulk_upload/tests/fixtures/dropzone.zipdeleted 100644 → 0 −412 B File deleted. View file modules/lightning_media_bulk_upload/tests/src/Kernel/Update9001Test.php +4 −4 Original line number Diff line number Diff line Loading @@ -38,11 +38,11 @@ class Update9001Test extends KernelTestBase { // Mock the HTTP client so it returns our fake zip file when downloading // Dropzone. $zip = fopen(__DIR__ . '/../../fixtures/dropzone.zip', 'rb'); $this->assertIsResource($zip); $tar = fopen(__DIR__ . '/../../fixtures/dropzone.tar.gz', 'rb'); $this->assertIsResource($tar); $handler = new MockHandler([ new Response(200, ['Content-Type' => 'application/zip'], $zip), new Response(200, ['Content-Type' => 'application/tar+gzip'], $tar), ]); $client = new Client([ 'handler' => HandlerStack::create($handler), Loading @@ -50,7 +50,7 @@ class Update9001Test extends KernelTestBase { $this->container->set('http_client', $client); $sandbox = [ 'lightning_media_bulk_upload_update_9001' => 'public://libraries/dropzone', 'lightning_media_bulk_upload_update_9001' => 'public://libraries', ]; $this->container->get('module_handler') ->loadInclude('lightning_media_bulk_upload', 'install'); Loading modules/lightning_media_image/lightning_media_image.install +3 −3 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ * Contains install and update routines for Lightning Media Image. */ use Drupal\Core\Archiver\Zip; use Drupal\Core\Archiver\Tar; use Drupal\lightning_core\ConfigHelper as Config; use GuzzleHttp\RequestOptions; use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; Loading Loading @@ -184,11 +184,11 @@ function lightning_media_image_update_9001(array &$sandbox) { } Drupal::httpClient() ->request('GET', 'https://github.com/fengyuanchen/cropper/archive/refs/tags/v2.3.4.zip', [ ->request('GET', 'https://github.com/fengyuanchen/cropper/archive/refs/tags/v2.3.4.tar.gz', [ RequestOptions::SINK => $file, ]); $archiver = new Zip($file); $archiver = new Tar($file); $archiver->extract($destination); rename("$destination/cropper-2.3.4", "$destination/cropper"); $file_system->delete($file); Loading Loading
modules/lightning_media_bulk_upload/lightning_media_bulk_upload.install +6 −4 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ * Contains installation and update functions for Lightning Media Bulk Upload. */ use Drupal\Core\Archiver\Zip; use Drupal\Core\Archiver\Tar; use GuzzleHttp\RequestOptions; /** Loading @@ -27,7 +27,7 @@ function lightning_media_bulk_upload_update_9001(array &$sandbox) { } // Allow the destination directory to be overridden in tests. $destination = $sandbox[__FUNCTION__] ?? Drupal::root() . '/libraries/dropzone'; $destination = $sandbox[__FUNCTION__] ?? Drupal::root() . '/libraries'; // Ensure the destination exists and is writable, or abort the update. /** @var \Drupal\Core\File\FileSystemInterface $file_system */ Loading @@ -45,14 +45,16 @@ function lightning_media_bulk_upload_update_9001(array &$sandbox) { } Drupal::httpClient() ->request('GET', 'https://github.com/dropzone/dropzone/releases/download/v5.9.3/dist.zip', [ ->request('GET', 'https://github.com/dropzone/dropzone-packagist/archive/refs/tags/v5.7.3.tar.gz', [ RequestOptions::SINK => $file, ]); $archiver = new Zip($file); $archiver = new Tar($file); $archiver->extract($destination); rename("$destination/dropzone-packagist-5.7.3", "$destination/dropzone"); $file_system->delete($file); $destination .= '/dropzone'; return t('The Dropzone JavaScript library was installed in %destination. Remember to add it to your version control system.', [ '%destination' => $destination, ]); Loading
modules/lightning_media_bulk_upload/tests/fixtures/dropzone.tar.gz 0 → 100644 +654 B File added.No diff preview for this file type. View file
modules/lightning_media_bulk_upload/tests/fixtures/dropzone.zipdeleted 100644 → 0 −412 B File deleted. View file
modules/lightning_media_bulk_upload/tests/src/Kernel/Update9001Test.php +4 −4 Original line number Diff line number Diff line Loading @@ -38,11 +38,11 @@ class Update9001Test extends KernelTestBase { // Mock the HTTP client so it returns our fake zip file when downloading // Dropzone. $zip = fopen(__DIR__ . '/../../fixtures/dropzone.zip', 'rb'); $this->assertIsResource($zip); $tar = fopen(__DIR__ . '/../../fixtures/dropzone.tar.gz', 'rb'); $this->assertIsResource($tar); $handler = new MockHandler([ new Response(200, ['Content-Type' => 'application/zip'], $zip), new Response(200, ['Content-Type' => 'application/tar+gzip'], $tar), ]); $client = new Client([ 'handler' => HandlerStack::create($handler), Loading @@ -50,7 +50,7 @@ class Update9001Test extends KernelTestBase { $this->container->set('http_client', $client); $sandbox = [ 'lightning_media_bulk_upload_update_9001' => 'public://libraries/dropzone', 'lightning_media_bulk_upload_update_9001' => 'public://libraries', ]; $this->container->get('module_handler') ->loadInclude('lightning_media_bulk_upload', 'install'); Loading
modules/lightning_media_image/lightning_media_image.install +3 −3 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ * Contains install and update routines for Lightning Media Image. */ use Drupal\Core\Archiver\Zip; use Drupal\Core\Archiver\Tar; use Drupal\lightning_core\ConfigHelper as Config; use GuzzleHttp\RequestOptions; use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; Loading Loading @@ -184,11 +184,11 @@ function lightning_media_image_update_9001(array &$sandbox) { } Drupal::httpClient() ->request('GET', 'https://github.com/fengyuanchen/cropper/archive/refs/tags/v2.3.4.zip', [ ->request('GET', 'https://github.com/fengyuanchen/cropper/archive/refs/tags/v2.3.4.tar.gz', [ RequestOptions::SINK => $file, ]); $archiver = new Zip($file); $archiver = new Tar($file); $archiver->extract($destination); rename("$destination/cropper-2.3.4", "$destination/cropper"); $file_system->delete($file); Loading