-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from 10up/feature/19448744-debug-enhancement
19448744 | feat: php-syntax - debug flag for detailed logging
- Loading branch information
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
#!/bin/bash | ||
|
||
# The -P10 option specifies the number of parallel processes (In constrainted CPUs will take approx time for 1 available cpu) | ||
find . -type f -name '*.php' -not -path '*/vendor/*' -print0 | xargs -0 -n1 -P10 php -l 1>/dev/null | ||
# Checking if the IS_DEBUG_ENABLED flag is put in the CI environment | ||
IS_DEBUG_ENABLED=$( [ -n "$IS_DEBUG_ENABLED" ] && echo "$IS_DEBUG_ENABLED" || echo "" ) | ||
|
||
if [[ -n "$IS_DEBUG_ENABLED" ]]; then | ||
# The -P10 option specifies the number of parallel processes (In constrainted CPUs will take approx time for 1 available cpu) | ||
# This will output stdout logs | ||
find . -type f -name '*.php' -not -path '*/vendor/*' -print0 | xargs -0 -n1 -P10 php -l | ||
else | ||
# The -P10 option specifies the number of parallel processes (In constrainted CPUs will take approx time for 1 available cpu) | ||
# This will NOT output stdout logs | ||
find . -type f -name '*.php' -not -path '*/vendor/*' -print0 | xargs -0 -n1 -P10 php -l 1>/dev/null | ||
fi |