summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-02-13 22:38:13 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-02-13 22:38:13 +0000
commit730d21e8d85efea95614e8bd93703dd6d12bfd0f (patch)
tree8470c86400b2fd5be89264e23e4604bcab0b5000 /bin
parent9771ca37903c9188eba2a61876c2b17726f4aaa1 (diff)
downloadampache-730d21e8d85efea95614e8bd93703dd6d12bfd0f.tar.gz
ampache-730d21e8d85efea95614e8bd93703dd6d12bfd0f.tar.bz2
ampache-730d21e8d85efea95614e8bd93703dd6d12bfd0f.zip
removed dead file, updated bin files, removed debug and added a new config option
Diffstat (limited to 'bin')
-rw-r--r--bin/catalog_update.php.inc2
-rw-r--r--bin/compare_config.php.inc2
-rw-r--r--bin/delete_disabled.php.inc2
-rw-r--r--bin/dump_album_art.php.inc3
-rw-r--r--bin/parse_m3u.php.inc2
-rwxr-xr-xbin/print_amazon.php.inc2
-rw-r--r--bin/print_tags.php.inc3
-rw-r--r--bin/quarantine_migration.php.inc192
-rw-r--r--bin/sort_files.php.inc2
-rw-r--r--bin/write_playlists.php.inc2
-rw-r--r--bin/write_tags.php.inc2
11 files changed, 11 insertions, 203 deletions
diff --git a/bin/catalog_update.php.inc b/bin/catalog_update.php.inc
index 16dff65e..0c4a03ec 100644
--- a/bin/catalog_update.php.inc
+++ b/bin/catalog_update.php.inc
@@ -20,7 +20,7 @@
*/
-$no_session='1';
+define('NO_SESSION','1');
require ('../lib/init.php');
echo "[catalog_update.php.inc]\nStarting Catalog Clean/Update And Add\n\n";
diff --git a/bin/compare_config.php.inc b/bin/compare_config.php.inc
index 991613e5..04c92540 100644
--- a/bin/compare_config.php.inc
+++ b/bin/compare_config.php.inc
@@ -20,7 +20,7 @@
*/
-$no_session = '1';
+define('NO_SESSION','1');
require ('../lib/init.php');
require ('../lib/debug.lib.php');
diff --git a/bin/delete_disabled.php.inc b/bin/delete_disabled.php.inc
index 0c163a17..769a5506 100644
--- a/bin/delete_disabled.php.inc
+++ b/bin/delete_disabled.php.inc
@@ -29,7 +29,7 @@
$debug = true;
-$no_session = '1';
+define('NO_SESSION','1');
require ("../lib/init.php");
/* Get a list of filenames */
diff --git a/bin/dump_album_art.php.inc b/bin/dump_album_art.php.inc
index bb64492f..75ddea61 100644
--- a/bin/dump_album_art.php.inc
+++ b/bin/dump_album_art.php.inc
@@ -19,8 +19,7 @@
*/
-
-$no_session = '1';
+define('NO_SESSION','1');
require ("../lib/init.php");
$catalogs = Catalog::get_catalogs();
diff --git a/bin/parse_m3u.php.inc b/bin/parse_m3u.php.inc
index 71c5c2f4..c7cafa87 100644
--- a/bin/parse_m3u.php.inc
+++ b/bin/parse_m3u.php.inc
@@ -22,7 +22,7 @@
$filename = "/data/music/Live/L/Life'll Kill Ya/Warren Zevon.m3u";
-$no_session = '1';
+define('NO_SESSION','1');
require ("../lib/init.php");
$handle = fopen($filename,'r');
diff --git a/bin/print_amazon.php.inc b/bin/print_amazon.php.inc
index 32f864b2..d2bee2a9 100755
--- a/bin/print_amazon.php.inc
+++ b/bin/print_amazon.php.inc
@@ -24,7 +24,7 @@ $search['artist_name'] = "Bent";
-$no_session = '1';
+define('NO_SESSION','1');
require ("../lib/init.php");
echo "<pre>\n";
$amazon = new AmazonSearch(conf('amazon_developer_key'));
diff --git a/bin/print_tags.php.inc b/bin/print_tags.php.inc
index bba74bac..5637d19d 100644
--- a/bin/print_tags.php.inc
+++ b/bin/print_tags.php.inc
@@ -19,7 +19,8 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-$no_session = '1';
+
+define('NO_SESSION','1');
require ("../lib/init.php");
if (count($GLOBALS['argv']) == '1') { $filename = usage(); }
diff --git a/bin/quarantine_migration.php.inc b/bin/quarantine_migration.php.inc
deleted file mode 100644
index ee62fd47..00000000
--- a/bin/quarantine_migration.php.inc
+++ /dev/null
@@ -1,192 +0,0 @@
-<?php
-/*
-
- Copyright 2001 - 2006 Ampache.org
- All Rights Reserved
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
- created by RosenSama 2005
-
- call: php quarantine_migration.php
-*/
-
-$no_session='1';
-require_once('../lib/init.php');
-
-init_preferences();
-
-usage();
-
-/* Check if they want to force delete */
-$force_delete = $GLOBALS['argv']['1'];
-
-// grab list of files from table
-$sql = "SELECT id, file, user,action FROM upload WHERE action != 'quarantine'";
-$db_results = mysql_query($sql, dbh());
-
-$files = array();
-$files['add'] = array();
-$files['delete'] = array();
-
-while ($results = mysql_fetch_assoc($db_results)) {
-
- $action = $results['action'];
-
- $files[$action][] = $results;
-
-} // end while
-
-/* Make sure we have write access to the upload dir */
-$upload_dir = conf('upload_dir');
-
-if (!$upload_dir) {
- echo "\nError: No Upload Directory Defined\n";
- exit;
-}
-
-if (!@is_writeable($upload_dir)) {
- echo "\n" . _('Error: Unable to write to') . " $upload_dir ". "\n";
- exit;
-}
-
-$catalog_id = find_upload_catalog($upload_dir);
-
-if (!$catalog_id) {
- cli_out(_("Error: Upload directory not inside a catalog"));
- exit;
-} // we must have a valid upload dir
-
-$catalog = new Catalog($catalog_id);
-
-/* Itterate through the files we need to move */
-foreach ($files['add'] as $data) {
-
- /* Make sure that the target filename doesn't exist */
- $target_file = $upload_dir . "/" . basename($data['file']);
-
- if (file_exists($target_file)) {
- echo 'Error: File Exists';
- debug_event('file_exists','Error: $target_file already exist','1');
- continue;
- }
-
- $results = copy($data['file'],$target_file);
- if (!$results) { echo "Error: Unable to copy " . $data['file'] . " skipping...\n"; continue; }
-
- /* Check the filesize to make sure it copied */
- $new_sum = filesize($target_file);
- $old_sum = filesize($data['file']);
-
- if ($new_sum != $old_sum || !$new_sum) {
- echo "Error: Size Inconsistency, not deleting " . $data['file'] . "\n";
- continue;
- }
-
- $results = unlink($data['file']);
- if (!$results AND !$force_delete) { echo "Error: Unable to delete " . $data['file'] . "\n";}
- elseif (!$results) {
- echo "Error: Unable to delete " . $data['file'] . "\n";
- echo "Force Delete enabled, removing from Database...\n";
- $sql = "DELETE FROM upload WHERE id='" . $data['id'] . "'";
- $db_results = mysql_query($sql, dbh());
- } // if not able to unlike
- else {
- echo _('Adding') . " " . $target_file . " " . _('to database') . "\n";
-
- $catalog->add_file($target_file);
-
- /* Remove it from the catalog */
- $sql = "DELETE FROM upload WHERE id='" . $data['id'] . "'";
- $db_results = mysql_query($sql, dbh());
- }
-
-} // end foreach
-
-/* Itterate through the files we need to delete */
-foreach ($files['delete'] as $data) {
-
- $results = unlink($data['file']);
- if (!$results) { echo "Error: Unable to Delete File: " . $data['file'] . "\n"; }
- else {
- echo _('Deleted') . " " . $data['file'] . "\n";
- $sql = "DELETE FROM upload WHERE id='" . $data['id'] . "'";
- $db_results = mysql_query($sql, dbh());
- }
-
-} // end foreach
-
-exit();
-
-/*!
- @function usage()
- @discussion echo the help for this script
-*/
-
-function usage( ) {
- $text = _( "
-
-************* WARNING *************
-This script will move, and
-potentially delete uploaded files.
-************* WARNING *************
-
-All files marked for add will be moved to the upload directory. All files
-marked for deletion will be deleted. This script must be run as a user with
-sufficient rights to perform the above two functions.
-
- \n" );
- echo $text;
-
- $text = _( "Continue? (Y/N):" );
- echo $text;
-
- // grab a character ignoring whitespace
- do {
- $input= fgetc( STDIN );
- } while ( trim( $input ) == '' );
-
- if(strcasecmp($input,"y") != 0 ) {
- echo "\nExiting...\n";
- exit;
- }
-} // usage()
-
-/*!
- @function cli_out()
- @discussion util for error formatting
- @param $text the message to be output
- @param $mode to STDERR (0) or STDOUT (1, default)
-*/
-
-function cli_out( $text, $mode = 1 ) {
- switch( $mode ) {
- case 0:
- $dest = STDERR;
- $pre = _( "Error: " );
- $post = _( "!\n" );
- break;
- case 1:
- default:
- $dest = STDOUT;
- $pre = "";
- $post = "\n";
- }
- fwrite( $dest, $pre . $text . $post );
-} // error_out
-
-
-
-?>
diff --git a/bin/sort_files.php.inc b/bin/sort_files.php.inc
index 909c0ffa..7126af45 100644
--- a/bin/sort_files.php.inc
+++ b/bin/sort_files.php.inc
@@ -37,7 +37,7 @@
/* m(__)m */
$alphabet_prefix = true;
-$no_session = '1';
+define('NO_SESSION','1');
require ("../lib/init.php");
/* First Clean the catalog to we don't try to write anything we shouldn't */
diff --git a/bin/write_playlists.php.inc b/bin/write_playlists.php.inc
index 40e803ec..62c3ed96 100644
--- a/bin/write_playlists.php.inc
+++ b/bin/write_playlists.php.inc
@@ -26,7 +26,7 @@
* be especially important when trying to keep a clean file structure.
*/
-$no_session = '1';
+define('NO_SESSION','1');
require ("../lib/init.php");
diff --git a/bin/write_tags.php.inc b/bin/write_tags.php.inc
index 8f9279da..5f1445a0 100644
--- a/bin/write_tags.php.inc
+++ b/bin/write_tags.php.inc
@@ -26,7 +26,7 @@
* be especially important when trying to keep a clean file structure.
*/
-$no_session = '1';
+define('NO_SESSION','1');
require ("../lib/init.php");
// Include getID3 libs, including the ability to write tags