ioncube.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. # Author: yeho <lj2007331 AT gmail.com>
  3. # BLOG: https://linuxeye.com
  4. #
  5. # Notes: OneinStack for CentOS/RedHat 7+ Debian 9+ and Ubuntu 16+
  6. #
  7. # Project home page:
  8. # https://oneinstack.com
  9. # https://github.com/oneinstack/oneinstack
  10. Install_ionCube() {
  11. if [ -e "${php_install_dir}/bin/phpize" ]; then
  12. pushd ${oneinstack_dir}/src > /dev/null
  13. PHP_detail_ver=`${php_install_dir}/bin/php-config --version`
  14. PHP_main_ver=${PHP_detail_ver%.*}
  15. phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
  16. [ ! -d "${phpExtensionDir}" ] && mkdir -p ${phpExtensionDir}
  17. [ -e "ioncube_loaders_lin_${SYS_ARCH_i}.tar.gz" ] && tar xzf ioncube_loaders_lin_${SYS_ARCH_i}.tar.gz
  18. if [ -z "`echo ${phpExtensionDir} | grep 'non-zts'`" ]; then
  19. /bin/mv ioncube/ioncube_loader_lin_${PHP_main_ver}_ts.so ${phpExtensionDir}
  20. zend_extension="${phpExtensionDir}/ioncube_loader_lin_${PHP_main_ver}_ts.so"
  21. else
  22. /bin/mv ioncube/ioncube_loader_lin_${PHP_main_ver}.so ${phpExtensionDir}
  23. zend_extension="${phpExtensionDir}/ioncube_loader_lin_${PHP_main_ver}.so"
  24. fi
  25. if [ -f "${zend_extension}" ]; then
  26. echo "zend_extension=${zend_extension}" > ${php_install_dir}/etc/php.d/00-ioncube.ini
  27. echo "${CSUCCESS}PHP ionCube module installed successfully! ${CEND}"
  28. rm -rf ioncube
  29. fi
  30. popd > /dev/null
  31. fi
  32. }
  33. Uninstall_ionCube() {
  34. if [ -e "${php_install_dir}/etc/php.d/00-ioncube.ini" ]; then
  35. rm -f ${php_install_dir}/etc/php.d/00-ioncube.ini
  36. echo; echo "${CMSG}PHP ionCube module uninstall completed${CEND}"
  37. else
  38. echo; echo "${CWARNING}PHP ionCube module does not exist! ${CEND}"
  39. fi
  40. }