Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
php
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
webarch
php
Commits
322c85ee
Commit
322c85ee
authored
2 years ago
by
Chris Croome
Browse files
Options
Downloads
Patches
Plain Diff
phpquery script updated
parent
a06c527b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Merge Sury
Pipeline
#20893
passed
2 years ago
Stage: lint
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/phpquery.fact.j2
+21
-45
21 additions, 45 deletions
templates/phpquery.fact.j2
with
21 additions
and
45 deletions
templates/phpquery.fact.j2
+
21
−
45
View file @
322c85ee
...
...
@@ -6,61 +6,37 @@ PHPQUERY="{{ php_phpquery }}"
if
[[
-f
"
${
PHPQUERY
}
"
]]
then
declare
-a
versions
# echo "phpquery found at: ${PHPQUERY}" >&2
# echo "PHP versions command to be run: ${PHPQUERY} -V | sort -V" >&2
declare
-a
versions
=()
readarray
-t
versions < <
(
"
${
PHPQUERY
}
"
-V
|
sort
-V
)
# echo "PHP versions found: ${versions[@]}" >&2
jo
state
=
present
versions
=
$(
jo
$(
# echo Loop through the PHP versions >&2
for
v
in
"
${
versions
[@]
}
"
do
declare
-a
sapis
# echo "Query SAPIs for PHP version ${v}" >&2
# echo "PHP ${v} SAPIs command to be run: ${PHPQUERY} -v ${v} -S | sort" >&2
declare
-a
mods_available
=()
readarray
-t
mods_available < <
(
"
${
PHPQUERY
}
"
-v
"
${
v
}
"
-M
|
sort
)
declare
-a
sapis
=()
readarray
-t
sapis < <
(
"
${
PHPQUERY
}
"
-v
"
${
v
}
"
-S
|
sort
)
# echo "SAPIs found for PHP version ${v}: ${sapis[@]}" >&2
echo
${
v
}
=
$(
jo
state
=
present
$(
# echo "Loop through the SAPIs" >&2
for
s
in
"
${
sapis
[@]
}
"
do
declare
-a
mods_enabled
declare
-a
mods_disabled
# echo "Looping through the SAPIs for PHP ${v} starting with ${s}" >&2
# echo "PHP ${v} SAPI ${s} Modules command to be run: ${PHPQUERY} -v ${v} -s ${s} -M | sort" >&2
readarray
-t
mods < <
(
"
${
PHPQUERY
}
"
-v
"
${
v
}
"
-s
"
${
s
}
"
-M
|
sort
)
# echo "Mods found for PHP ${v} SAPI ${s}: ${mods[@]}" >&2
# echo "Loop through the Mods found" >&2
for
m
in
"
${
mods
[@]
}
"
jo
state
=
present
mods_available
=
$(
jo
-a
"
${
mods_available
[@]
}
"
)
$(
for
s
in
"
${
sapis
[@]
}
"
do
# echo "Checking the status for PHP ${v} SAPI ${s} Mod ${m}" >&2
if
"
${
PHPQUERY
}
"
-v
"
${
v
}
"
-s
"
${
s
}
"
-m
"
${
m
}
"
-q
;
then
# echo "Mod enabled for PHP version ${v} SAPI ${s}: ${m}" >&2
mods_enabled
=(
${
mods_enabled
[@]
}
${
m
}
)
# echo "Mods enabled for PHP version ${v} SAPI ${s}: ${mods_enabled[*]}" >&2
else
mods_disabled
=(
${
mods_disabled
[@]
}
${
m
}
)
# echo "Mod disabled for PHP version ${v} SAPI ${s}: ${m}" >&2
fi
# echo "Done checking the status for PHP ${v} SAPI ${s} Mod ${m}" >&2
done
# echo "mods_available: ${mods[@]}" >&2
# echo "mods_enabled: ${mods_enabled[@]}" >&2
# echo "mods_disabled: ${mods_disabled[@]}" >&2
echo
sapis[
"
${
s
}
"
]=
$(
jo
state
=
present
mods_available
=
$(
jo
-e
-a
"
${
mods
[@]
}
"
)
mods_enabled
=
$(
jo
-e
-a
"
${
mods_enabled
[@]
}
"
)
mods_disabled
=
$(
jo
-e
-a
"
${
mods_disabled
[@]
}
"
declare
-a
mods_enabled
=()
for
m
in
"
${
mods_available
[@]
}
"
do
if
"
${
PHPQUERY
}
"
-v
"
${
v
}
"
-s
"
${
s
}
"
-m
"
${
m
}
"
-q
then
mods_enabled
=(
${
mods_enabled
[@]
}
${
m
}
)
fi
done
echo
sapis[
"
${
s
}
"
]=
$(
jo
state
=
present
mods_enabled
=
$(
jo
-e
-a
"
${
mods_enabled
[@]
}
"
)
)
)
done
done
)
)
)
done
)
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment