4 declare composerNoPlugins
5 declare composerNoScripts
7 preConfigureHooks
+=(composerInstallConfigureHook
)
8 preBuildHooks
+=(composerInstallBuildHook
)
9 preCheckHooks
+=(composerInstallCheckHook
)
10 preInstallHooks
+=(composerInstallInstallHook
)
12 source @phpScriptUtils@
14 composerInstallConfigureHook
() {
15 echo "Executing composerInstallConfigureHook"
17 setComposerRootVersion
19 if [[ ! -e "${composerVendor}" ]]; then
20 echo "No local composer vendor found."
24 install -Dm644 ${composerVendor}/composer.json .
26 if [[ -f "${composerVendor}/composer.lock" ]]; then
27 install -Dm644 ${composerVendor}/composer.lock .
30 if [[ -f "composer.lock" ]]; then
31 chmod +w composer.lock
34 chmod +w composer.json
36 echo "Finished composerInstallConfigureHook"
39 composerInstallBuildHook
() {
40 echo "Executing composerInstallBuildHook"
42 echo "Finished composerInstallBuildHook"
45 composerInstallCheckHook
() {
46 echo "Executing composerInstallCheckHook"
50 echo "Finished composerInstallCheckHook"
53 composerInstallInstallHook
() {
54 echo "Executing composerInstallInstallHook"
56 cp -ar ${composerVendor}/* .
58 # Copy the relevant files only in the store.
59 mkdir
-p "$out"/share
/php
/"${pname}"
60 cp -r .
"$out"/share
/php
/"${pname}"/
62 # Create symlinks for the binaries.
63 jq
-r -c 'try (.bin[] | select(test(".bat$")? | not) )' composer.json |
while read -r bin
; do
64 echo -e "\e[32mCreating symlink ${bin}...\e[0m"
66 ln -s "$out"/share
/php
/"${pname}"/"$bin" "$out"/bin
/"$(basename "$bin")"
69 echo "Finished composerInstallInstallHook"