Robert Bieber | ac58d02 | 2010-07-05 20:38:04 +0000 | [diff] [blame] | 1 | #!/usr/bin/php -q |
| 2 | <?php |
| 3 | /*************************************************************************** |
| 4 | * __________ __ ___. |
| 5 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 6 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 7 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 8 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 9 | * \/ \/ \/ \/ \/ |
| 10 | * $Id$ |
| 11 | * |
| 12 | * Copyright (C) 2010 Robert Bieber |
| 13 | * |
| 14 | * This program is free software; you can redistribute it and/or |
| 15 | * modify it under the terms of the GNU General Public License |
| 16 | * as published by the Free Software Foundation; either version 2 |
| 17 | * of the License, or (at your option) any later version. |
| 18 | * |
| 19 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 20 | * KIND, either express or implied. |
| 21 | * |
| 22 | ****************************************************************************/ |
| 23 | |
| 24 | if($argc < 2) |
| 25 | $path = getcwd(); |
| 26 | else |
| 27 | $path = $argv[1]; |
Robert Bieber | 27debea | 2010-07-05 20:42:08 +0000 | [diff] [blame] | 28 | $path = rtrim($path, "/"); |
Robert Bieber | ac58d02 | 2010-07-05 20:38:04 +0000 | [diff] [blame] | 29 | $dir = dir($path); |
| 30 | $split = explode("/", $path); |
Robert Bieber | 27debea | 2010-07-05 20:42:08 +0000 | [diff] [blame] | 31 | $last = $split[count($split) - 1]; |
Robert Bieber | ac58d02 | 2010-07-05 20:38:04 +0000 | [diff] [blame] | 32 | echo "\t<qresource prefix=\"/$last\">\n"; |
| 33 | while(false !== ($entry = $dir->read())) |
| 34 | { |
| 35 | if($entry == '.' || $entry == '..') |
| 36 | continue; |
| 37 | echo "\t\t"; |
| 38 | echo "<file alias = \"$entry\">"; |
Robert Bieber | 27debea | 2010-07-05 20:42:08 +0000 | [diff] [blame] | 39 | echo $path . '/' . $entry . "</file>"; |
Robert Bieber | ac58d02 | 2010-07-05 20:38:04 +0000 | [diff] [blame] | 40 | echo "\n"; |
| 41 | } |
| 42 | echo "\t</qresource>\n"; |
| 43 | $dir->close(); |
| 44 | |
| 45 | ?> |