summaryrefslogtreecommitdiff
path: root/bin/session.php
diff options
context:
space:
mode:
authorTheTroll <trolldev@gmail.com>2010-03-17 16:36:14 +0100
committerTheTroll <trolldev@gmail.com>2010-03-17 16:36:14 +0100
commit1012e0af0746ed8aee4fe4a372020758ea87ffdf (patch)
treec6153d923bed65e57cc526a3d4bc829e09a9e66f /bin/session.php
parent41de0f465be99cf6022c98f7becf154ab9b6bb9d (diff)
downloadistreamdev-1012e0af0746ed8aee4fe4a372020758ea87ffdf.tar.gz
istreamdev-1012e0af0746ed8aee4fe4a372020758ea87ffdf.tar.bz2
Show running sessions
Diffstat (limited to 'bin/session.php')
-rwxr-xr-xbin/session.php42
1 files changed, 41 insertions, 1 deletions
diff --git a/bin/session.php b/bin/session.php
index 0c0b704..737ec50 100755
--- a/bin/session.php
+++ b/bin/session.php
@@ -95,7 +95,7 @@ function sessiondelete($session)
// Get info
list($type, $mode, $url, $channame) = readinfostream($session);
- if ($type)
+ if ($type != "none")
sessiondeletesingle($session);
}
}
@@ -213,5 +213,45 @@ function sessiongetstatus($session)
return $status;
}
+function sessiongetlist()
+{
+ $sessions = array();
+
+ $dir_handle = @opendir('../ram/');
+ if ($dir_handle)
+ {
+ while ($session = readdir($dir_handle))
+ {
+ if($session == "." || $session == ".." || $session == 'lost+found')
+ continue;
+
+ if (!is_dir('../ram/' .$session))
+ continue;
+
+ // Get info
+ list($type, $mode, $url, $channame) = readinfostream($session);
+ if ($type == "none")
+ continue;
+
+ $newsession = array();
+ $newsession['session'] = substr($session, strlen("session"));
+ $newsession['type'] = $type;
+ if ($type == "vid")
+ $newsession['name'] = basename($url);
+ else
+ $newsession['name'] = $channame;
+
+ // Check if encoding
+ if (file_exists('../ram/' .$session .'/segmenter.pid'))
+ $newsession['encoding'] = 1;
+ else
+ $newsession['encoding'] = 0;
+
+ $sessions[] = $newsession;
+ }
+ }
+
+ return $sessions;
+}
?>