Hi all.
I need a help with an application that I'm developing. I have a process running in PHP using FIFOS (concretely a file compression) and I would like to update a progress bar with the state. My problem is that until the PHP script don't ends, the JS don't run.
I'm trying with Ext.Direct but I don't know if it's the correct way. I put the PHP script:
PHP Code:
<?php
$sendPath = '/fifos/p2d';
$recvPath = '/fifos/d2p';
if (file_exists($sendPath)) {
if (!file_exists($recvPath)) {
$old = umask(0);
posix_mkfifo($recvPath, 0666);
umask($old);
}
$fifo = @fopen($sendPath, 'w');
fwrite($fifo, 'init', 5);
fclose($fifo);
if (pcntl_fork == 0) {
$data = "";
$fifo = fopen($recvPath, 'r');
//This While loop wait for server notifications like "10% completed"
do {
$data = fgets($fifo);
if (trim($data) == '') break;
else {
[COLOR="red"]
This is the point where I would like to update the progress bar
[/COLOR]
}
} while (1);
unlink ($recvPath);
}
}
?>
Thanks in advance and best regards