Move Session code to a better location in the file.
This commit is contained in:
parent
9ab10fd1d4
commit
f73f9b706f
|
|
@ -72,12 +72,44 @@
|
||||||
return $exists;
|
return $exists;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//check to see if the process exists
|
||||||
|
$pid_exists = process_exists($pid_file);
|
||||||
|
|
||||||
|
//prevent the process running more than once
|
||||||
|
if ($pid_exists) {
|
||||||
|
echo "Cannot lock pid file {$pid_file}\n";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
//fax queue enabled
|
//fax queue enabled
|
||||||
if ($_SESSION['fax_queue']['enabled']['boolean'] != 'true') {
|
if ($_SESSION['fax_queue']['enabled']['boolean'] != 'true') {
|
||||||
echo "FAX Queue is disabled in Default Settings\n";
|
echo "FAX Queue is disabled in Default Settings\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//make sure the /var/run/fusionpbx directory exists
|
||||||
|
if (!file_exists('/var/run/fusionpbx')) {
|
||||||
|
$result = mkdir('/var/run/fusionpbx', 0777, true);
|
||||||
|
if (!$result) {
|
||||||
|
die('Failed to create /var/run/fusionpbx');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//create the process id file if the process doesn't exist
|
||||||
|
if (!$pid_exists) {
|
||||||
|
//remove the old pid file
|
||||||
|
if (file_exists($file)) {
|
||||||
|
unlink($pid_file);
|
||||||
|
}
|
||||||
|
|
||||||
|
//show the details to the user
|
||||||
|
//echo "The process id is ".getmypid()."\n";
|
||||||
|
//echo "pid_file: ".$pid_file."\n";
|
||||||
|
|
||||||
|
//save the pid file
|
||||||
|
file_put_contents($pid_file, getmypid());
|
||||||
|
}
|
||||||
|
|
||||||
//get the call center settings
|
//get the call center settings
|
||||||
$interval = $_SESSION['fax_queue']['interval']['numeric'];
|
$interval = $_SESSION['fax_queue']['interval']['numeric'];
|
||||||
|
|
||||||
|
|
@ -103,38 +135,6 @@
|
||||||
$debug = $_SESSION['fax_queue']['debug']['boolean'];
|
$debug = $_SESSION['fax_queue']['debug']['boolean'];
|
||||||
}
|
}
|
||||||
|
|
||||||
//check to see if the process exists
|
|
||||||
$pid_exists = process_exists($pid_file);
|
|
||||||
|
|
||||||
//prevent the process running more than once
|
|
||||||
if ($pid_exists) {
|
|
||||||
echo "Cannot lock pid file {$pid_file}\n";
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
//make sure the /var/run/fusionpbx directory exists
|
|
||||||
if (!file_exists('/var/run/fusionpbx')) {
|
|
||||||
$result = mkdir('/var/run/fusionpbx', 0777, true);
|
|
||||||
if (!$result) {
|
|
||||||
die('Failed to create /var/run/fusionpbx');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//create the process id file if the process doesn't exist
|
|
||||||
if (!$pid_exists) {
|
|
||||||
//remove the old pid file
|
|
||||||
if (file_exists($file)) {
|
|
||||||
unlink($pid_file);
|
|
||||||
}
|
|
||||||
|
|
||||||
//show the details to the user
|
|
||||||
//echo "The process id is ".getmypid()."\n";
|
|
||||||
//echo "pid_file: ".$pid_file."\n";
|
|
||||||
|
|
||||||
//save the pid file
|
|
||||||
file_put_contents($pid_file, getmypid());
|
|
||||||
}
|
|
||||||
|
|
||||||
//get the messages waiting in the email queue
|
//get the messages waiting in the email queue
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue