Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shamess@ip-10-227-50-28:/var/www-shamess/soundtiger$ cat install/installed-state.php
- <?php
- /**
- * Removes all data, and givest he user a clean "just installed" state.
- */
- require ('includes/notextinc.php');
- echo "Starting to remove all data...\n";
- // just remove everything.
- $Database->query ("DELETE FROM `album`");
- echo "Removed albums.\n";
- $Database->query ("DELETE FROM `artist`");
- echo "Removed artists.\n";
- $Database->query ("DELETE FROM `playlist`");
- echo "Removed playlist.\n";
- $Database->query ("DELETE FROM `playlist_track`");
- echo "Removed playlist_track.\n";
- $Database->query ("DELETE FROM `track`");
- echo "Removed track.\n";
- $Database->query ("DELETE FROM `user`");
- echo "Removed users.\n";
- echo "Done deletions.\n";
- // Now add a new user if we've been given a username and password argument
- if (!is_empty ($argv[1], $argv[2])) {
- $Database->query ("INSERT INTO `user` SET `username` = '".$argv[1]."', `password` = '".User::password_hash ($argv[2])."'");
- echo "Added user (".$argv[1].") with password (".$argv[2].").\n";
- }
- echo "Done.\n";
- exit (0);
- ?>
- shamess@ip-10-227-50-28:/var/www-shamess/soundtiger$ php -f install/installed-state.php
- Starting to remove all data...
- Removed albums.
- Removed artists.
- Removed playlist.
- Removed playlist_track.
- Removed track.
- Removed users.
- Done deletions.
- Done.
- shamess@ip-10-227-50-28:/var/www-shamess/soundtiger/install$ php -f installed-state.php
- PHP Warning: require(includes/notextinc.php): failed to open stream: No such file or directory in /var/www-shamess/soundtiger/install/installed-state.php on line 7
- PHP Fatal error: require(): Failed opening required 'includes/notextinc.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www-shamess/soundtiger/install/installed-state.php on line 7
Add Comment
Please, Sign In to add comment