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

[3.3] [Deprecations] Switch YamlUpdater to use Bolt filesystem for YAML handling #6557

Merged
merged 9 commits into from
Apr 15, 2017
Merged

[3.3] [Deprecations] Switch YamlUpdater to use Bolt filesystem for YAML handling #6557

merged 9 commits into from
Apr 15, 2017

Conversation

GwendolenLynch
Copy link
Contributor

Cuts out deprecations in SF 3.1+ too

@GwendolenLynch GwendolenLynch added this to the Bolt 3.3 - Feature release milestone Apr 9, 2017
@GwendolenLynch GwendolenLynch requested a review from CarsonF April 9, 2017 10:08
@GwendolenLynch
Copy link
Contributor Author

Side note:

$ ./app/nut config:get thumbnails/aliases/myimageformat/cropping -f theme://theme.yml
thumbnails/aliases/myimageformat/cropping: crop

Copy link
Member

@CarsonF CarsonF left a comment

Choose a reason for hiding this comment

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

Can ConfigGet/Set be abstracted? The majority of the lines in both of those files are the same.

$this->parsed = $this->parser->parse($yaml, true, true);
if (is_string($file)) {
$fs = $app['filesystem']->getFilesystem('config');
$file = $fs->getFile($file);
Copy link
Member

Choose a reason for hiding this comment

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

Why not:

$file = $app['filesystem']->getFile('config://' . $file);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Throw … exception

Copy link
Member

Choose a reason for hiding this comment

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

No it doesn't.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, nvm

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -156,7 +149,7 @@ protected function verify()
}

// This will throw a ParseException If the YAML is not valid
$this->parser->parse($this->yaml, true, true);
$this->parsed = $this->file->parse(['exceptionsOnInvalidType' => true, 'objectSupport' => true]);
Copy link
Member

Choose a reason for hiding this comment

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

This won't work as the file doesn't have the new contents yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@GwendolenLynch
Copy link
Contributor Author

Can ConfigGet/Set be abstracted? The majority of the lines in both of those files are the same.

Yeah, I did wonder … I might in the morning

@GwendolenLynch
Copy link
Contributor Author

Can ConfigGet/Set be abstracted? The majority of the lines in both of those files are the same.

Yeah, I did wonder … I might in the morning

Done

@bobdenotter
Copy link
Member

This should be GTG now, right?

@GwendolenLynch
Copy link
Contributor Author

This should be GTG now, right?

/me nudges @CarsonF

{
$pattern = str_replace('/', ':.*?', $key);
preg_match_all('/^' . $pattern . '(:\s*)/mis', $this->file->read(), $matches, PREG_OFFSET_CAPTURE);
preg_match_all('/^' . $pattern . '(:\s*)/mis', $this->lines->join("\n"), $matches, PREG_OFFSET_CAPTURE);

Choose a reason for hiding this comment

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

Expected 1 space after comma in function call; 2 found

$yaml = $this->lines->join("\n");

$pattern = '/^' . str_replace('/', ':.*?', $key) . '(:\s*)/mis';
preg_match($pattern, $yaml, $matches, PREG_OFFSET_CAPTURE);

Choose a reason for hiding this comment

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

Expected 1 space after comma in function call; 2 found

Copy link
Member

@CarsonF CarsonF left a comment

Choose a reason for hiding this comment

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

@GawainLynch If you are good with my changes feel free to merge

@GwendolenLynch GwendolenLynch merged commit 13d43d1 into bolt:release/3.3 Apr 15, 2017
@GwendolenLynch GwendolenLynch deleted the deprecation/yaml-updater branch April 15, 2017 07:37
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.

5 participants