Skip to content
Snippets Groups Projects
Verified Commit 42231669 authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX #12391 TIME 1 create baskets.sh script in install

parent 6a2e4ae0
No related branches found
No related tags found
No related merge requests found
......@@ -561,6 +561,11 @@ class Install extends functions
exit;
}
if (!$this->setScriptNotificationBasketsSh()) {
return false;
exit;
}
if (!$this->setConfig_LDAP()) {
return false;
exit;
......@@ -648,6 +653,11 @@ class Install extends functions
exit;
}
if (!$this->setScriptNotificationBasketsSh()) {
return false;
exit;
}
if (!$this->setConfig_LDAP()) {
return false;
exit;
......@@ -954,6 +964,51 @@ class Install extends functions
}
}
private function setScriptNotificationBasketsSh()
{
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$res = 'cd '.realpath('.')."\modules\\notifications\\";
$res .= "\n";
$res .= '"'.realpath('.').'\..\..\php\php.exe" '.realpath('.').'\modules\\notifications\batch\basket_event_stack.php -c '.realpath('.')."\custom/cs_".$_SESSION['config']['databasename'].'\modules\\notifications\batch\config\config.xml\ -n BASKETS';
$res .= "\n";
$fp = @fopen(realpath('.').'/custom/cs_'.$_SESSION['config']['databasename'].'/modules/notifications/batch/scripts/BASKETS.bat', 'w+');
if (!$fp) {
return false;
exit;
}
$write = fwrite($fp, $res);
if (!$write) {
return false;
exit;
}
return true;
} elseif (strtoupper(substr(PHP_OS, 0, 3)) === 'LIN') {
$res = '#!/bin/bash';
$res .= "\n";
$res .= "eventStackPath='".realpath('.')."/modules/notifications/batch/basket_event_stack.php'";
$res .= "\n";
$res .= 'cd '.realpath('.').'/modules/notifications/batch/';
$res .= "\n";
$res .= 'php $eventStackPath -c '.realpath('.').'/custom/cs_'.$_SESSION['config']['databasename'].'/modules/notifications/batch/config/config.xml -n BASKETS';
$res .= "\n";
$fp = @fopen(realpath('.').'/custom/cs_'.$_SESSION['config']['databasename'].'/modules/notifications/batch/scripts/BASKETS.sh', 'w+');
if (!$fp) {
return false;
exit;
}
$write = fwrite($fp, $res);
if (!$write) {
return false;
exit;
}
return true;
}
}
private function setScriptNotificationSendmailSh()
{
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment