I was trying a simple test to see if I could drag a file onto a compiled php script and have it read that file as stdin. My test’s indicate that while dragging a file onto the compiled exe does make it execute, however it does not seem to pass action on to the script. Does exeoutput for php support stdin or argv input to compiled files? Could I make “command line” switches available to my compiled exe, something like “myexe.exe \o c:\output.txt \u user_1 \p pass1234” ? I suppose if that were possible (I couldn’t find an example in the forums or doc’s) then perhaps the “drag and drop” method I tested would also work? I am able to use the code below as a drag and drop with php (non compiled and php files are associated with php.exe). I’d love to have something I could quickly drag and drop on to without having it open already, I’m sure I could get some JS written to accept a drag and drop file. I like the duality of having a very nice gui program, as well as the utility of a command line executable. I’ve done some work with PHc-Win and those exe’s easily accept stdin/argv but have all of these other files outside of the exe that they depend on. Your program is by far the best I’ve encountered!
<?PHP array_shift($argv); if (count($argv) == 0) { $argv[0] = "php://stdin"; } foreach ($argv as $file) { $hash = hash_file( 'md5', $file ); if ($hash !== "") { echo "$hash\n"; } }; ?>
<?PHP array_shift($argv); if (count($argv) == 0) { $argv[0] = "php://stdin"; } foreach ($argv as $file) { $hash = hash_file( 'md5', $file ); if ($hash !== "") { echo "$hash\n"; } }; ?>
Last edited: