Skip to content

Instantly share code, notes, and snippets.

@adduc
Last active December 28, 2015 10:49
Show Gist options
  • Save adduc/7489154 to your computer and use it in GitHub Desktop.
Save adduc/7489154 to your computer and use it in GitHub Desktop.
Phing target for detecting PHP short open tags.
<target name="checkshorttags">
<!-- Run in parallel to speed up process. -->
<exec
escape="false"
command='GREPOUT=`find . -not -ipath "*vendor*" -type "f" -name "*.php" -print0 | xargs -0 -n1 -P$(nproc) pcregrep -nrHMe "&lt;\?\s"`;
echo "$GREPOUT";
if [ -z "$GREPOUT" ];
then exit 0;
else exit 1;
fi;
'
checkreturn="true"
passthru="true"
/>
</target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment