fixing sql file dir for pkgs
This commit is contained in:
parent
25be75a9b9
commit
4f56ff905a
|
|
@ -522,7 +522,12 @@ if ($_POST["install_step"] == "3" && count($_POST) > 0 && strlen($_POST["persist
|
||||||
$schema->exec();
|
$schema->exec();
|
||||||
|
|
||||||
//get the contents of the sql file
|
//get the contents of the sql file
|
||||||
|
if (file_exists('/usr/share/fusionpbx/resources/install/sql/sqlite.sql')){
|
||||||
|
$filename = "/usr/share/fusionpbx/resources/install/sql/sqlite.sql";
|
||||||
|
}
|
||||||
|
else {
|
||||||
$filename = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/sql/sqlite.sql';
|
$filename = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/sql/sqlite.sql';
|
||||||
|
|
|
||||||
$file_contents = file_get_contents($filename);
|
$file_contents = file_get_contents($filename);
|
||||||
unset($filename);
|
unset($filename);
|
||||||
|
|
||||||
|
|
@ -607,7 +612,12 @@ if ($_POST["install_step"] == "3" && count($_POST) > 0 && strlen($_POST["persist
|
||||||
$schema->exec();
|
$schema->exec();
|
||||||
|
|
||||||
//get the contents of the sql file
|
//get the contents of the sql file
|
||||||
|
if (file_exists('/usr/share/fusionpbx/resources/install/sql/pgsql.sql')){
|
||||||
|
$filename = "/usr/share/fusionpbx/resources/install/sql/pgsql.sql";
|
||||||
|
}
|
||||||
|
else {
|
||||||
$filename = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/sql/pgsql.sql';
|
$filename = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/sql/pgsql.sql';
|
||||||
|
}
|
||||||
$file_contents = file_get_contents($filename);
|
$file_contents = file_get_contents($filename);
|
||||||
|
|
||||||
//replace \r\n with \n then explode on \n
|
//replace \r\n with \n then explode on \n
|
||||||
|
|
@ -774,7 +784,12 @@ if ($_POST["install_step"] == "3" && count($_POST) > 0 && strlen($_POST["persist
|
||||||
|
|
||||||
//add the defaults data into the database
|
//add the defaults data into the database
|
||||||
//get the contents of the sql file
|
//get the contents of the sql file
|
||||||
|
if (file_exists('/usr/share/fusionpbx/resources/install/sql/mysql.sql')){
|
||||||
|
$filename = "/usr/share/fusionpbx/resources/install/sql/mysql.sql";
|
||||||
|
}
|
||||||
|
else {
|
||||||
$filename = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/sql/mysql.sql';
|
$filename = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/sql/mysql.sql';
|
||||||
|
}
|
||||||
$file_contents = file_get_contents($filename);
|
$file_contents = file_get_contents($filename);
|
||||||
|
|
||||||
//replace \r\n with \n then explode on \n
|
//replace \r\n with \n then explode on \n
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue