zend-patterns / ZendServerPuppet

ZendServerPuppet
Apache License 2.0
6 stars 16 forks source link

Make sure we use the latest version of the API client #30

Open ubellavance opened 7 years ago

ubellavance commented 7 years ago

On some version of Zend Server, the API client (zs-client.phar) was not provided with Zend Server itself. Therefore, this module pushed a version of this file. However, this file is now provided but Zend Server and updated if needed. Also, current Zend Server versions provide zs-client.sh, which is a shell that know which .phar to use depending the situation It would be a good thing to:

ubellavance commented 7 years ago

Zend Server 7 has no .phar and no zs-client.sh. Zend Server 8.5 and 9.x do have both. I think that pushing both zs-clients for ZS7 and do nothing otherwise would be a good solution. Then we would simply always call the zs-client.sh because the zs-client.phar is in different locations.

ubellavance commented 7 years ago

zs-client.sh:


#!/bin/sh
. /etc/zce.rc
PHP=$ZCE_PREFIX/bin/php
PHAR_SHARE=$ZCE_PREFIX/share/sdk/zs-client.phar
PHAR_LIB_PATH=`$PHP -r "echo @zend_deployment_library_path('ZendServerSDK');"`
PHAR=$PHAR_LIB_PATH/zs-client.phar
if echo $@ | grep -qE "bootstrapSingleServer|serverAddToCluster|clusterRemoveServer"; then
        PHAR=$PHAR_SHARE
elif [ ! -f $PHAR ]; then
        PHAR=$PHAR_SHARE
fi
$PHP $PHAR "$@"```
ubellavance commented 7 years ago

40, commit 01d7760, make the command be zs-client.sh on Zend Server versions that have it. It looks like this module doesn't overwrite the zs-client.phar file so it is not the end of the world if we push that file anyway.