Skip to content
Snippets Groups Projects
Commit af17fc0b authored by Jared Hancock's avatar Jared Hancock
Browse files

users: Support importing csv from stdin on the cli

parent e628cf4b
No related branches found
No related tags found
No related merge requests found
......@@ -56,9 +56,9 @@ class UserManager extends Module {
// Properly detect Macintosh style line endings
ini_set('auto_detect_line_endings', true);
if (!$options['file'])
$this->fail('CSV file to import users from is required!');
elseif (!($this->stream = fopen($options['file'], 'rb')))
if (!$options['file'] || $options['file'] == '-')
$options['file'] = 'php://stdin';
if (!($this->stream = fopen($options['file'], 'rb')))
$this->fail("Unable to open input file [{$options['file']}]");
$extras = array();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment