Browse Source

Add pecl_calendar

lj2007331@gmail.com 6 years ago
parent
commit
099db0cd27
4 changed files with 58 additions and 3 deletions
  1. 1 1
      README.md
  2. 41 0
      include/pecl_calendar.sh
  3. 8 1
      install.sh
  4. 8 1
      uninstall.sh

+ 1 - 1
README.md

@@ -12,7 +12,7 @@ Script properties:
 - Providing a plurality of Tomcat version (Tomcat-9, Tomcat-8, Tomcat-7, Tomcat-6)
 - Providing a plurality of JDK version (JDK-11.0, JDK-1.8, JDK-1.7, JDK-1.6)
 - Providing a plurality of Apache version (Apache-2.4, Apache-2.2)
-- According to their needs to install PHP Cache Accelerator provides ZendOPcache, xcache, apcu, eAccelerator. And php extensions,include ZendGuardLoader,ionCube,SourceGuardian,imagick,gmagick,fileinfo,imap,ldap,phalcon,yaf,yar,redis,memcached,memcache,mongodb,swoole,xdebug
+- According to their needs to install PHP Cache Accelerator provides ZendOPcache, xcache, apcu, eAccelerator. And php extensions,include ZendGuardLoader,ionCube,SourceGuardian,imagick,gmagick,fileinfo,imap,ldap,calendar,phalcon,yaf,yar,redis,memcached,memcache,mongodb,swoole,xdebug
 - Installation Pureftpd, phpMyAdmin according to their needs
 - Install memcached, redis according to their needs
 - Jemalloc optimize MySQL, Nginx

+ 41 - 0
include/pecl_calendar.sh

@@ -0,0 +1,41 @@
+#!/bin/bash
+# Author:  yeho <lj2007331 AT gmail.com>
+# BLOG:  https://linuxeye.com
+#
+# Notes: OneinStack for CentOS/RedHat 6+ Debian 7+ and Ubuntu 12+
+#
+# Project home page:
+#       https://oneinstack.com
+#       https://github.com/oneinstack/oneinstack
+
+Install_pecl_calendar() {
+  if [ -e "${php_install_dir}/bin/phpize" ]; then
+    pushd ${oneinstack_dir}/src > /dev/null
+    phpExtensionDir=$(${php_install_dir}/bin/php-config --extension-dir)
+    PHP_detail_ver=$(${php_install_dir}/bin/php-config --version)
+    src_url=https://secure.php.net/distributions/php-${PHP_detail_ver}.tar.gz && Download_src
+    tar xzf php-${PHP_detail_ver}.tar.gz
+    pushd php-${PHP_detail_ver}/ext/calendar > /dev/null
+    ${php_install_dir}/bin/phpize
+    ./configure --with-php-config=${php_install_dir}/bin/php-config
+    make -j ${THREAD} && make install
+    popd > /dev/null
+    if [ -f "${phpExtensionDir}/calendar.so" ]; then
+      echo 'extension=calendar.so' > ${php_install_dir}/etc/php.d/04-calendar.ini
+      echo "${CSUCCESS}PHP calendar module installed successfully! ${CEND}"
+      rm -rf php-${PHP_detail_ver}
+    else
+      echo "${CFAILURE}PHP calendar module install failed, Please contact the author! ${CEND}"
+    fi
+    popd > /dev/null
+  fi
+}
+
+Uninstall_pecl_calendar() {
+  if [ -e "${php_install_dir}/etc/php.d/04-calendar.ini" ]; then
+    rm -f ${php_install_dir}/etc/php.d/04-calendar.ini
+    echo; echo "${CMSG}PHP calendar module uninstall completed${CEND}"
+  else
+    echo; echo "${CWARNING}PHP calendar module does not exist! ${CEND}"
+  fi
+}

+ 8 - 1
install.sh

@@ -54,7 +54,7 @@ Show_Help() {
   --mphp_addons               Only install another PHP addons
   --phpcache_option [1-4]     Install PHP opcode cache, default: 1 opcache
   --php_extensions [ext name] Install PHP extensions, include zendguardloader,ioncube,
-                              sourceguardian,imagick,gmagick,fileinfo,imap,ldap,phalcon,
+                              sourceguardian,imagick,gmagick,fileinfo,imap,ldap,calendar,phalcon,
                               yaf,yar,redis,memcached,memcache,mongodb,swoole,xdebug
   --tomcat_option [1-4]       Install Tomcat version
   --jdk_option [1-4]          Install JDK version
@@ -130,6 +130,7 @@ while :; do
       [ -n "`echo ${php_extensions} | grep -w fileinfo`" ] && pecl_fileinfo=1
       [ -n "`echo ${php_extensions} | grep -w imap`" ] && pecl_imap=1
       [ -n "`echo ${php_extensions} | grep -w ldap`" ] && pecl_ldap=1
+      [ -n "`echo ${php_extensions} | grep -w calendar`" ] && pecl_calendar=1
       [ -n "`echo ${php_extensions} | grep -w phalcon`" ] && pecl_phalcon=1
       [ -n "`echo ${php_extensions} | grep -w yaf`" ] && pecl_yaf=1
       [ -n "`echo ${php_extensions} | grep -w yar`" ] && pecl_yar=1
@@ -996,6 +997,12 @@ PHP_addons() {
     Install_pecl_ldap 2>&1 | tee -a ${oneinstack_dir}/install.log
   fi
 
+  # calendar
+  if [ "${pecl_calendar}" == '1' ]; then
+    . include/pecl_calendar.sh
+    Install_pecl_calendar 2>&1 | tee -a ${oneinstack_dir}/install.log
+  fi
+
   # phalcon
   if [ "${pecl_phalcon}" == '1' ]; then
     . include/pecl_phalcon.sh

+ 8 - 1
uninstall.sh

@@ -42,7 +42,7 @@ Show_Help() {
   --allphp                      Uninstall all PHP
   --phpcache                    Uninstall PHP opcode cache
   --php_extensions [ext name]   Uninstall PHP extensions, include zendguardloader,ioncube,
-                                sourceguardian,imagick,gmagick,fileinfo,imap,ldap,phalcon,
+                                sourceguardian,imagick,gmagick,fileinfo,imap,ldap,calendar,phalcon,
                                 yaf,yar,redis,memcached,memcache,mongodb,swoole,xdebug
   --hhvm                        Uninstall HHVM
   --pureftpd                    Uninstall PureFtpd
@@ -118,6 +118,7 @@ while :; do
       [ -n "`echo ${php_extensions} | grep -w fileinfo`" ] && pecl_fileinfo=1
       [ -n "`echo ${php_extensions} | grep -w imap`" ] && pecl_imap=1
       [ -n "`echo ${php_extensions} | grep -w ldap`" ] && pecl_ldap=1
+      [ -n "`echo ${php_extensions} | grep -w calendar`" ] && pecl_calendar=1
       [ -n "`echo ${php_extensions} | grep -w phalcon`" ] && pecl_phalcon=1
       [ -n "`echo ${php_extensions} | grep -w yaf`" ] && pecl_yaf=1
       [ -n "`echo ${php_extensions} | grep -w yar`" ] && pecl_yar=1
@@ -392,6 +393,12 @@ Uninstall_PHPext() {
     Uninstall_pecl_ldap
   fi
 
+  # calendar
+  if [ "${pecl_calendar}" == '1' ]; then
+    . include/pecl_calendar.sh
+    Uninstall_pecl_calendar
+  fi
+
   # phalcon
   if [ "${pecl_phalcon}" == '1' ]; then
     . include/pecl_phalcon.sh