mirror of
https://github.com/YunoHost-Apps/owntracks_ynh.git
synced 2024-09-03 19:56:24 +02:00
Fix
This commit is contained in:
parent
ca242875cf
commit
ba18442062
3 changed files with 29 additions and 4 deletions
27
conf/config.inc.php
Normal file
27
conf/config.inc.php
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$_config['sql_host'] = 'localhost';
|
||||||
|
$_config['sql_user'] = '__DB_NAME__';
|
||||||
|
$_config['sql_pass'] = '__DB_PWD__';
|
||||||
|
$_config['sql_db'] = '__DB_NAME__';
|
||||||
|
|
||||||
|
$_config['sql_prefix'] = '';
|
||||||
|
|
||||||
|
$_config['default_accuracy'] = 1000;
|
||||||
|
|
||||||
|
// The following function free us from requiring mysqlnd
|
||||||
|
function get_result($Statement)
|
||||||
|
{
|
||||||
|
$RESULT = array();
|
||||||
|
$Statement->store_result();
|
||||||
|
for ($i = 0; $i < $Statement->num_rows; $i++) {
|
||||||
|
$Metadata = $Statement->result_metadata();
|
||||||
|
$PARAMS = array();
|
||||||
|
while ($Field = $Metadata->fetch_field()) {
|
||||||
|
$PARAMS[] = &$RESULT[ $i ][ $Field->name ];
|
||||||
|
}
|
||||||
|
call_user_func_array(array( $Statement, 'bind_result' ), $PARAMS);
|
||||||
|
$Statement->fetch();
|
||||||
|
}
|
||||||
|
return $RESULT;
|
||||||
|
}
|
|
@ -114,8 +114,7 @@ ynh_mysql_connect_as $app $db_pwd $db_name < "$final_path/sql/schema.sql"
|
||||||
# MODIFY A CONFIG FILE
|
# MODIFY A CONFIG FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_replace_string "__USER__" "$app" "$final_path/config.inc.php"
|
ynh_add_config --template="../conf/config.inc.php" --destination="$final_path/config.inc.php"
|
||||||
ynh_replace_string "__DB_PWD__" "$db_pwd" "$final_path/config.inc.php"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP PERMISSIONS
|
# SETUP PERMISSIONS
|
||||||
|
|
|
@ -115,8 +115,7 @@ ynh_add_fpm_config
|
||||||
# MODIFY A CONFIG FILE
|
# MODIFY A CONFIG FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="$final_path/config.inc.php"
|
ynh_add_config --template="../conf/config.inc.php" --destination="$final_path/config.inc.php"
|
||||||
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/config.inc.php"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
|
|
Loading…
Reference in a new issue