Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [Command] add options for spark optimize command #9054

Closed
wants to merge 9 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix coding standards
warcooft committed Jul 30, 2024

Verified

This commit was signed with the committer’s verified signature.
warcooft Aselsan
commit e4d734bb25d289ca164eb57a1b052a323809bcd8
16 changes: 7 additions & 9 deletions system/Commands/Utilities/Optimize.php
Original file line number Diff line number Diff line change
@@ -25,6 +25,11 @@
*/
final class Optimize extends BaseCommand
{
private const CONFIG_CACHE = '$configCacheEnabled';
private const LOCATOR_CACHE = '$locatorCacheEnabled';
private const CONFIG_PATH = APPPATH . 'Config/Optimize.php';
private const CACHE_PATH = WRITEPATH . 'cache/FactoriesCache_config';

/**
* The group the command is lumped under
* when listing commands.
@@ -65,11 +70,6 @@ final class Optimize extends BaseCommand
'd' => 'Disable config and locator caching.',
];

private const CONFIG_CACHE = '$configCacheEnabled';
private const LOCATOR_CACHE = '$locatorCacheEnabled';
private const CONFIG_PATH = APPPATH . 'Config/Optimize.php';
private const CACHE_PATH = WRITEPATH . 'cache/FactoriesCache_config';

/**
* {@inheritDoc}
*/
@@ -154,7 +154,7 @@ private function runCaching(?bool $enableConfigCache, ?bool $enableLocatorCache,
if (in_array('public bool ' . self::LOCATOR_CACHE . ' = false;', $searchReplace, true)) {
$messages[] = 'FileLocator Caching is disabled in "app/Config/Optimize.php".';
}

foreach ($messages as $message) {
CLI::write($message, 'green');
CLI::newLine();
@@ -169,7 +169,6 @@ private function runCaching(?bool $enableConfigCache, ?bool $enableLocatorCache,

throw new RuntimeException(__METHOD__);
}

CLI::write('No changes to caching settings.', 'yellow');
}

@@ -231,5 +230,4 @@ private function removeDevPackages(): void

throw new RuntimeException(__METHOD__);
}

}
}