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

ENH Do not rely on flush variable #11440

Merged

Conversation

emteknetnz
Copy link
Member

@emteknetnz emteknetnz commented Oct 22, 2024

Issue silverstripe/.github#324

Notes on a couple of places where $request->getVar('flush') is used that were not changed:

RequestFlushDiscover::lookupRequest() - not changed because it's the central place that checks $request->getVar('flush'), somewhere has to do it after all

SapphireTest::start() - unlike the new sake, it still uses CLIRequestBuilder::createFromEnvironment() which returns an HTTPRequest. Without significant refactoring it needs to stay this way as you need to be able to use without sake e.g. vendor/bin/phpunit path/to/something

$kernel = Injector::inst()->get(Kernel::class);
if (!$flush || (method_exists($kernel, 'isFlushed') && $kernel->isFlushed())) {
return false;
if ($request->getURL() === 'dev/build') {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've redone the logic on this one since it was already checked Injector::inst()->get(Kernel::class)->isFlushed() and returning false if isFlushed() was true.

@emteknetnz emteknetnz force-pushed the pulls/6/no-get-flush branch from 7e22fc4 to b1b469a Compare October 22, 2024 06:09
Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, though unfortunately since this is happening before the template stuff gets merged, the SSViewer_FromString is kinda pointless. I'll make a note to update it in the template PRs as well.

@GuySartorelli GuySartorelli merged commit 715c2de into silverstripe:6 Oct 22, 2024
10 checks passed
@GuySartorelli GuySartorelli deleted the pulls/6/no-get-flush branch October 22, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants