-
Notifications
You must be signed in to change notification settings - Fork 0
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
Produce summary data to feed back into --table option and clean up #13
Conversation
dd52eee
to
5e86d5f
Compare
d1a256c
to
a161615
Compare
7724b98
to
bc2b345
Compare
classes/helper.php
Outdated
$record = $DB->get_record($table, ['id' => $id], $column); | ||
|
||
// Replace the text. | ||
$text = str_replace($match, $replace, $record->$column); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pros and cons of using $DB->replace_all_text ? I assume using it will be faster and reduce the DB io quite a lot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, we can't use this because we can't pass in a where clause to limit it to 1 id. But I think we should clone this function and add the filter, and make a not when we go back to upstream this into core to combine this back ine
bc2b345
to
b85e8d0
Compare
fclose($fp); | ||
|
||
if ($summary) { | ||
// Read the content of the output file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this all looks weird to me, whats the reason for this? we really don't want to touch the file a second time and we definitely don't want to load it all into memory at once
b85e8d0
to
eef87a9
Compare
@@ -330,8 +334,7 @@ public static function regular_expression_search(string $search, string $table, | |||
if (!empty($stream)) { | |||
if ($summary) { | |||
fputcsv($stream, [ | |||
$table, | |||
$column->name, | |||
"$table:$column->name", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you combine these?
Hi @brendanheywood , I have created new PR for clean up commit. |
No description provided.