MarcusBarnes / mik

The Move to Islandora Kit is an extensible PHP command-line tool for converting source content and metadata into packages suitable for importing into Islandora (or other digital repository and preservations systems).
GNU General Public License v3.0
34 stars 11 forks source link

Work on #324. #375

Closed mjordan closed 7 years ago

mjordan commented 7 years ago

Github issue: (#324)

What does this Pull Request do?

Adds a utility class "Dumper" that lets you dump the value of a variable to a file.

A new class, src/utilities/Dumper, that provides a single method, ->dump().

How should this be tested?

$dumper = new \mik\utilities\Dumper();
$dumper->dump($record, 'Record', '/tmp/foo.txt');

Additional Notes

@MarcusBarnes any thoughts on how I've set up the new 'utilities' namespace, etc.?

We can document how this utility works on the Information for Developer page.

Interested parties

@MarcusBarnes

MarcusBarnes commented 7 years ago

Appears to work as described. Thank you @mjordan. When documenting, we should include a link to the PHP sys_get_temp_dir function documentation, as the default temporary folder may vary considerably based on one's PHP environment.

mjordan commented 7 years ago

Cookbook entry is at https://github.com/MarcusBarnes/mik/wiki/Cookbook:-Inspecting-a-variable's-value.