Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2016-07-30 17:03:35 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2016-07-30 17:03:35 +0300
commit6375953b26c325c319248bcc9739a4f9ef8e0c4f (patch)
treecd6a2c20296b89031c312c390892d193446900f5 /include/tests_php
parent32fd85155d696fd80011397f42725a58914712da (diff)
[PHP-2211] - Readability improvement and code style changes
Diffstat (limited to 'include/tests_php')
-rw-r--r--include/tests_php39
1 files changed, 20 insertions, 19 deletions
diff --git a/include/tests_php b/include/tests_php
index 7164b49a..fae6041a 100644
--- a/include/tests_php
+++ b/include/tests_php
@@ -50,42 +50,43 @@
LogText "Test: Checking for presence php.ini"
PHPINIFILE=""
PHPINI_ALLFILES=""
- for I in ${PHPINILOCS}; do
- LogText "Test: checking presence ${I}"
- if [ -f ${I} ]; then
- PHPINIFILE=${I}
+ for FILE in ${PHPINILOCS}; do
+ LogText "Test: checking presence ${FILE}"
+ if [ -f ${FILE} ]; then
+ PHPINIFILE="${FILE}"
LogText "Result: Found php.ini file (${PHPINIFILE})"
LogText "Note: Adding file to php.ini array"
PHPINI_ALLFILES="${PHPINI_ALLFILES} ${PHPINIFILE}"
- else
- LogText "Result: file ${I} not found"
+ else
+ LogText "Result: file ${FILE} not found"
fi
done
# Check all known locations
- for I in ${PHPINIDIRS}; do
- tFILES=`ls ${I}/*.ini 2>/dev/null`
- if [ "${tFILES}" = "" ]; then
- LogText "Result: no files found for ${I}"
- else
- LogText "Result: found files in location ${I}, checking"
- for I in ${tFILES}; do
- if [ -f ${I} ]; then
- LogText "Result: file ${I} exists, adding to php.ini array"
- PHPINI_ALLFILES="${PHPINI_ALLFILES} ${I}"
- fi
+ for DIR in ${PHPINIDIRS}; do
+ FIND=$(ls ${DIR}/*.ini 2> /dev/null)
+ if [ -z "${FIND}" ]; then
+ LogText "Result: no files found for ${DIR}"
+ else
+ LogText "Result: found files in location ${DIR}, checking"
+ for FILE in ${FIND}; do
+ if [ -f ${FILE} ]; then
+ LogText "Result: file ${FILE} exists, adding to php.ini array"
+ PHPINI_ALLFILES="${PHPINI_ALLFILES} ${FILE}"
+ fi
done
fi
done
- if [ ! "${PHPINIFILE}" = "" ]; then
+ if [ ! -z "${PHPINIFILE}" ]; then
Display --indent 2 --text "- Checking PHP" --result "${STATUS_FOUND}" --color GREEN
LogText "Result: using single file ${PHPINIFILE} for main php.ini tests"
LogText "Result: using php.ini array ${PHPINI_ALLFILES} for further tests"
- else
+ else
Display --indent 2 --text "- Checking PHP" --result "${STATUS_NOT_FOUND}" --color WHITE
LogText "Result: no php.ini file found"
fi
+ unset DIR; unset FILE; unset FIND
fi
#
#################################################################################