cvs: pear /XMMS php_xmms.h xmms.c xmms.php
| From: | Rasmus Lerdorf | Date: | Sun, 12 Aug 2001 16:18:24 +0000 |
| Subject: | cvs: pear /XMMS php_xmms.h xmms.c xmms.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-482@lists.php.net to get a copy of this message | ||
rasmus Sun Aug 12 12:18:24 2001 EDT
Modified files:
/pear/XMMS php_xmms.h xmms.c xmms.php
Log:
Make the location of the xmms binary an ini setting
Index: pear/XMMS/php_xmms.h
diff -u pear/XMMS/php_xmms.h:1.5 pear/XMMS/php_xmms.h:1.6
--- pear/XMMS/php_xmms.h:1.5 Sun Aug 12 03:07:57 2001
+++ pear/XMMS/php_xmms.h Sun Aug 12 12:18:24 2001
@@ -68,6 +68,7 @@
ZEND_BEGIN_MODULE_GLOBALS(xmms)
int session;
+ char *exec_path;
ZEND_END_MODULE_GLOBALS(xmms)
/* In every function that needs to use variables in php_xmms_globals,
Index: pear/XMMS/xmms.c
diff -u pear/XMMS/xmms.c:1.7 pear/XMMS/xmms.c:1.8
--- pear/XMMS/xmms.c:1.7 Sun Aug 12 03:07:57 2001
+++ pear/XMMS/xmms.c Sun Aug 12 12:18:24 2001
@@ -90,6 +90,7 @@
PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("xmms.session", "0", PHP_INI_ALL, OnUpdateInt, session,
zend_xmms_globals, xmms_globals)
+ STD_PHP_INI_ENTRY("xmms.path", "/usr/bin/xmms", PHP_INI_ALL,
OnUpdateString, exec_path, zend_xmms_globals, xmms_globals)
PHP_INI_END()
/* {{{ PHP_MINIT_FUNCTION
@@ -170,7 +171,7 @@
pid = fork();
if(pid > 0) {
daemon(1,0);
- if(execve("/usr/bin/xmms",av,environ)==-1) {
+ if(execve(XG(exec_path),av,environ)==-1) {
php_error(E_WARNING, "Unable to exec XMMS");
exit(-1);
}
Index: pear/XMMS/xmms.php
diff -u pear/XMMS/xmms.php:1.2 pear/XMMS/xmms.php:1.3
--- pear/XMMS/xmms.php:1.2 Sun Aug 12 03:07:57 2001
+++ pear/XMMS/xmms.php Sun Aug 12 12:18:24 2001
@@ -2,7 +2,7 @@
<body>
<?
xmms_start();
-if(isset($url)) {
+if(isset($url) && strlen($url)) {
xmms_url($url);
$len = xmms_playlist_length();
xmms_play($len-1);