Skip to content

Commit

Permalink
Merge pull request #55 from linc/fix/simplify-notes
Browse files Browse the repository at this point in the history
Clarify a few steps in the migration process
  • Loading branch information
linc authored Dec 26, 2024
2 parents 9481541 + f2fdc7c commit 286b5e7
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config-sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
],
[
'alias' => 'test',
'alias' => 'target',
'type' => 'database',
'adapter' => 'mysql',
'host' => '127.0.0.1',
Expand Down
2 changes: 1 addition & 1 deletion data/sources.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
'Smf2',
'Toast',
'UserVoice',
'Vanilla',
'Vanilla1',
'Vanilla2',
'VBulletin',
'VBulletin5',
'WebWiz',
Expand Down
8 changes: 4 additions & 4 deletions src/Command/ShowCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public function __construct()
->argument('<name>', 'Name of package.')
->usage(
'<bold> show</end> <comment>[type] [name]</end> ## Show features of a package.<eol/>' .
'<bold> show</end> <comment>source vanilla2</end> ' .
'<bold> show</end> <comment>source Vanilla</end> ' .
'## Show what features can be migrated from Vanilla.<eol/>' .
'<bold> show</end> <comment>target flarum</end> ## Show what features can be migrated to Flarum.<eol/>'
'<bold> show</end> <comment>target Flarum</end> ## Show what features can be migrated to Flarum.<eol/>'
);
}

Expand Down Expand Up @@ -56,9 +56,9 @@ public static function viewFeatureList(string $type, string $name)

// Output.
$writer = new Writer();
if ($type === 'target' && strtolower($name) === 'vanilla2') {
if ($type === 'target' && strtolower($name) === 'vanilla') {
// Vanilla is the intermediary format, so all features are supported by necessity.
$writer->bold->green->write("\n" . 'All features are supported for target Vanilla2.' . "\n");
$writer->bold->green->write("\n" . 'All features are supported for target Vanilla.' . "\n");
} elseif (!array_key_exists($name, $supported)) {
// Error message for invalid package names.
$writer->bold->yellow->write("\n" . 'Unknown package "' . $name . '". Package is case-sensitive.' . "\n");
Expand Down
5 changes: 4 additions & 1 deletion src/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static function run(Request $request)
$exportSourceCM = new ConnectionManager($request->get('source'));
$importSourceCM = new ConnectionManager($request->get('target') ?? '');
// @todo Pass options not Request
$exportModel = exportModelFactory($request, $exportSourceCM, $storage, $importSourceCM);
$exportModel = exportModelFactory($request, $source, $exportSourceCM, $storage, $importSourceCM);

// No permissions warning.
$exportModel->comment('[ Porter never migrates user permissions! Reset user permissions afterward. ]' . "\n");
Expand Down Expand Up @@ -133,6 +133,9 @@ public static function run(Request $request)
} else {
$exportModel->comment("No Postscript found.");
}

// Doing this cleanup automatically is complex, so tell them to do it manually for now.
$exportModel->comment("After testing import, you may delete `PORT_` database tables.");
}

// End timer & report.
Expand Down
4 changes: 3 additions & 1 deletion src/Functions/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,15 @@ function postscriptFactory(string $target, Storage $storage, ConnectionManager $

/**
* @param Request $request
* @param Source $source
* @param ConnectionManager $exportSourceCM
* @param Storage $storage
* @param ConnectionManager $importSourceCM
* @return ExportModel
*/
function exportModelFactory(
Request $request,
Source $source,
ConnectionManager $exportSourceCM,
Storage $storage,
ConnectionManager $importSourceCM
Expand All @@ -134,7 +136,7 @@ function exportModelFactory(
$model = new ExportModel($db, $map, $storage, $importSourceCM);

// Set model properties.
$model->srcPrefix = $request->get('src-prefix') ?? '';
$model->srcPrefix = $request->get('src-prefix') ?? $source::SUPPORTED['prefix'];
$model->testMode = $request->get('test') ?? false;
$model->limitTables((string) $request->get('tables'));
$model->captureOnly = $request->get('dumpsql') ?? false;
Expand Down
2 changes: 1 addition & 1 deletion src/Source/Vanilla2.php → src/Source/Vanilla.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Porter\Source;
use Porter\ExportModel;

class Vanilla2 extends Source
class Vanilla extends Source
{
public const SUPPORTED = [
'name' => 'Vanilla 2+',
Expand Down

0 comments on commit 286b5e7

Please sign in to comment.