# HG changeset patch # User Dan # Date 1206328626 14400 # Node ID 3ba432f8390b437c701dd4d0c9e3e0bfbb8f7861 # Parent 5f35ebc4f9bb21174718ebf58654b969183e4d54 Modified to fit Amarok script specifications. diff -r 5f35ebc4f9bb -r 3ba432f8390b greyhound.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/greyhound.php Sun Mar 23 23:17:06 2008 -0400 @@ -0,0 +1,87 @@ +#!/usr/bin/env php +template_dir = "./themes/$theme"; +$smarty->compile_dir = "./themes/$theme/compiled"; +$smarty->cache_dir = "./cache"; +$smarty->config_dir = "./config"; + +status('doing home directory detection'); + +// get home directory + +if ( !isset($_ENV['HOME']) ) +{ + burnout('Could not get your home directory'); +} + +$homedir =& $_ENV['HOME']; + +status('initializing playlist'); + +// init playlist object +$playlist = array(); +rebuild_playlist(); + +// startup webserver +$ip = ( $public ) ? '0.0.0.0' : '127.0.0.1'; +$port = 7447; + +try +{ + status('starting PhpHttpd'); + $httpd = new WebServer($ip, $port); + + // setup handlers + status('initializing handlers'); + $httpd->add_handler('index', 'function', 'amarok_playlist'); + $httpd->add_handler('action.json', 'function', 'ajax_request_handler'); + $httpd->add_handler('scripts', 'dir', './scripts'); + $httpd->add_handler('favicon.ico', 'file', './amarok_icon.ico'); + $httpd->add_handler('apple-touch-icon.png', 'file', './apple-touch-icon.png'); + $httpd->add_handler("themes/$theme", 'dir', "./themes/$theme"); + $httpd->allow_dir_list = true; + $httpd->default_document = 'index'; + + status("Entering main server loop - ^C to interrupt, listening on port $port"); + $httpd->serve(); +} +catch( Exception $e ) +{ + burnout("Exception caught while running webserver:\n$e"); +} + diff -r 5f35ebc4f9bb -r 3ba432f8390b greyhound.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/greyhound.spec Sun Mar 23 23:17:06 2008 -0400 @@ -0,0 +1,2 @@ +name = Greyhound web interface +type = generic diff -r 5f35ebc4f9bb -r 3ba432f8390b webcontrol.php --- a/webcontrol.php Sun Mar 23 23:11:56 2008 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -#!/usr/bin/env php -template_dir = "./themes/$theme"; -$smarty->compile_dir = "./themes/$theme/compiled"; -$smarty->cache_dir = "./cache"; -$smarty->config_dir = "./config"; - -status('doing home directory detection'); - -// get home directory - -if ( !isset($_ENV['HOME']) ) -{ - burnout('Could not get your home directory'); -} - -$homedir =& $_ENV['HOME']; - -status('initializing playlist'); - -// init playlist object -$playlist = array(); -rebuild_playlist(); - -// startup webserver -$ip = ( $public ) ? '0.0.0.0' : '127.0.0.1'; -$port = 7447; - -try -{ - status('starting PhpHttpd'); - $httpd = new WebServer($ip, $port); - - // setup handlers - status('initializing handlers'); - $httpd->add_handler('index', 'function', 'amarok_playlist'); - $httpd->add_handler('action.json', 'function', 'ajax_request_handler'); - $httpd->add_handler('scripts', 'dir', './scripts'); - $httpd->add_handler('favicon.ico', 'file', './amarok_icon.ico'); - $httpd->add_handler('apple-touch-icon.png', 'file', './apple-touch-icon.png'); - $httpd->add_handler("themes/$theme", 'dir', "./themes/$theme"); - $httpd->allow_dir_list = true; - $httpd->default_document = 'index'; - - status("Entering main server loop - ^C to interrupt, listening on port $port"); - $httpd->serve(); -} -catch( Exception $e ) -{ - burnout("Exception caught while running webserver:\n$e"); -} -