-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add option to read entity IDs from standard input #21
Conversation
*/ | ||
public function getEntityIds( $input ) { | ||
$entityIds = []; | ||
while ( $line = fgets( STDIN ) ) { |
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.
Perhaps it does not fit this interface, though this code make me think yield
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.
Hm, that would look nice, but I don’t think it’s currently possible here, all the surrounding code expects arrays.
The context for this feature request is change 349894 – this feature allows you to automatically import all the entities that the WikibaseQualityConstraints extension needs (see |
0c78d97
to
57c6b09
Compare
can you please add documentation for the new option in the README ? |
Specifying /dev/stdin as filename does not work on Linux if standard input is a pipe, since PHP does not open(2) the symlink directly, but instead follows it using readlink(2), and the Linux kernel returns a non-filename description for readlink(2) on /proc/[pid]/fd/ entries corresponding to pipes and sockets (see proc(5)): readlink("/dev/stdin") -> /proc/self/fd/0 readlink("/proc/self/fd/0") -> pipe:[INODE] /* ... resolve /proc/self ... */ open("/proc/PID/fd/pipe:[INODE]") -> ENOENT
I wasn’t sure what example to use for the pipe, but a simple |
@lucaswerkmeister yeah, think either works as an example |
Could this perhaps be merged? The option is already used in the WBQC README… |
Is there anything blocking this from getting merged? |
looks good |
Thank you ♥ |
Specifying
/dev/stdin
as filename does not work on Linux if standard input is a pipe, since PHP does not open(2) the symlink directly, but instead follows it using readlink(2), and the Linux kernel returns a non-filename description for readlink(2) on/proc/[pid]/fd/
entries corresponding to pipes and sockets (see proc(5)):