You need to sign in or sign up before continuing.
Commit 6047cb4d authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

MySQL settings now done in mariadb.client target

parent 6126be2b
all: httpd-conf php-fpm-service mysql-config
all: httpd-conf php-fpm-service
tar xf php-7.3.6.tar.xz
cd php-7.3.6 && ./configure --prefix=/usr --sysconfdir=/etc --with-config-file-scan-dir=/etc/php.d --localstatedir=/var --datadir=/usr/share/php --mandir=/usr/share/man --enable-fpm --with-fpm-user=apache --with-fpm-group=apache --with-fpm-systemd --with-config-file-path=/etc --with-zlib --enable-bcmath --with-bz2 --enable-calendar --enable-dba=shared --with-gdbm --with-gmp --enable-ftp --with-gettext --enable-mbstring --with-readline --enable-sockets --enable-intl --enable-soap --with-openssl --with-mysqli --with-pdo-mysql --with-mysql-sock=/run/mysql.sock --with-curl --with-gd --with-jpeg-dir --with-freetype-dir --with-ldap
$(MAKE) -C php-7.3.6 CPPFLAGS+=' -DU_USING_ICU_NAMESPACE=1'
......@@ -16,11 +16,9 @@ all: httpd-conf php-fpm-service mysql-config
@echo "$$HTTPD_CONF" > /etc/httpd/conf/php.conf
@echo "$$PHP_FPM_SERVICE" > /lib/systemd/system/php-fpm.service
systemctl enable php-fpm.service
@echo "$$MYSQL_CONFIG" > /etc/config/mysql
install -v -Dm755 web /usr/share/easycwmp/functions
rm -rf php-7.3.6
php: mysql-config
php:
tar xf php-7.3.6.tar.xz
cd php-7.3.6 && ./configure --prefix=/usr --sysconfdir=/etc --with-config-file-scan-dir=/etc/php.d --localstatedir=/var --datadir=/usr/share/php --mandir=/usr/share/man --enable-fpm --with-fpm-user=apache --with-fpm-group=apache --with-fpm-systemd --with-config-file-path=/etc --with-zlib --enable-bcmath --with-bz2 --enable-calendar --enable-dba=shared --with-gdbm --with-gmp --enable-ftp --with-gettext --enable-mbstring --with-readline --enable-sockets --enable-intl --enable-soap --with-openssl --with-mysqli --with-pdo-mysql --with-mysql-sock=/run/mysql.sock --with-curl --with-gd --with-jpeg-dir --with-freetype-dir --with-ldap
$(MAKE) -C php-7.3.6 CPPFLAGS+=' -DU_USING_ICU_NAMESPACE=1'
......@@ -61,14 +59,3 @@ ExecReload=/bin/kill -USR2 $$MAINPID
WantedBy=multi-user.target
endef
export PHP_FPM_SERVICE
mysql-config:
define MYSQL_CONFIG
config mysql 'credentials'
option hostname ''
option database ''
option username ''
option password ''
endef
export MYSQL_CONFIG
#!/bin/sh
#common_execute_method_param "$parameter" "$permission" "$get_cmd" "$set_cmd" "xsd:$type" "$forcedinform"
# $forcedinform should be set to 1 if the parameter is included in the inform message otherwise empty
# Default of $type = string
#############################
# Entry point functuons #
#############################
prefix_list="$prefix_list $DMROOT.Web."
entry_execute_method_list="$entry_execute_method_list entry_execute_method_root_Web"
entry_execute_method_list_forcedinform="$entry_execute_method_list_forcedinform entry_execute_method_root_Web"
entry_execute_method_root_Web() {
case "$1" in ""|"$DMROOT."|"$DMROOT.Web."*)
common_execute_method_obj "$DMROOT.Web." "0"
common_execute_method_obj "$DMROOT.Web.MySQL." "0"
common_execute_method_param "$DMROOT.Web.MySQL.HostName" "1" "mysql_get_hostname" "mysql_set_hostname"
common_execute_method_param "$DMROOT.Web.MySQL.DataBase" "1" "mysql_get_database" "mysql_set_database"
common_execute_method_param "$DMROOT.Web.MySQL.UserName" "1" "mysql_get_username" "mysql_set_username"
common_execute_method_param "$DMROOT.Web.MySQL.Password" "1" "" "mysql_set_password"
return 0;
;;
esac
return $E_INVALID_PARAMETER_NAME;
}
#######################################
# Data model parameters functions #
#######################################
mysql_get_hostname() {
echo `$UCI_GET mysql.credentials.hostname`
}
mysql_set_hostname() {
local hostname=`$UCI_GET mysql.credentials.hostname`
if [ "$hostname" != "$1" ]; then
$UCI_SET mysql.credentials.hostname="$1"
$UCI_COMMIT
chmod a+r /etc/config/mysql
fi
}
mysql_get_database() {
echo `$UCI_GET mysql.credentials.database`
}
mysql_set_database() {
local database=`$UCI_GET mysql.credentials.database`
if [ "$database" != "$1" ]; then
$UCI_SET mysql.credentials.database="$1"
$UCI_COMMIT
chmod a+r /etc/config/mysql
fi
}
mysql_get_username() {
echo `$UCI_GET mysql.credentials.username`
}
mysql_set_username() {
local username=`$UCI_GET mysql.credentials.username`
if [ "$username" != "$1" ]; then
$UCI_SET mysql.credentials.username="$1"
$UCI_COMMIT
chmod a+r /etc/config/mysql
fi
}
mysql_set_password() {
local password=`$UCI_GET mysql.credentials.password`
if [ "$password" != "$1" ]; then
$UCI_SET mysql.credentials.password="$1"
$UCI_COMMIT
chmod a+r /etc/config/mysql
fi
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment