mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-03 09:49:30 +02:00
Consistently use _ in two-word class names
This commit is contained in:
parent
7ea41a0029
commit
9c28ed5ad1
12 changed files with 90 additions and 90 deletions
|
@ -43,7 +43,7 @@ switch ($_REQUEST['action']) {
|
|||
mb_language("uni");
|
||||
}
|
||||
|
||||
$mailer = new AmpacheMail();
|
||||
$mailer = new Ampache_Mail();
|
||||
|
||||
// Set the vars on the object
|
||||
$mailer->subject = $_REQUEST['subject'];
|
||||
|
|
|
@ -21,12 +21,12 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* AmpacheMail Class
|
||||
* Ampache_Mail Class
|
||||
*
|
||||
* This class handles the Mail
|
||||
*
|
||||
*/
|
||||
class AmpacheMail {
|
||||
class Ampache_Mail {
|
||||
|
||||
// The message, recipient and from
|
||||
public $message;
|
||||
|
@ -210,5 +210,5 @@ class AmpacheMail {
|
|||
return $this->send($mail);
|
||||
}
|
||||
|
||||
} // AmpacheMail class
|
||||
} // Ampache_Mail class
|
||||
?>
|
|
@ -22,10 +22,10 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* AmpacheRSS Class
|
||||
* Ampache_RSS Class
|
||||
*
|
||||
*/
|
||||
class AmpacheRSS {
|
||||
class Ampache_RSS {
|
||||
|
||||
private $type;
|
||||
public $data;
|
||||
|
@ -51,11 +51,11 @@ class AmpacheRSS {
|
|||
$data_function = 'load_' . $this->type;
|
||||
$pub_date_function = 'pubdate_' . $this->type;
|
||||
|
||||
$data = call_user_func(array('AmpacheRSS',$data_function));
|
||||
$pub_date = call_user_func(array('AmpacheRSS',$pub_date_function));
|
||||
$data = call_user_func(array('Ampache_RSS',$data_function));
|
||||
$pub_date = call_user_func(array('Ampache_RSS',$pub_date_function));
|
||||
|
||||
xmlData::set_type('rss');
|
||||
$xml_document = xmlData::rss_feed($data,$this->get_title(),$this->get_description(),$pub_date);
|
||||
XML_Data::set_type('rss');
|
||||
$xml_document = XML_Data::rss_feed($data,$this->get_title(),$this->get_description(),$pub_date);
|
||||
|
||||
return $xml_document;
|
||||
|
||||
|
@ -250,4 +250,4 @@ class AmpacheRSS {
|
|||
|
||||
} // pubdate_recently_played
|
||||
|
||||
} // end AmpacheRSS class
|
||||
} // end Ampache_RSS class
|
|
@ -204,7 +204,7 @@ class Api {
|
|||
$db_results = Dba::read($sql);
|
||||
$catalog = Dba::fetch_assoc($db_results);
|
||||
|
||||
echo xmlData::keyed_array(array('auth'=>$token,
|
||||
echo XML_Data::keyed_array(array('auth'=>$token,
|
||||
'api'=>self::$version,
|
||||
'session_expire'=>date("c",time()+Config::get('session_length')-60),
|
||||
'update'=>date("c",$row['update']),
|
||||
|
@ -222,7 +222,7 @@ class Api {
|
|||
} // end while
|
||||
|
||||
debug_event('API','Login Failed, unable to match passphrase','1');
|
||||
xmlData::error('401', T_('Error Invalid Handshake - ') . T_('Invalid Username/Password'));
|
||||
XML_Data::error('401', T_('Error Invalid Handshake - ') . T_('Invalid Username/Password'));
|
||||
|
||||
} // handshake
|
||||
|
||||
|
@ -244,7 +244,7 @@ class Api {
|
|||
debug_event('API','Ping Received from ' . $_SERVER['REMOTE_ADDR'] . ' :: ' . $input['auth'],'5');
|
||||
|
||||
ob_end_clean();
|
||||
echo xmlData::keyed_array($xmldata);
|
||||
echo XML_Data::keyed_array($xmldata);
|
||||
|
||||
} // ping
|
||||
|
||||
|
@ -266,13 +266,13 @@ class Api {
|
|||
Api::set_filter('update',$input['update']);
|
||||
|
||||
// Set the offset
|
||||
xmlData::set_offset($input['offset']);
|
||||
xmlData::set_limit($input['limit']);
|
||||
XML_Data::set_offset($input['offset']);
|
||||
XML_Data::set_limit($input['limit']);
|
||||
|
||||
$artists = self::$browse->get_objects();
|
||||
// echo out the resulting xml document
|
||||
ob_end_clean();
|
||||
echo xmlData::artists($artists);
|
||||
echo XML_Data::artists($artists);
|
||||
|
||||
} // artists
|
||||
|
||||
|
@ -284,7 +284,7 @@ class Api {
|
|||
public static function artist($input) {
|
||||
|
||||
$uid = scrub_in($input['filter']);
|
||||
echo xmlData::artists(array($uid));
|
||||
echo XML_Data::artists(array($uid));
|
||||
|
||||
} // artist
|
||||
|
||||
|
@ -299,10 +299,10 @@ class Api {
|
|||
$albums = $artist->get_albums();
|
||||
|
||||
// Set the offset
|
||||
xmlData::set_offset($input['offset']);
|
||||
xmlData::set_limit($input['limit']);
|
||||
XML_Data::set_offset($input['offset']);
|
||||
XML_Data::set_limit($input['limit']);
|
||||
ob_end_clean();
|
||||
echo xmlData::albums($albums);
|
||||
echo XML_Data::albums($albums);
|
||||
|
||||
} // artist_albums
|
||||
|
||||
|
@ -316,10 +316,10 @@ class Api {
|
|||
$songs = $artist->get_songs();
|
||||
|
||||
// Set the offset
|
||||
xmlData::set_offset($input['offset']);
|
||||
xmlData::set_limit($input['limit']);
|
||||
XML_Data::set_offset($input['offset']);
|
||||
XML_Data::set_limit($input['limit']);
|
||||
ob_end_clean();
|
||||
echo xmlData::songs($songs);
|
||||
echo XML_Data::songs($songs);
|
||||
|
||||
} // artist_songs
|
||||
|
||||
|
@ -340,10 +340,10 @@ class Api {
|
|||
$albums = self::$browse->get_objects();
|
||||
|
||||
// Set the offset
|
||||
xmlData::set_offset($input['offset']);
|
||||
xmlData::set_limit($input['limit']);
|
||||
XML_Data::set_offset($input['offset']);
|
||||
XML_Data::set_limit($input['limit']);
|
||||
ob_end_clean();
|
||||
echo xmlData::albums($albums);
|
||||
echo XML_Data::albums($albums);
|
||||
|
||||
} // albums
|
||||
|
||||
|
@ -354,7 +354,7 @@ class Api {
|
|||
public static function album($input) {
|
||||
|
||||
$uid = scrub_in($input['filter']);
|
||||
echo xmlData::albums(array($uid));
|
||||
echo XML_Data::albums(array($uid));
|
||||
|
||||
} // album
|
||||
|
||||
|
@ -368,11 +368,11 @@ class Api {
|
|||
$songs = $album->get_songs();
|
||||
|
||||
// Set the offset
|
||||
xmlData::set_offset($input['offset']);
|
||||
xmlData::set_limit($input['limit']);
|
||||
XML_Data::set_offset($input['offset']);
|
||||
XML_Data::set_limit($input['limit']);
|
||||
|
||||
ob_end_clean();
|
||||
echo xmlData::songs($songs);
|
||||
echo XML_Data::songs($songs);
|
||||
|
||||
} // album_songs
|
||||
|
||||
|
@ -391,11 +391,11 @@ class Api {
|
|||
$tags = self::$browse->get_objects();
|
||||
|
||||
// Set the offset
|
||||
xmlData::set_offset($input['offset']);
|
||||
xmlData::set_limit($input['limit']);
|
||||
XML_Data::set_offset($input['offset']);
|
||||
XML_Data::set_limit($input['limit']);
|
||||
|
||||
ob_end_clean();
|
||||
echo xmlData::tags($tags);
|
||||
echo XML_Data::tags($tags);
|
||||
|
||||
} // tags
|
||||
|
||||
|
@ -407,7 +407,7 @@ class Api {
|
|||
|
||||
$uid = scrub_in($input['filter']);
|
||||
ob_end_clean();
|
||||
echo xmlData::tags(array($uid));
|
||||
echo XML_Data::tags(array($uid));
|
||||
|
||||
} // tag
|
||||
|
||||
|
@ -419,11 +419,11 @@ class Api {
|
|||
|
||||
$artists = Tag::get_tag_objects('artist',$input['filter']);
|
||||
|
||||
xmlData::set_offset($input['offset']);
|
||||
xmlData::set_limit($input['limit']);
|
||||
XML_Data::set_offset($input['offset']);
|
||||
XML_Data::set_limit($input['limit']);
|
||||
|
||||
ob_end_clean();
|
||||
echo xmlData::artists($artists);
|
||||
echo XML_Data::artists($artists);
|
||||
|
||||
} // tag_artists
|
||||
|
||||
|
@ -435,11 +435,11 @@ class Api {
|
|||
|
||||
$albums = Tag::get_tag_objects('album',$input['filter']);
|
||||
|
||||
xmlData::set_offset($input['offset']);
|
||||
xmlData::set_limit($input['limit']);
|
||||
XML_Data::set_offset($input['offset']);
|
||||
XML_Data::set_limit($input['limit']);
|
||||
|
||||
ob_end_clean();
|
||||
echo xmlData::albums($albums);
|
||||
echo XML_Data::albums($albums);
|
||||
|
||||
} // tag_albums
|
||||
|
||||
|
@ -451,11 +451,11 @@ class Api {
|
|||
|
||||
$songs = Tag::get_tag_objects('song',$input['filter']);
|
||||
|
||||
xmlData::set_offset($input['offset']);
|
||||
xmlData::set_limit($input['limit']);
|
||||
XML_Data::set_offset($input['offset']);
|
||||
XML_Data::set_limit($input['limit']);
|
||||
|
||||
ob_end_clean();
|
||||
echo xmlData::songs($songs);
|
||||
echo XML_Data::songs($songs);
|
||||
|
||||
} // tag_songs
|
||||
|
||||
|
@ -477,11 +477,11 @@ class Api {
|
|||
$songs = self::$browse->get_objects();
|
||||
|
||||
// Set the offset
|
||||
xmlData::set_offset($input['offset']);
|
||||
xmlData::set_limit($input['limit']);
|
||||
XML_Data::set_offset($input['offset']);
|
||||
XML_Data::set_limit($input['limit']);
|
||||
|
||||
ob_end_clean();
|
||||
echo xmlData::songs($songs);
|
||||
echo XML_Data::songs($songs);
|
||||
|
||||
} // songs
|
||||
|
||||
|
@ -494,7 +494,7 @@ class Api {
|
|||
$uid = scrub_in($input['filter']);
|
||||
|
||||
ob_end_clean();
|
||||
echo xmlData::songs(array($uid));
|
||||
echo XML_Data::songs(array($uid));
|
||||
|
||||
} // song
|
||||
|
||||
|
@ -508,7 +508,7 @@ class Api {
|
|||
$song_id = Song::parse_song_url($input['url']);
|
||||
|
||||
ob_end_clean();
|
||||
echo xmlData::songs(array($song_id));
|
||||
echo XML_Data::songs(array($song_id));
|
||||
|
||||
} // url_to_song
|
||||
|
||||
|
@ -527,11 +527,11 @@ class Api {
|
|||
|
||||
$playlist_ids = self::$browse->get_objects();
|
||||
|
||||
xmlData::set_offset($input['offset']);
|
||||
xmlData::set_limit($input['limit']);
|
||||
XML_Data::set_offset($input['offset']);
|
||||
XML_Data::set_limit($input['limit']);
|
||||
|
||||
ob_end_clean();
|
||||
echo xmlData::playlists($playlist_ids);
|
||||
echo XML_Data::playlists($playlist_ids);
|
||||
|
||||
} // playlists
|
||||
|
||||
|
@ -544,7 +544,7 @@ class Api {
|
|||
$uid = scrub_in($input['filter']);
|
||||
|
||||
ob_end_clean();
|
||||
echo xmlData::playlists(array($uid));
|
||||
echo XML_Data::playlists(array($uid));
|
||||
|
||||
} // playlist
|
||||
|
||||
|
@ -563,10 +563,10 @@ class Api {
|
|||
}
|
||||
} // end foreach
|
||||
|
||||
xmlData::set_offset($input['offset']);
|
||||
xmlData::set_limit($input['limit']);
|
||||
XML_Data::set_offset($input['offset']);
|
||||
XML_Data::set_limit($input['limit']);
|
||||
ob_end_clean();
|
||||
echo xmlData::songs($songs);
|
||||
echo XML_Data::songs($songs);
|
||||
|
||||
} // playlist_songs
|
||||
|
||||
|
@ -582,12 +582,12 @@ class Api {
|
|||
|
||||
ob_end_clean();
|
||||
|
||||
xmlData::set_offset($input['offset']);
|
||||
xmlData::set_limit($input['limit']);
|
||||
XML_Data::set_offset($input['offset']);
|
||||
XML_Data::set_limit($input['limit']);
|
||||
|
||||
$results = Search::run($array);
|
||||
|
||||
echo xmlData::songs($results);
|
||||
echo XML_Data::songs($results);
|
||||
|
||||
} // search_songs
|
||||
|
||||
|
@ -606,10 +606,10 @@ class Api {
|
|||
|
||||
$video_ids = self::$browse->get_objects();
|
||||
|
||||
xmlData::set_offset($input['offset']);
|
||||
xmlData::set_limit($input['limit']);
|
||||
XML_Data::set_offset($input['offset']);
|
||||
XML_Data::set_limit($input['limit']);
|
||||
|
||||
echo xmlData::videos($video_ids);
|
||||
echo XML_Data::videos($video_ids);
|
||||
|
||||
} // videos
|
||||
|
||||
|
@ -621,7 +621,7 @@ class Api {
|
|||
|
||||
$video_id = scrub_in($input['filter']);
|
||||
|
||||
echo xmlData::videos(array($video_id));
|
||||
echo XML_Data::videos(array($video_id));
|
||||
|
||||
|
||||
} // video
|
||||
|
@ -643,11 +643,11 @@ class Api {
|
|||
case 'stop':
|
||||
$result_status = $localplay->$input['command']();
|
||||
$xml_array = array('localplay'=>array('command'=>array($input['command']=>make_bool($result_status))));
|
||||
echo xmlData::keyed_array($xml_array);
|
||||
echo XML_Data::keyed_array($xml_array);
|
||||
break;
|
||||
default:
|
||||
// They are doing it wrong
|
||||
echo xmlData::error('405', T_('Invalid Request'));
|
||||
echo XML_Data::error('405', T_('Invalid Request'));
|
||||
break;
|
||||
} // end switch on command
|
||||
|
||||
|
@ -668,7 +668,7 @@ class Api {
|
|||
$type = 'song';
|
||||
$media = new $type($input['oid']);
|
||||
if (!$media->id) {
|
||||
echo xmlData::error('400', T_('Media Object Invalid or Not Specified'));
|
||||
echo XML_Data::error('400', T_('Media Object Invalid or Not Specified'));
|
||||
break;
|
||||
}
|
||||
$democratic->add_vote(array(
|
||||
|
@ -680,13 +680,13 @@ class Api {
|
|||
|
||||
// If everything was ok
|
||||
$xml_array = array('action'=>$input['action'],'method'=>$input['method'],'result'=>true);
|
||||
echo xmlData::keyed_array($xml_array);
|
||||
echo XML_Data::keyed_array($xml_array);
|
||||
break;
|
||||
case 'devote':
|
||||
$type = 'song';
|
||||
$media = new $type($input['oid']);
|
||||
if (!$media->id) {
|
||||
echo xmlData::error('400', T_('Media Object Invalid or Not Specified'));
|
||||
echo XML_Data::error('400', T_('Media Object Invalid or Not Specified'));
|
||||
}
|
||||
|
||||
$uid = $democratic->get_uid_from_object_id($media->id,$type);
|
||||
|
@ -694,21 +694,21 @@ class Api {
|
|||
|
||||
// Everything was ok
|
||||
$xml_array = array('action'=>$input['action'],'method'=>$input['method'],'result'=>true);
|
||||
echo xmlData::keyed_array($xml_array);
|
||||
echo XML_Data::keyed_array($xml_array);
|
||||
break;
|
||||
case 'playlist':
|
||||
$objects = $democratic->get_items();
|
||||
Song::build_cache($democratic->object_ids);
|
||||
Democratic::build_vote_cache($democratic->vote_ids);
|
||||
xmlData::democratic($objects);
|
||||
XML_Data::democratic($objects);
|
||||
break;
|
||||
case 'play':
|
||||
$url = $democratic->play_url();
|
||||
$xml_array = array('url'=>$url);
|
||||
echo xmlData::keyed_array($xml_array);
|
||||
echo XML_Data::keyed_array($xml_array);
|
||||
break;
|
||||
default:
|
||||
echo xmlData::error('405', T_('Invalid Request'));
|
||||
echo XML_Data::error('405', T_('Invalid Request'));
|
||||
break;
|
||||
} // switch on method
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ class Registration {
|
|||
* This sends the confirmation e-mail for the specified user
|
||||
*/
|
||||
public static function send_confirmation($username, $fullname, $email, $password, $validation) {
|
||||
$mailer = new AmpacheMail();
|
||||
$mailer = new Ampache_Mail();
|
||||
|
||||
// We are the system
|
||||
$mailer->set_default_sender();
|
||||
|
|
|
@ -338,14 +338,14 @@ class Stream_Playlist {
|
|||
$xml['track']['album'] = $url->album;
|
||||
}
|
||||
|
||||
$result .= xmlData::keyed_array($xml, true);
|
||||
$result .= XML_Data::keyed_array($xml, true);
|
||||
|
||||
} // end foreach
|
||||
|
||||
xmlData::set_type('xspf');
|
||||
echo xmlData::header();
|
||||
XML_Data::set_type('xspf');
|
||||
echo XML_Data::header();
|
||||
echo $result;
|
||||
echo xmlData::footer();
|
||||
echo XML_Data::footer();
|
||||
|
||||
} // create_xspf
|
||||
|
||||
|
|
|
@ -22,13 +22,13 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* xmlData Class
|
||||
* XML_Data Class
|
||||
*
|
||||
* This class takes care of all of the xml document stuff in Ampache these
|
||||
* are all static calls
|
||||
*
|
||||
*/
|
||||
class xmlData {
|
||||
class XML_Data {
|
||||
|
||||
// This is added so that we don't pop any webservers
|
||||
private static $limit = '5000';
|
||||
|
@ -81,9 +81,9 @@ class xmlData {
|
|||
/**
|
||||
* set_type
|
||||
*
|
||||
* This sets the type of xmlData we are working on
|
||||
* This sets the type of XML_Data we are working on
|
||||
*
|
||||
* @param string $type xmlData type
|
||||
* @param string $type XML_Data type
|
||||
* @return void
|
||||
*/
|
||||
public static function set_type($type) {
|
||||
|
@ -654,6 +654,6 @@ class xmlData {
|
|||
|
||||
} // _footer
|
||||
|
||||
} // xmlData
|
||||
} // XML_Data
|
||||
|
||||
?>
|
|
@ -54,7 +54,7 @@ function send_newpassword($email,$current_ip){
|
|||
$newpassword = generate_password(6);
|
||||
$client->update_password($newpassword);
|
||||
|
||||
$mailer = new AmpacheMail();
|
||||
$mailer = new Ampache_Mail();
|
||||
$mailer->set_default_sender();
|
||||
$mailer->subject = T_("Lost Password");
|
||||
$mailer->recipient_name = $client->fullname;
|
||||
|
|
2
rss.php
2
rss.php
|
@ -32,7 +32,7 @@ if (!Config::get('use_rss') || Config::get('demo_mode')) {
|
|||
// Add in our base hearder defining the content type
|
||||
header("Content-Type: application/xml; charset=" . Config::get('site_charset'));
|
||||
|
||||
$rss = new AmpacheRSS($_REQUEST['type']);
|
||||
$rss = new Ampache_RSS($_REQUEST['type']);
|
||||
echo $rss->get_xml();
|
||||
|
||||
?>
|
||||
|
|
|
@ -40,7 +40,7 @@ header("Content-Disposition: attachment; filename=information.xml");
|
|||
if (!Config::get('access_control')) {
|
||||
ob_end_clean();
|
||||
debug_event('Access Control','Error Attempted to use XML API with Access Control turned off','3');
|
||||
echo xmlData::error('501', T_('Access Control not Enabled'));
|
||||
echo XML_Data::error('501', T_('Access Control not Enabled'));
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ if (!Config::get('access_control')) {
|
|||
if (!vauth::session_exists('api', $_REQUEST['auth']) AND $_REQUEST['action'] != 'handshake' AND $_REQUEST['action'] != 'ping') {
|
||||
debug_event('Access Denied','Invalid Session attempt to API [' . $_REQUEST['action'] . ']','3');
|
||||
ob_end_clean();
|
||||
echo xmlData::error('401', T_('Session Expired'));
|
||||
echo XML_Data::error('401', T_('Session Expired'));
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ $username = ($_REQUEST['action'] == 'handshake' || $_REQUEST['action'] == 'ping'
|
|||
if (!Access::check_network('init-api',$username,'5')) {
|
||||
debug_event('Access Denied','Unauthorized access attempt to API [' . $_SERVER['REMOTE_ADDR'] . ']', '3');
|
||||
ob_end_clean();
|
||||
echo xmlData::error('403', T_('Unauthorized access attempt to API - ACL Error'));
|
||||
echo XML_Data::error('403', T_('Unauthorized access attempt to API - ACL Error'));
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -93,4 +93,4 @@ foreach ($methods as $method) {
|
|||
|
||||
// If we manage to get here, we still need to hand out an XML document
|
||||
ob_end_clean();
|
||||
echo xmlData::error('405', T_('Invalid Request'));
|
||||
echo XML_Data::error('405', T_('Invalid Request'));
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
*/
|
||||
|
||||
if (count($results)) {
|
||||
$link = Config::get('use_rss') ? ' ' . AmpacheRSS::get_display('nowplaying') : '';
|
||||
$link = Config::get('use_rss') ? ' ' . Ampache_RSS::get_display('nowplaying') : '';
|
||||
?>
|
||||
<?php show_box_top(T_('Now Playing') . $link); ?>
|
||||
<?php
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
$link = Config::get('use_rss') ? ' ' . AmpacheRSS::get_display('recently_played') : '';
|
||||
$link = Config::get('use_rss') ? ' ' . Ampache_RSS::get_display('recently_played') : '';
|
||||
show_box_top(T_('Recently Played') . $link, 'box box_recently_played');
|
||||
?>
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue