cvs: pear /PECL/xmms CREDITS EXPERIMENTAL Makefile.in README config.m4 gtkxmms php_xmms.h xmms.c xmms.glade xmms.php /PECL/xmms/tests 001.phpt

From: Date: Sun, 09 Dec 2001 19:22:28 +0000
Subject: cvs: pear /PECL/xmms CREDITS EXPERIMENTAL Makefile.in README config.m4 gtkxmms php_xmms.h xmms.c xmms.glade xmms.php /PECL/xmms/tests 001.phpt
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-1492@lists.php.net to get a copy of this message
rasmus Sun Dec 9 14:22:28 2001 EDT Added files: /pear/PECL/xmms CREDITS EXPERIMENTAL Makefile.in README config.m4 gtkxmms php_xmms.h xmms.c xmms.glade xmms.php /pear/PECL/xmms/tests 001.phpt Log: Move XMMS extension to PECL

Index: pear/PECL/xmms/Makefile.in +++ pear/PECL/xmms/Makefile.in # $Id: Makefile.in,v 1.1 2001/12/09 19:22:28 rasmus Exp $ LTLIBRARY_NAME = libxmms.la LTLIBRARY_SOURCES = xmms.c LTLIBRARY_SHARED_NAME = xmms.la LTLIBRARY_SHARED_LIBADD = $(XMMS_SHARED_LIBADD) include $(top_srcdir)/build/dynlib.mk Index: pear/PECL/xmms/config.m4 +++ pear/PECL/xmms/config.m4 dnl $Id: config.m4,v 1.1 2001/12/09 19:22:28 rasmus Exp $ dnl config.m4 for extension xmms PHP_ARG_WITH(xmms, for xmms support, [ --with-xmms[=DIR] Include xmms support]) if test "$PHP_XMMS" != "no"; then SEARCH_PATH="/usr/local /usr" # you might want to change this SEARCH_FOR="/include/xmms/xmmsctrl.h" # you most likely want to change this if test -r $PHP_XMMS/; then # path given as parameter XMMS_DIR=$PHP_XMMS else # search default path list AC_MSG_CHECKING(for xmms files in default path) for i in $SEARCH_PATH ; do if test -r $i/$SEARCH_FOR; then XMMS_DIR=$i AC_MSG_RESULT(found in $i) fi done fi if test -z "$XMMS_DIR"; then AC_MSG_RESULT(not found) AC_MSG_ERROR(Please specify path to your xmms distribution files) fi PHP_ADD_INCLUDE(/usr/include/glib-1.2) PHP_ADD_INCLUDE(/usr/lib/glib/include) dnl # --with-xmms -> chech for lib and symbol presence LIBNAME=xmms LIBSYMBOL=xmms_remote_get_version old_LIBS=$LIBS LIBS="$LIBS -L$XMMS_DIR/lib -lm -ldl" AC_CHECK_LIB($LIBNAME, $LIBSYMBOL, [AC_DEFINE(HAVE_XMMSLIB,1,[ ])], [AC_MSG_ERROR(wrong xmms lib version or lib not found)]) LIBS=$old_LIBS PHP_SUBST(XMMS_SHARED_LIBADD) PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $XMMS_DIR/lib, XMMS_SHARED_LIBADD) PHP_EXTENSION(xmms, $ext_shared) fi Index: pear/PECL/xmms/php_xmms.h +++ pear/PECL/xmms/php_xmms.h /* +----------------------------------------------------------------------+ | PHP version 4.0 | +----------------------------------------------------------------------+ | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 2.02 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available at through the world-wide-web at | | http://www.php.net/license/2_02.txt. | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf <rasmus@php.net> | +----------------------------------------------------------------------+ */ #ifndef PHP_XMMS_H #define PHP_XMMS_H extern zend_module_entry xmms_module_entry; #define phpext_xmms_ptr &xmms_module_entry #ifdef PHP_WIN32 #define PHP_XMMS_API __declspec(dllexport) #else #define PHP_XMMS_API #endif #ifdef ZTS #include "TSRM.h" #endif #include <xmms/xmmsctrl.h> #define PHP_XMMS_VERSION "0.1" PHP_MINIT_FUNCTION(xmms); PHP_MSHUTDOWN_FUNCTION(xmms); PHP_MINFO_FUNCTION(xmms); PHP_NAMED_FUNCTION(php_xmms_start); PHP_FUNCTION(xmms_is_running); PHP_FUNCTION(xmms_playlist_length); PHP_FUNCTION(xmms_playlist_pos); PHP_FUNCTION(xmms_playlist); PHP_FUNCTION(xmms_play); PHP_FUNCTION(xmms_stop); PHP_FUNCTION(xmms_pause); PHP_FUNCTION(xmms_quit); PHP_FUNCTION(xmms_version); PHP_FUNCTION(xmms_next); PHP_FUNCTION(xmms_prev); PHP_FUNCTION(xmms_status); PHP_FUNCTION(xmms_is_repeat); PHP_FUNCTION(xmms_repeat); PHP_FUNCTION(xmms_is_shuffle); PHP_FUNCTION(xmms_shuffle); PHP_FUNCTION(xmms_add); PHP_FUNCTION(xmms_delete); PHP_FUNCTION(xmms_clear); PHP_FUNCTION(xmms_current); PHP_FUNCTION(xmms_volume); PHP_FUNCTION(xmms_url); PHP_FUNCTION(xmms_skin); PHP_FUNCTION(xmms_time); PHP_FUNCTION(xmms_main_win); PHP_FUNCTION(xmms_pl_win); PHP_FUNCTION(xmms_eq_win); PHP_FUNCTION(xmms); 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, call TSRM_FETCH(); after declaring other variables used by that function, and always refer to them as XMMS_G(variable). You are encouraged to rename these macros something shorter, see examples in any other php module directory. */ #ifdef ZTS #define XG(v) TSRMG(xmms_globals_id, zend_xmms_globals *, v) #else #define XG(v) (xmms_globals.v) #endif #endif /* PHP_XMMS_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * indent-tabs-mode: t * End: */ Index: pear/PECL/xmms/xmms.c +++ pear/PECL/xmms/xmms.c /* +----------------------------------------------------------------------+ | PHP version 4.0 | +----------------------------------------------------------------------+ | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 2.02 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available at through the world-wide-web at | | http://www.php.net/license/2_02.txt. | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf <rasmus@php.net> | +----------------------------------------------------------------------+ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_globals.h" #include "SAPI.h" #include "php_ini.h" #include "ext/standard/info.h" #include "php_xmms.h" ZEND_DECLARE_MODULE_GLOBALS(xmms) /* {{{ xmms_functions[] * * Every user visible function must have an entry in xmms_functions[]. */ function_entry xmms_functions[] = { PHP_STATIC_FE("xmms_start", php_xmms_start, NULL) PHP_FE(xmms_is_running, NULL) PHP_FE(xmms_playlist_length, NULL) PHP_FE(xmms_playlist_pos, NULL) PHP_FE(xmms_playlist, NULL) PHP_FE(xmms_play, NULL) PHP_FE(xmms_stop, NULL) PHP_FE(xmms_pause, NULL) PHP_FE(xmms_quit, NULL) PHP_FE(xmms_version, NULL) PHP_FE(xmms_next, NULL) PHP_FE(xmms_prev, NULL) PHP_FE(xmms_status, NULL) PHP_FE(xmms_is_repeat, NULL) PHP_FE(xmms_repeat, NULL) PHP_FE(xmms_is_shuffle, NULL) PHP_FE(xmms_shuffle, NULL) PHP_FE(xmms_add, NULL) PHP_FE(xmms_delete, NULL) PHP_FE(xmms_clear, NULL) PHP_FE(xmms_current, NULL) PHP_FE(xmms_volume, NULL) PHP_FE(xmms_url, NULL) PHP_FE(xmms_skin, NULL) PHP_FE(xmms_time, NULL) PHP_FE(xmms_main_win, NULL) PHP_FE(xmms_pl_win, NULL) PHP_FE(xmms_eq_win, NULL) {NULL, NULL, NULL} }; /* }}} */ /* An OO interface as well */ static zend_class_entry *xmms_class_entry_ptr; static zend_function_entry php_xmms_class_functions[] = { PHP_FE(xmms, NULL) PHP_STATIC_FE("start", php_xmms_start, NULL) PHP_FALIAS(play, xmms_play, NULL) PHP_FALIAS(stop, xmms_stop, NULL) PHP_FALIAS(pause, xmms_pause, NULL) PHP_FALIAS(quit, xmms_quit, NULL) PHP_FALIAS(next, xmms_next, NULL) PHP_FALIAS(prev, xmms_prev, NULL) PHP_FALIAS(playlist_length, xmms_playlist_length, NULL) PHP_FALIAS(playlist_pos, xmms_playlist_pos, NULL) PHP_FALIAS(playlist, xmms_playlist, NULL) PHP_FALIAS(status, xmms_status, NULL) PHP_FALIAS(repeat, xmms_repeat, NULL) PHP_FALIAS(shuffle, xmms_shuffle, NULL) PHP_FALIAS(add, xmms_add, NULL) PHP_FALIAS(delete, xmms_delete, NULL) PHP_FALIAS(clear, xmms_clear, NULL) PHP_FALIAS(current, xmms_current, NULL) PHP_FALIAS(volume, xmms_volume, NULL) PHP_FALIAS(url, xmms_url, NULL) PHP_FALIAS(skin, xmms_skin, NULL) PHP_FALIAS(time, xmms_time, NULL) PHP_FALIAS(main_win, xmms_main_win, NULL) PHP_FALIAS(pl_win, xmms_pl_win, NULL) PHP_FALIAS(eq_win, xmms_eq_win, NULL) {NULL, NULL, NULL} }; /* {{{ xmms_module_entry */ zend_module_entry xmms_module_entry = { #if ZEND_MODULE_API_NO >= 20010901 STANDARD_MODULE_HEADER, #endif "xmms", xmms_functions, PHP_MINIT(xmms), PHP_MSHUTDOWN(xmms), NULL, NULL, PHP_MINFO(xmms), #if ZEND_MODULE_API_NO >= 20010901 PHP_XMMS_VERSION, #endif STANDARD_MODULE_PROPERTIES }; /* }}} */ #ifdef COMPILE_DL_XMMS ZEND_GET_MODULE(xmms) #endif /* {{{ php_xmms_init_globals */ static void php_xmms_init_globals(zend_xmms_globals *xmms_globals) { xmms_globals->session = 0; } /* }}} */ 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 */ PHP_MINIT_FUNCTION(xmms) { zend_class_entry xmms_class_entry; ZEND_INIT_MODULE_GLOBALS(xmms, php_xmms_init_globals, NULL); INIT_CLASS_ENTRY(xmms_class_entry, "xmms", php_xmms_class_functions); xmms_class_entry_ptr = zend_register_internal_class(&xmms_class_entry TSRMLS_CC); REGISTER_INI_ENTRIES(); return SUCCESS; } /* }}} */ /* {{{ PHP_MSHUTDOWN_FUNCTION */ PHP_MSHUTDOWN_FUNCTION(xmms) { if(xmms_remote_is_running(XG(session))) { xmms_remote_quit(XG(session)); } UNREGISTER_INI_ENTRIES(); return SUCCESS; } /* }}} */ /* {{{ PHP_MINFO_FUNCTION */ PHP_MINFO_FUNCTION(xmms) { char buf[16]; int running, pos; php_info_print_table_start(); php_info_print_table_header(2, "xmms support", "enabled"); running = xmms_remote_is_running(XG(session)); if(running) { if(xmms_remote_is_paused(XG(session))) { php_info_print_table_row(2, "XMMS Status", "Paused"); } else { if(xmms_remote_is_playing(XG(session))) { php_info_print_table_row(2, "XMMS Status", "Playing"); } else { php_info_print_table_row(2, "XMMS Status", "Stopped"); } } sprintf(buf, "%d", xmms_remote_get_version(XG(session))); php_info_print_table_row(2, "XMMS Version", buf); pos = xmms_remote_get_playlist_pos(XG(session)); sprintf(buf, "%d", pos); php_info_print_table_row(2, "Current Playlist Entry #", buf); php_info_print_table_row(2, "Current Song", xmms_remote_get_playlist_title(XG(session), pos)); php_info_print_table_row(2, "Current Filename", xmms_remote_get_playlist_file(XG(session), pos)); sprintf(buf, "%.3f", (double)(xmms_remote_get_playlist_time(XG(session), pos)/1000.0)); php_info_print_table_row(2, "Current Song Length", buf); sprintf(buf, "%.3f", (double)(xmms_remote_get_output_time(XG(session))/1000.0)); php_info_print_table_row(2, "Current Song Position", buf); } else { php_info_print_table_row(2, "XMMS Status", "Not Running"); } php_info_print_table_end(); DISPLAY_INI_ENTRIES(); } /* }}} */ /* {{{ proto int xmms_start(void) Start up XMMS if it is not already running */ PHP_NAMED_FUNCTION(php_xmms_start) { pid_t pid; char *av[] = { "xmms",NULL }; /* slight hack here, ignore a single argument which might come in from the xmms constructor */ if(ZEND_NUM_ARGS() > 1) { WRONG_PARAM_COUNT; } if(!xmms_remote_is_running(XG(session))) { /* Ok, this is pretty weird, but hey, why not? */ pid = fork(); if(pid > 0) { daemon(1,0); if(execve(XG(exec_path),av,environ)==-1) { php_error(E_WARNING, "Unable to exec XMMS"); exit(-1); } } else if(pid==0) sleep(1); else if(pid==-1) { php_error(E_WARNING, "Unable to fork XMMS"); RETURN_FALSE; } } if(xmms_remote_is_running(XG(session))) { RETURN_TRUE; } else { RETURN_FALSE; } } /* }}} */ /* {{{ proto bool xmms_is_running(void) Check if XMMS is running */ PHP_FUNCTION(xmms_is_running) { if(ZEND_NUM_ARGS() != 0) { WRONG_PARAM_COUNT; } RETVAL_BOOL(xmms_remote_is_running(XG(session))?1:0); if(this_ptr) add_property_bool(this_ptr, "running", Z_BVAL_P(return_value)); } /* }}} */ /* {{{ proto int xmms_playlist_length(void) Get the number of songs in the playlist */ PHP_FUNCTION(xmms_playlist_length) { if(ZEND_NUM_ARGS() != 0) { WRONG_PARAM_COUNT; } if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } RETVAL_LONG(xmms_remote_get_playlist_length(XG(session))); if(this_ptr) add_property_long(this_ptr, "playlist_length", Z_LVAL_P(return_value)); } /* }}} */ /* {{{ proto int xmms_playlist_pos(void) Get current playlist position */ PHP_FUNCTION(xmms_playlist_pos) { if(ZEND_NUM_ARGS() != 0) { WRONG_PARAM_COUNT; } if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } RETVAL_LONG(xmms_remote_get_playlist_pos(XG(session))); if(this_ptr) add_property_long(this_ptr, "playlist_pos", Z_LVAL_P(return_value)); } /* }}} */ /* {{{ proto array xmms_playlist([mixed pos]) Get full or partial playlist info */ PHP_FUNCTION(xmms_playlist) { int argc = ZEND_NUM_ARGS(); long pos=-1; pval *tmp_arr, **tmp, *var; int len, i, single=0; char *title, *file; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &var) == FAILURE) return; if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } if(argc && Z_TYPE_P(var) != IS_ARRAY) { convert_to_long(var); pos = Z_LVAL_P(var); single=1; } array_init(return_value); if(!argc) { len = xmms_remote_get_playlist_length(XG(session)); for(i=0; i<len; i++) { MAKE_STD_ZVAL(tmp_arr); array_init(tmp_arr); title = xmms_remote_get_playlist_title(XG(session),i); file = xmms_remote_get_playlist_file(XG(session),i); add_assoc_string(tmp_arr, "title", title?title:"", 1); add_assoc_string(tmp_arr, "file", file?file:"", 1); add_assoc_double(tmp_arr, "time", xmms_remote_get_playlist_time(XG(session),i)/1000.0); add_index_zval(return_value, i, tmp_arr); } } else { if(single) { title = xmms_remote_get_playlist_title(XG(session),pos); file = xmms_remote_get_playlist_file(XG(session),pos); add_assoc_string(return_value, "title", title?title:"", 1); add_assoc_string(return_value, "file", file?file:"", 1); add_assoc_double(return_value, "time", xmms_remote_get_playlist_time(XG(session),pos)/1000.0); } else { /* We were passed an array of playlist positions to get info on */ len = xmms_remote_get_playlist_length(XG(session)); zend_hash_internal_pointer_reset(Z_ARRVAL_P(var)); while (zend_hash_get_current_data(Z_ARRVAL_P(var), (void **)&tmp) == SUCCESS) { convert_to_long_ex(tmp); if(Z_LVAL_PP(tmp)<0 || Z_LVAL_PP(tmp)>=len) { zend_hash_move_forward(Z_ARRVAL_P(var)); continue; } MAKE_STD_ZVAL(tmp_arr); array_init(tmp_arr); title = xmms_remote_get_playlist_title(XG(session),Z_LVAL_PP(tmp)); file = xmms_remote_get_playlist_file(XG(session),Z_LVAL_PP(tmp)); add_assoc_string(tmp_arr, "title", title?title:"", 1); add_assoc_string(tmp_arr, "file", file?file:"", 1); add_assoc_double(tmp_arr, "time", xmms_remote_get_playlist_time(XG(session),Z_LVAL_PP(tmp))/1000.0); add_index_zval(return_value, Z_LVAL_PP(tmp), tmp_arr); zend_hash_move_forward(Z_ARRVAL_P(var)); } } } } /* }}} */ /* {{{ proto void xmms_play([int pos]) Play current or provided song position */ PHP_FUNCTION(xmms_play) { int argc = ZEND_NUM_ARGS(); long pos; if (zend_parse_parameters(argc TSRMLS_CC, "|l", &pos) == FAILURE) return; if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } if(argc) xmms_remote_set_playlist_pos(XG(session), pos); xmms_remote_play(XG(session)); } /* }}} */ /* {{{ proto void xmms_stop(void) Stop playing current song */ PHP_FUNCTION(xmms_stop) { if(ZEND_NUM_ARGS() != 0) { WRONG_PARAM_COUNT; } if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } xmms_remote_stop(XG(session)); } /* }}} */ /* {{{ proto xmms_pause(void) Pause current song (toggle) */ PHP_FUNCTION(xmms_pause) { if(ZEND_NUM_ARGS() != 0) { WRONG_PARAM_COUNT; } if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } xmms_remote_pause(XG(session)); } /* }}} */ /* {{{ proto void xmms_quit(void) Force XMMS to terminate */ PHP_FUNCTION(xmms_quit) { if(ZEND_NUM_ARGS() != 0) { WRONG_PARAM_COUNT; } if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } xmms_remote_quit(XG(session)); if(this_ptr) add_property_bool(this_ptr, "is_running", 0); } /* }}} */ /* {{{ proto int xmms_version(void) Get the XMMS version */ PHP_FUNCTION(xmms_version) { if(ZEND_NUM_ARGS() != 0) { WRONG_PARAM_COUNT; } if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } RETVAL_LONG(xmms_remote_get_version(XG(session))); if(this_ptr) add_property_long(this_ptr, "version", Z_LVAL_P(return_value)); } /* }}} */ /* {{{ proto void xmms_next(void) Go to next song in playlist */ PHP_FUNCTION(xmms_next) { if(ZEND_NUM_ARGS() != 0) { WRONG_PARAM_COUNT; } if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } xmms_remote_playlist_next(XG(session)); } /* }}} */ /* {{{ proto void xmms_prev(void) Go to previous song in playlist */ PHP_FUNCTION(xmms_prev) { if(ZEND_NUM_ARGS() != 0) { WRONG_PARAM_COUNT; } if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } xmms_remote_playlist_prev(XG(session)); } /* }}} */ /* {{{ proto string xmms_status(void) Returns current XMMS status */ PHP_FUNCTION(xmms_status) { int playing, paused; pval **status; if(ZEND_NUM_ARGS() != 0) { WRONG_PARAM_COUNT; } if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } playing = xmms_remote_is_playing(XG(session)); paused = xmms_remote_is_paused(XG(session)); if(paused) { RETVAL_STRINGL("Paused",6,1); } else { if(playing) { RETVAL_STRINGL("Playing",7,1); } else { RETVAL_STRINGL("Stopped",7,1); } } /* If we were called as a class method, update the status property */ if(this_ptr) add_property_stringl(this_ptr, "status", Z_STRVAL_P(return_value), Z_STRLEN_P(return_value), 1); } /* }}} */ /* {{{ proto bool xmms_is_repeat(void) Get repeat setting */ PHP_FUNCTION(xmms_is_repeat) { if(ZEND_NUM_ARGS() != 0) { WRONG_PARAM_COUNT; } if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } RETVAL_BOOL(xmms_remote_is_repeat(XG(session))); if(this_ptr) add_property_bool(this_ptr, "repeat", Z_BVAL_P(return_value)); } /* }}} */ /* {{{ proto int xmms_repeat([bool setting]) Toggle/Set repeat setting */ PHP_FUNCTION(xmms_repeat) { int argc = ZEND_NUM_ARGS(); zend_bool setting; gboolean current; if (zend_parse_parameters(argc TSRMLS_CC, "|b", &setting) == FAILURE) return; if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } if(argc) { current = xmms_remote_is_repeat(XG(session)); if(current) current=1; else current=0; if(current != setting) { xmms_remote_toggle_repeat(XG(session)); } } else { setting = !xmms_remote_is_repeat(XG(session)); xmms_remote_toggle_repeat(XG(session)); } RETURN_BOOL(setting); } /* }}} */ /* {{{ proto bool xmms_is_shuffle(void) Get shuffle setting */ PHP_FUNCTION(xmms_is_shuffle) { if(ZEND_NUM_ARGS() != 0) { WRONG_PARAM_COUNT; } if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } RETVAL_BOOL(xmms_remote_is_shuffle(XG(session))); if(this_ptr) add_property_bool(this_ptr, "shuffle", Z_BVAL_P(return_value)); } /* }}} */ /* {{{ proto int xmms_shuffle([bool setting]) Toggle/Set shuffle setting*/ PHP_FUNCTION(xmms_shuffle) { int argc = ZEND_NUM_ARGS(); zend_bool setting; gboolean current; if (zend_parse_parameters(argc TSRMLS_CC, "|b", &setting) == FAILURE) return; if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } if(argc) { current = xmms_remote_is_shuffle(XG(session)); if(current) current=1; else current=0; if(current != setting) { xmms_remote_toggle_shuffle(XG(session)); } } else { setting = !xmms_remote_is_shuffle(XG(session)); xmms_remote_toggle_shuffle(XG(session)); } RETURN_BOOL(setting); } /* }}} */ /* {{{ proto xmms_add(mixed songs) Add entries to playlist */ PHP_FUNCTION(xmms_add) { zval *songs = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &songs) == FAILURE) return; if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } php_error(E_WARNING, "xmms_add: not yet implemented"); } /* }}} */ /* {{{ proto xmms_delete(int pos) Delete entry from playlist */ PHP_FUNCTION(xmms_delete) { int argc = ZEND_NUM_ARGS(); long pos; if (zend_parse_parameters(argc TSRMLS_CC, "l", &pos) == FAILURE) return; if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } php_error(E_WARNING, "xmms_delete: not yet implemented"); } /* }}} */ /* {{{ proto xmms_clear(void) Clear playlist */ PHP_FUNCTION(xmms_clear) { if(ZEND_NUM_ARGS() != 0) { WRONG_PARAM_COUNT; } if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } php_error(E_WARNING, "xmms_clear: not yet implemented"); } /* }}} */ /* {{{ proto array xmms_current(void) Get current song info */ PHP_FUNCTION(xmms_current) { long pos, time, timepos; char *fn, *title; int rate, freq, nch; int playing, paused, repeat, shuffle; char status[10]; if(ZEND_NUM_ARGS() != 0) { WRONG_PARAM_COUNT; } if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } playing = xmms_remote_is_playing(XG(session)); paused = xmms_remote_is_paused(XG(session)); timepos = xmms_remote_get_output_time(XG(session)); pos = xmms_remote_get_playlist_pos(XG(session)); fn = xmms_remote_get_playlist_file(XG(session), pos); title = xmms_remote_get_playlist_title(XG(session), pos); time = xmms_remote_get_playlist_time(XG(session), pos); repeat = xmms_remote_is_repeat(XG(session)); shuffle = xmms_remote_is_shuffle(XG(session)); if(paused) strcpy(status,"Paused"); else { if(playing) strcpy(status,"Playing"); else strcpy(status,"Stopped"); } xmms_remote_get_info(XG(session), &rate, &freq, &nch); array_init(return_value); add_assoc_long(return_value, "pos", pos); add_assoc_string(return_value, "file", fn?fn:"", 1); add_assoc_string(return_value, "title", title?title:"", 1); add_assoc_double(return_value, "time", (double)(time/1000.0)); add_assoc_double(return_value, "timepos", (double)(timepos/1000.0)); add_assoc_string(return_value, "status", status?status:"", 1); add_assoc_bool(return_value, "repeat", repeat); add_assoc_bool(return_value, "shuffle", shuffle); add_assoc_long(return_value, "rate", rate); add_assoc_long(return_value, "freq", freq); add_assoc_long(return_value, "nch", nch); if(this_ptr) { add_property_long(this_ptr, "pos", pos); if(fn) add_property_string(this_ptr, "file", fn, 1); if(title) add_property_string(this_ptr, "title", title, 1); if(status) add_property_string(this_ptr, "status", status, 1); add_property_double(this_ptr, "time", (double)(time/1000.0)); add_property_double(this_ptr, "timepos", (double)(timepos/1000.0)); add_property_bool(this_ptr, "repeat", repeat); add_property_bool(this_ptr, "shuffle", shuffle); add_property_long(this_ptr, "rate", rate); add_property_long(this_ptr, "freq", freq); add_property_long(this_ptr, "nch", nch); } } /* }}} */ /* {{{ proto xmms_volume([int level [, int right_level]]) */ PHP_FUNCTION(xmms_volume) { int argc = ZEND_NUM_ARGS(); long level; long right_level; if (zend_parse_parameters(argc TSRMLS_CC, "|ll", &level, &right_level) == FAILURE) return; if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } php_error(E_WARNING, "xmms_volume: not yet implemented"); } /* }}} */ /* {{{ proto void xmms_url(string url) Play from url */ PHP_FUNCTION(xmms_url) { char *url = NULL; int url_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &url, &url_len) == FAILURE) return; if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } xmms_remote_playlist_add_url_string(XG(session), url); } /* }}} */ /* {{{ proto xmms_skin([string skin_file]) */ PHP_FUNCTION(xmms_skin) { char *skin_file = NULL; int argc = ZEND_NUM_ARGS(); int skin_file_len; if (zend_parse_parameters(argc TSRMLS_CC, "|s", &skin_file, &skin_file_len) == FAILURE) return; if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } php_error(E_WARNING, "xmms_skin: not yet implemented"); } /* }}} */ /* {{{ proto float xmms_time([float time_pos]) Get/Set output time position */ PHP_FUNCTION(xmms_time) { int argc = ZEND_NUM_ARGS(); double time_pos; if (zend_parse_parameters(argc TSRMLS_CC, "|d", &time_pos) == FAILURE) return; if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } switch (argc) { case 1: xmms_remote_jump_to_time(XG(session), (int)(time_pos*1000)); RETVAL_DOUBLE(time_pos); break; case 0: RETVAL_DOUBLE((double)(xmms_remote_get_output_time(XG(session))/1000.0)); break; } } /* }}} */ /* {{{ proto void xmms_main_win(bool setting) Hide/Unhide main xmms window */ PHP_FUNCTION(xmms_main_win) { int argc = ZEND_NUM_ARGS(); zend_bool setting; if (zend_parse_parameters(argc TSRMLS_CC, "b", &setting) == FAILURE) return; if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } xmms_remote_main_win_toggle(XG(session),setting); } /* }}} */ /* {{{ proto void xmms_pl_win(bool setting) Hide/Unhide playlist xmms window */ PHP_FUNCTION(xmms_pl_win) { int argc = ZEND_NUM_ARGS(); zend_bool setting; if (zend_parse_parameters(argc TSRMLS_CC, "b", &setting) == FAILURE) return; if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } xmms_remote_pl_win_toggle(XG(session),setting); } /* }}} */ /* {{{ proto void xmms_eq_win(bool setting) Hide/Unhide equalizer xmms window */ PHP_FUNCTION(xmms_eq_win) { int argc = ZEND_NUM_ARGS(); zend_bool setting; if (zend_parse_parameters(argc, "b", &setting) == FAILURE) return; if(!xmms_remote_is_running(XG(session))) { php_error(E_WARNING, "XMMS is not running"); RETURN_FALSE; } xmms_remote_eq_win_toggle(XG(session),setting); } /* }}} */ /* pval _xmms_property_get(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *prop_ref) { pval result; zend_llist_element *element = prop_ref->elements_list->head; zend_overloaded_element overloaded_property = (zend_overloaded_element *) element->data; result.refcount = 1; result.is_ref = 0; Z_TYPE(result) = IS_STRING; Z_STRVAL(result) = estrdup("Hello World"); Z_STRLEN(result) = 11; return result; } */ /* {{{ proto object xmms([bool start]) XMMS class constructor */ PHP_FUNCTION(xmms) { int argc = ZEND_NUM_ARGS(); zend_bool start = 0; pval **tmp; if (zend_parse_parameters(argc TSRMLS_CC, "|b", &start) == FAILURE) return; if(argc && start) { if(!xmms_remote_is_running(XG(session))) { php_xmms_start(INTERNAL_FUNCTION_PARAM_PASSTHRU); } } /* xmms_class_entry_ptr->handle_property_get = _xmms_property_get; */ if(xmms_remote_is_running(XG(session))) { add_property_long(this_ptr, "version", xmms_remote_get_version(XG(session))); add_property_bool(this_ptr, "running", 1); add_property_bool(this_ptr, "repeat", xmms_remote_is_repeat(XG(session))); add_property_bool(this_ptr, "shuffle", xmms_remote_is_shuffle(XG(session))); } else { add_property_long(this_ptr, "version", 0); add_property_bool(this_ptr, "running", 0); add_property_bool(this_ptr, "repeat", 0); add_property_bool(this_ptr, "shuffle", 0); } /* add_property_string(this_ptr, "mime type", SG(default_mimetype), 1); add_property_string(this_ptr, "SAPI", sapi_module.pretty_name, 1); if(zend_hash_find(&EG(symbol_table), "foo", 4, (void **)&tmp) == SUCCESS) { add_property_stringl(this_ptr, "foo", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); } else { add_property_string(this_ptr, "foo", "undefined", 1); } */ } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 tw=78 fdm=marker * vim<600: sw=4 ts=4 tw=78 */ Index: pear/PECL/xmms/xmms.glade +++ pear/PECL/xmms/xmms.glade <?xml version="1.0"?> <GTK-Interface> <project> <name>Xmms</name> <program_name>xmms</program_name> <directory></directory> <source_directory>src</source_directory> <pixmaps_directory>pixmaps</pixmaps_directory> <language>C</language> <gnome_support>True</gnome_support> <gettext_support>True</gettext_support> <output_main_file>False</output_main_file> <output_support_files>False</output_support_files> <output_build_files>False</output_build_files> </project> <widget> <class>GtkWindow</class> <name>xmms</name> <signal> <name>destroy</name> <handler>destroy</handler> <last_modification_time>Thu, 09 Aug 2001 15:21:09 GMT</last_modification_time> </signal> <signal> <name>delete_event</name> <handler>delete_event</handler> <last_modification_time>Thu, 09 Aug 2001 15:21:47 GMT</last_modification_time> </signal> <signal> <name>destroy_event</name> <handler>destroy</handler> <last_modification_time>Thu, 09 Aug 2001 15:22:09 GMT</last_modification_time> </signal> <title>PHP-XMMS</title> <type>GTK_WINDOW_TOPLEVEL</type> <position>GTK_WIN_POS_NONE</position> <modal>False</modal> <allow_shrink>False</allow_shrink> <allow_grow>False</allow_grow> <auto_shrink>False</auto_shrink> <widget> <class>GtkAlignment</class> <name>alignment1</name> <xalign>0.5</xalign> <yalign>0.5</yalign> <xscale>1</xscale> <yscale>1</yscale> <widget> <class>GtkTable</class> <name>table1</name> <rows>3</rows> <columns>5</columns> <homogeneous>False</homogeneous> <row_spacing>0</row_spacing> <column_spacing>0</column_spacing> <widget> <class>GtkButton</class> <name>prev</name> <border_width>1</border_width> <can_focus>True</can_focus> <signal> <name>clicked</name> <handler>on_prev_clicked</handler> <last_modification_time>Thu, 09 Aug 2001 17:19:37 GMT</last_modification_time> </signal> <label>Previous</label> <relief>GTK_RELIEF_NORMAL</relief> <child> <left_attach>0</left_attach> <right_attach>1</right_attach> <top_attach>2</top_attach> <bottom_attach>3</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>False</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> <xfill>True</xfill> <yfill>False</yfill> </child> </widget> <widget> <class>GtkButton</class> <name>next</name> <border_width>1</border_width> <can_focus>True</can_focus> <signal> <name>clicked</name> <handler>on_next_clicked</handler> <last_modification_time>Thu, 09 Aug 2001 05:14:19 GMT</last_modification_time> </signal> <label>Next</label> <relief>GTK_RELIEF_NORMAL</relief> <child> <left_attach>3</left_attach> <right_attach>4</right_attach> <top_attach>2</top_attach> <bottom_attach>3</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>False</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> <xfill>True</xfill> <yfill>False</yfill> </child> </widget> <widget> <class>GtkButton</class> <name>play</name> <border_width>1</border_width> <can_focus>True</can_focus> <signal> <name>clicked</name> <handler>on_play_clicked</handler> <last_modification_time>Thu, 09 Aug 2001 05:41:35 GMT</last_modification_time> </signal> <label>Play</label> <relief>GTK_RELIEF_NORMAL</relief> <child> <left_attach>1</left_attach> <right_attach>2</right_attach> <top_attach>2</top_attach> <bottom_attach>3</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>False</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> <xfill>True</xfill> <yfill>False</yfill> </child> </widget> <widget> <class>GtkButton</class> <name>pause</name> <border_width>1</border_width> <can_focus>True</can_focus> <signal> <name>clicked</name> <handler>xmms_pause</handler> <last_modification_time>Thu, 09 Aug 2001 05:38:57 GMT</last_modification_time> </signal> <label>Pause</label> <relief>GTK_RELIEF_NORMAL</relief> <child> <left_attach>2</left_attach> <right_attach>3</right_attach> <top_attach>2</top_attach> <bottom_attach>3</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>False</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> <xfill>True</xfill> <yfill>False</yfill> </child> </widget> <widget> <class>GtkToggleButton</class> <name>shuffle</name> <border_width>1</border_width> <can_focus>True</can_focus> <signal> <name>toggled</name> <handler>on_shuffle_toggled</handler> <last_modification_time>Thu, 09 Aug 2001 05:51:09 GMT</last_modification_time> </signal> <label>Shuffle</label> <relief>GTK_RELIEF_HALF</relief> <active>False</active> <child> <left_attach>2</left_attach> <right_attach>3</right_attach> <top_attach>1</top_attach> <bottom_attach>2</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>False</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> <xfill>True</xfill> <yfill>False</yfill> </child> </widget> <widget> <class>GtkToggleButton</class> <name>repeat</name> <border_width>1</border_width> <can_focus>True</can_focus> <signal> <name>toggled</name> <handler>on_repeat_toggled</handler> <last_modification_time>Thu, 09 Aug 2001 05:52:25 GMT</last_modification_time> </signal> <label>Repeat</label> <relief>GTK_RELIEF_HALF</relief> <active>False</active> <child> <left_attach>3</left_attach> <right_attach>4</right_attach> <top_attach>1</top_attach> <bottom_attach>2</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>False</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> <xfill>True</xfill> <yfill>False</yfill> </child> </widget> <widget> <class>GtkProgressBar</class> <name>time</name> <value>0</value> <lower>0</lower> <upper>100</upper> <bar_style>GTK_PROGRESS_CONTINUOUS</bar_style> <orientation>GTK_PROGRESS_LEFT_TO_RIGHT</orientation> <activity_mode>False</activity_mode> <show_text>True</show_text> <format>%vs (%p%%)</format> <text_xalign>0.5</text_xalign> <text_yalign>0.5</text_yalign> <child> <left_attach>0</left_attach> <right_attach>2</right_attach> <top_attach>1</top_attach> <bottom_attach>2</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>False</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> <xfill>True</xfill> <yfill>False</yfill> </child> </widget> <widget> <class>GtkLabel</class> <name>status</name> <label></label> <justify>GTK_JUSTIFY_CENTER</justify> <wrap>False</wrap> <xalign>0</xalign> <yalign>0.5</yalign> <xpad>2</xpad> <ypad>2</ypad> <child> <left_attach>0</left_attach> <right_attach>4</right_attach> <top_attach>0</top_attach> <bottom_attach>1</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>False</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> <xfill>True</xfill> <yfill>False</yfill> </child> </widget> <widget> <class>GtkCheckButton</class> <name>win</name> <can_focus>True</can_focus> <signal> <name>toggled</name> <handler>on_win_toggled</handler> <last_modification_time>Fri, 10 Aug 2001 00:28:07 GMT</last_modification_time> </signal> <label>win</label> <active>False</active> <draw_indicator>True</draw_indicator> <child> <left_attach>4</left_attach> <right_attach>5</right_attach> <top_attach>0</top_attach> <bottom_attach>1</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>False</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> <xfill>True</xfill> <yfill>False</yfill> </child> </widget> <widget> <class>GtkCheckButton</class> <name>pl</name> <can_focus>True</can_focus> <signal> <name>toggled</name> <handler>on_pl_toggled</handler> <last_modification_time>Fri, 10 Aug 2001 00:27:38 GMT</last_modification_time> </signal> <label>pl</label> <active>False</active> <draw_indicator>True</draw_indicator> <child> <left_attach>4</left_attach> <right_attach>5</right_attach> <top_attach>1</top_attach> <bottom_attach>2</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>False</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> <xfill>True</xfill> <yfill>False</yfill> </child> </widget> <widget> <class>GtkCheckButton</class> <name>eq</name> <can_focus>True</can_focus> <signal> <name>toggled</name> <handler>on_eq_toggled</handler> <last_modification_time>Fri, 10 Aug 2001 00:27:28 GMT</last_modification_time> </signal> <label>eq</label> <active>False</active> <draw_indicator>True</draw_indicator> <child> <left_attach>4</left_attach> <right_attach>5</right_attach> <top_attach>2</top_attach> <bottom_attach>3</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>False</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> <xfill>True</xfill> <yfill>False</yfill> </child> </widget> </widget> </widget> </widget> </GTK-Interface> Index: pear/PECL/xmms/xmms.php +++ pear/PECL/xmms/xmms.php <html><head><title>PHP-XMMS Controller</title></head> <body> <? function ms($secs) { $min = (int)($secs/60); $sec = sprintf('%02d',$secs%60); return array($min,$sec); } xmms_start(); if(isset($url) && strlen($url)) { xmms_url($url); $len = xmms_playlist_length(); xmms_play($len-1); sleep(1); } if($action) { xmms_shuffle(empty($shuffle)?false:true); xmms_repeat(empty($repeat)?false:true); } if(!xmms_is_running()) { echo "XMMS is currently disabled\n"; exit; } switch($action) { case 'play': xmms_play(); break; case 'stop': xmms_stop(); break; case 'pause': case 'continue': xmms_pause(); break; case 'prev': xmms_prev(); sleep(1); break; case 'next': xmms_next(); sleep(1); break; } if($action) usleep(300); ?> <table border=0><tr><td bgcolor=#000000> <form action="<?echo $PHP_SELF?>" method="POST"> <table cellspacing=3 cellpadding=3 border=0 width=100%> <? $song = xmms_current(); $channels = array(1=>'Mono',2=>'Stereo'); ?> <tr bgcolor=#002244><td colspan=4><font color=#60afbf><?echo $song['pos'].': '.$song['title']?></font></td></tr> <? if($song['time'] < 0.1) $progress = 'Playing from <a href="'.$song['file'].'">URL</a>'; else $progress = (int)(($song['timepos']/$song['time'])*100) .'%'; list($min,$sec) = ms($song['timepos']); ?> <tr><td colspan=4><font color=#99bbcc><?echo "$min:$sec (".$progress.')'?></font></td></tr> <tr><td colspan=2><font color=#bb99cc><?echo ($song['rate']/1000).'kbps '.($song['freq']/1000).'kHz '.$channels[$song['nch']]?></font></td> <td><font size=-2><font color=#88AACC>random</font><input type=checkbox name=shuffle <?echo xmms_is_shuffle()?'CHECKED':''?>></td> <td><font size=-2><font color=#88AACC>repeat</font><input type=checkbox name=repeat <?echo xmms_is_repeat()?'CHECKED':''?>></td></tr> <tr><td align=center><input type=submit name=action value=prev></td> <?$status = xmms_status(); if($status=="Playing" || $status=="Paused") {?> <td align=center><input type=submit name=action value=stop></td> <? } else { ?> <td align=center><input type=submit name=action value=play></td> <? } ?> <?if($status=="Paused") {?> <td align=center><input type=submit name=action value=continue></td> <? } else { ?> <td align=center><input type=submit name=action value=pause></td> <? } ?> <td align=center><input type=submit name=action value=next></td> </tr> <tr><td colspan=4 bgcolor=#002244><table width=100% cellspacing=0 cellpadding=0> <? $list = xmms_playlist(range($song['pos']-5, $song['pos']+5)); foreach($list as $pos=>$plsong) { list($min,$sec) = ms($plsong['time']); if($pos == $song['pos']) $bg = "bgcolor=#446688"; else $bg=''; echo "<tr><td $bg><font color=#aaccdd>$pos: ".$plsong['title']."</font></td><td align=right><font color=#ffffff>$min:$sec</font></td></tr>\n"; } ?> </table></td></tr> <tr><td colspan=4><font color=#99ccbb>url: </font><input type=text name=url></td></tr> </form> </table></td></tr></table> <tt><font size=-1>A <a href="http://cvs.php.net/cvs.php/pear/XMMS">PHP-XMMS</a> Demo. <a href="xmms.phps">Source</a> </font></tt> </body></html> Index: pear/PECL/xmms/tests/001.phpt +++ pear/PECL/xmms/tests/001.phpt --TEST-- Check for xmms presence --SKIPIF-- <?php if (!extension_loaded("xmms")) print "skip"; ?> --POST-- --GET-- --FILE-- <?php echo "xmms extension is available"; /* you can add regression tests for your extension here the output of your test code has to be equal to the text in the --EXPECT-- section below for the tests to pass, differences between the output and the expected text are interpreted as failure see php4/tests/README for further information on writing regression tests */ ?> --EXPECT-- xmms extension is available
« previous php.pear.cvs (#1492) next »