Limit execution time of shell_exec and grab whatever output is generated
问题 I'm trying to limit the max execution time of shell_exec in PHP to say 20 seconds and fetch whatever output is generated during this time. If shell_exec finishes in less than 20 seconds the script should proceed directly. More specifically I'm developing a function that iterates through a large number of revisions of a subversion repository. For each revision it's fetching the svn diff and counts the number of lines added. The problem is that if very large files have been committed in a