init
This commit is contained in:
@@ -0,0 +1,219 @@
|
||||
#!/bin/bash
|
||||
# core/installer.sh - install orchestration (logic unchanged)
|
||||
# Migrated verbatim from install.sh.
|
||||
|
||||
PHP_addons() {
|
||||
# PHP opcode cache
|
||||
case "${phpcache_option}" in
|
||||
1)
|
||||
run_install "modules/php-addons/zendopcache.sh" "Install_ZendOPcache"
|
||||
;;
|
||||
2)
|
||||
run_install "modules/php-addons/apcu.sh" "Install_APCU"
|
||||
;;
|
||||
3)
|
||||
run_install "modules/php-addons/xcache.sh" "Install_XCache"
|
||||
;;
|
||||
4)
|
||||
run_install "modules/php-addons/eaccelerator.sh" "Install_eAccelerator"
|
||||
;;
|
||||
esac
|
||||
|
||||
# ZendGuardLoader
|
||||
if [ "${pecl_zendguardloader}" == '1' ]; then
|
||||
run_install "modules/php-addons/ZendGuardLoader.sh" "Install_ZendGuardLoader"
|
||||
fi
|
||||
|
||||
# ioncube
|
||||
if [ "${pecl_ioncube}" == '1' ]; then
|
||||
run_install "modules/php-addons/ioncube.sh" "Install_ionCube"
|
||||
fi
|
||||
|
||||
# SourceGuardian
|
||||
if [ "${pecl_sourceguardian}" == '1' ]; then
|
||||
run_install "modules/php-addons/sourceguardian.sh" "Install_SourceGuardian"
|
||||
fi
|
||||
|
||||
# imagick
|
||||
if [ "${pecl_imagick}" == '1' ]; then
|
||||
run_install "modules/image/ImageMagick.sh" "Install_ImageMagick"
|
||||
Install_pecl_imagick 2>&1 | tee -a ${oneinstack_dir}/runtime/install.log
|
||||
fi
|
||||
|
||||
# gmagick
|
||||
if [ "${pecl_gmagick}" == '1' ]; then
|
||||
run_install "modules/image/GraphicsMagick.sh" "Install_GraphicsMagick"
|
||||
Install_pecl_gmagick 2>&1 | tee -a ${oneinstack_dir}/runtime/install.log
|
||||
fi
|
||||
|
||||
# fileinfo
|
||||
if [ "${pecl_fileinfo}" == '1' ]; then
|
||||
run_install "modules/php-addons/pecl_fileinfo.sh" "Install_pecl_fileinfo"
|
||||
fi
|
||||
|
||||
# imap
|
||||
if [ "${pecl_imap}" == '1' ]; then
|
||||
run_install "modules/php-addons/pecl_imap.sh" "Install_pecl_imap"
|
||||
fi
|
||||
|
||||
# ldap
|
||||
if [ "${pecl_ldap}" == '1' ]; then
|
||||
run_install "modules/php-addons/pecl_ldap.sh" "Install_pecl_ldap"
|
||||
fi
|
||||
|
||||
# calendar
|
||||
if [ "${pecl_calendar}" == '1' ]; then
|
||||
run_install "modules/php-addons/pecl_calendar.sh" "Install_pecl_calendar"
|
||||
fi
|
||||
|
||||
# phalcon
|
||||
if [ "${pecl_phalcon}" == '1' ]; then
|
||||
run_install "modules/php-addons/pecl_phalcon.sh" "Install_pecl_phalcon"
|
||||
fi
|
||||
|
||||
# yaf
|
||||
if [ "${pecl_yaf}" == '1' ]; then
|
||||
run_install "modules/php-addons/pecl_yaf.sh" "Install_pecl_yaf"
|
||||
fi
|
||||
|
||||
# yar
|
||||
if [ "${pecl_yar}" == '1' ]; then
|
||||
run_install "modules/php-addons/pecl_yar.sh" "Install_pecl_yar"
|
||||
fi
|
||||
|
||||
# pecl_redis
|
||||
if [ "${pecl_redis}" == '1' ]; then
|
||||
run_install "modules/cache/redis.sh" "Install_pecl_redis"
|
||||
fi
|
||||
|
||||
# pecl_mongodb
|
||||
if [ "${pecl_mongodb}" == '1' ]; then
|
||||
run_install "modules/php-addons/pecl_mongodb.sh" "Install_pecl_mongodb"
|
||||
fi
|
||||
|
||||
# swoole
|
||||
if [ "${pecl_swoole}" == '1' ]; then
|
||||
run_install "modules/php-addons/pecl_swoole.sh" "Install_pecl_swoole"
|
||||
fi
|
||||
|
||||
# xdebug
|
||||
if [ "${pecl_xdebug}" == '1' ]; then
|
||||
run_install "modules/php-addons/pecl_xdebug.sh" "Install_pecl_xdebug"
|
||||
fi
|
||||
|
||||
# pecl_pgsql
|
||||
if [ -e "${pgsql_install_dir}/bin/psql" ]; then
|
||||
run_install "modules/php-addons/pecl_pgsql.sh" "Install_pecl_pgsql"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
install_modules() {
|
||||
# Database
|
||||
case "${db_option}" in
|
||||
1)
|
||||
run_install "modules/db/mysql-8.0.sh" "Install_MySQL80"
|
||||
;;
|
||||
2)
|
||||
run_install "modules/db/mysql-5.7.sh" "Install_MySQL57"
|
||||
;;
|
||||
3)
|
||||
run_install "modules/db/mariadb-10.11.sh" "Install_MariaDB1011"
|
||||
;;
|
||||
4)
|
||||
run_install "modules/db/mariadb-11.8.sh" "Install_MariaDB118"
|
||||
;;
|
||||
5)
|
||||
run_install "modules/db/mariadb-12.3.sh" "Install_MariaDB123"
|
||||
;;
|
||||
6)
|
||||
pgsql_ver=${pgsql1514_ver}
|
||||
run_install "modules/db/postgresql.sh" "Install_PostgreSQL"
|
||||
;;
|
||||
7)
|
||||
pgsql_ver=${pgsql1610_ver}
|
||||
run_install "modules/db/postgresql.sh" "Install_PostgreSQL"
|
||||
;;
|
||||
8)
|
||||
pgsql_ver=${pgsql176_ver}
|
||||
run_install "modules/db/postgresql.sh" "Install_PostgreSQL"
|
||||
;;
|
||||
9)
|
||||
run_install "modules/db/mongodb.sh" "Install_MongoDB"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Nginx server
|
||||
case "${nginx_option}" in
|
||||
1)
|
||||
run_install "modules/web/nginx.sh" "Install_Nginx"
|
||||
;;
|
||||
esac
|
||||
|
||||
# PHP
|
||||
case "${php_option}" in
|
||||
1)
|
||||
# On Ubuntu 24+ PHP 7.4 does not compile against the system libicu; the
|
||||
# guard here is a last-resort safety net in case validation was bypassed.
|
||||
if [[ "${Family}" == "ubuntu" ]] && [ "${Ubuntu_ver:-0}" -ge 24 ]; then
|
||||
echo "${CWARNING}Skipping PHP 7.4: not supported on Ubuntu ${Ubuntu_ver}+. Use PHP 8.x.${CEND}"
|
||||
else
|
||||
run_install "modules/php/php-7.4.sh" "Install_PHP74"
|
||||
fi
|
||||
;;
|
||||
2)
|
||||
run_install "modules/php/php-8.0.sh" "Install_PHP80"
|
||||
;;
|
||||
3)
|
||||
run_install "modules/php/php-8.1.sh" "Install_PHP81"
|
||||
;;
|
||||
esac
|
||||
[ "${mphp_addons_flag}" != 'y' ] && PHP_addons
|
||||
|
||||
if [ "${mphp_flag}" == 'y' ]; then
|
||||
if [[ "${Family}" == "ubuntu" ]] && [ "${Ubuntu_ver:-0}" -ge 24 ] && [ "${mphp_ver}" == '74' ]; then
|
||||
echo "${CWARNING}Skipping mphp 7.4: not supported on Ubuntu ${Ubuntu_ver}+. Use 80 or 81.${CEND}"
|
||||
else
|
||||
run_install "modules/php/mphp.sh" "Install_MPHP"
|
||||
php_install_dir=${php_install_dir}${mphp_ver}
|
||||
PHP_addons
|
||||
fi
|
||||
fi
|
||||
|
||||
# Nodejs
|
||||
if [ "${nodejs_flag}" == 'y' ]; then
|
||||
run_install "modules/lang/nodejs.sh" "Install_Nodejs"
|
||||
fi
|
||||
|
||||
# Pure-FTPd
|
||||
if [ "${pureftpd_flag}" == 'y' ]; then
|
||||
run_install "modules/ftp/pureftpd.sh" "Install_PureFTPd"
|
||||
fi
|
||||
|
||||
# phpMyAdmin
|
||||
if [ "${phpmyadmin_flag}" == 'y' ]; then
|
||||
run_install "modules/app/phpmyadmin.sh" "Install_phpMyAdmin"
|
||||
fi
|
||||
|
||||
# redis
|
||||
if [ "${redis_flag}" == 'y' ]; then
|
||||
run_install "modules/cache/redis.sh" "Install_redis_server"
|
||||
fi
|
||||
# Python
|
||||
if [ "${python_flag}" == 'y' ]; then
|
||||
run_install "modules/lang/python.sh" "Install_Python"
|
||||
fi
|
||||
}
|
||||
|
||||
# configure_modules: deploy default demo site and re-read install dirs.
|
||||
# Migrated verbatim from install.sh (lines 1102-1109).
|
||||
configure_modules() {
|
||||
# index example
|
||||
if [ -d "${wwwroot_dir}/default" ]; then
|
||||
. core/demo.sh
|
||||
DEMO 2>&1 | tee -a ${oneinstack_dir}/runtime/install.log
|
||||
fi
|
||||
|
||||
# get web_install_dir and db_install_dir
|
||||
. lib/check_dir.sh
|
||||
}
|
||||
Reference in New Issue
Block a user