Skip to content

Commit

Permalink
Moved migration helpers into their own namespace
Browse files Browse the repository at this point in the history
Technically an API breakage, but I don't see migration helpers as part of our API surface.
They're one off utilities
  • Loading branch information
chillu committed Apr 16, 2019
1 parent bda94d7 commit 872396e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SilverStripe\Assets;
namespace SilverStripe\Assets\Migration;

use SilverStripe\Assets\Flysystem\FlysystemAssetStore;
use SilverStripe\Assets\Storage\AssetStore;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?php

namespace SilverStripe\Assets;
namespace SilverStripe\Assets\Migration;

use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use SilverStripe\Assets\File;
use SilverStripe\Assets\FilenameParsing\LegacyFileIDHelper;
use SilverStripe\Assets\Flysystem\FlysystemAssetStore;
use SilverStripe\Assets\Folder;
use SilverStripe\Core\Config\Configurable;
use SilverStripe\Core\Environment;
use SilverStripe\Core\Injector\Injectable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<?php

namespace SilverStripe\Assets\Tests;
namespace SilverStripe\Assets\Tests\Migration;

use Silverstripe\Assets\Dev\TestAssetStore;
use SilverStripe\Assets\File;
use SilverStripe\Assets\FileMigrationHelper;
use SilverStripe\Assets\Migration\FileMigrationHelper;
use SilverStripe\Assets\Filesystem;
use SilverStripe\Assets\Flysystem\FlysystemAssetStore;
use SilverStripe\Assets\Folder;
use SilverStripe\Assets\Image;
use SilverStripe\Assets\Tests\FileMigrationHelperTest\Extension;
use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Convert;
use SilverStripe\Dev\SapphireTest;

/**
Expand Down Expand Up @@ -49,7 +47,7 @@ public function setUp()
TestAssetStore::activate('FileMigrationHelperTest/assets');

// Ensure that each file has a local record file in this new assets base
$from = __DIR__ . '/ImageTest/test-image-low-quality.jpg';
$from = __DIR__ . '/../ImageTest/test-image-low-quality.jpg';
foreach (File::get()->exclude('ClassName', Folder::class) as $file) {
$dest = TestAssetStore::base_path() . '/' . $file->generateFilename();
Filesystem::makeFolder(dirname($dest));
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
<?php

namespace SilverStripe\Assets\Tests;
namespace SilverStripe\Assets\Tests\Migration;

use Silverstripe\Assets\Dev\TestAssetStore;
use SilverStripe\Assets\File;
use SilverStripe\Assets\FileMigrationHelper;
use SilverStripe\Assets\FilenameParsing\ParsedFileID;
use SilverStripe\Assets\Filesystem;
use SilverStripe\Assets\Flysystem\FlysystemAssetStore;
use SilverStripe\Assets\Folder;
use SilverStripe\Assets\Image;
use SilverStripe\Assets\LegacyThumbnailMigrationHelper;
use SilverStripe\Assets\Migration\LegacyThumbnailMigrationHelper;
use SilverStripe\Assets\Storage\AssetStore;
use SilverStripe\Assets\Tests\FileMigrationHelperTest\Extension;
use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Convert;
use SilverStripe\Dev\SapphireTest;

Expand Down Expand Up @@ -49,7 +46,7 @@ public function setUp()
TestAssetStore::activate('LegacyThumbnailMigrationHelperTest/assets');

// Ensure that each file has a local record file in this new assets base
$from = $this->joinPaths(__DIR__, 'ImageTest/test-image-low-quality.jpg');
$from = $this->joinPaths(__DIR__, '..', 'ImageTest/test-image-low-quality.jpg');
foreach (File::get()->exclude('ClassName', Folder::class) as $file) {
/** @var $file File */
$file->setFromLocalFile($from, $file->generateFilename());
Expand Down

0 comments on commit 872396e

Please sign in to comment.