1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-03 17:59:21 +02:00

Consistently use _ in two-word class names

This commit is contained in:
Paul Arthur 2013-01-25 19:54:11 -05:00
parent 7ea41a0029
commit 9c28ed5ad1
12 changed files with 90 additions and 90 deletions

View file

@ -43,7 +43,7 @@ switch ($_REQUEST['action']) {
mb_language("uni"); mb_language("uni");
} }
$mailer = new AmpacheMail(); $mailer = new Ampache_Mail();
// Set the vars on the object // Set the vars on the object
$mailer->subject = $_REQUEST['subject']; $mailer->subject = $_REQUEST['subject'];

View file

@ -21,12 +21,12 @@
*/ */
/** /**
* AmpacheMail Class * Ampache_Mail Class
* *
* This class handles the Mail * This class handles the Mail
* *
*/ */
class AmpacheMail { class Ampache_Mail {
// The message, recipient and from // The message, recipient and from
public $message; public $message;
@ -210,5 +210,5 @@ class AmpacheMail {
return $this->send($mail); return $this->send($mail);
} }
} // AmpacheMail class } // Ampache_Mail class
?> ?>

View file

@ -22,10 +22,10 @@
*/ */
/** /**
* AmpacheRSS Class * Ampache_RSS Class
* *
*/ */
class AmpacheRSS { class Ampache_RSS {
private $type; private $type;
public $data; public $data;
@ -51,11 +51,11 @@ class AmpacheRSS {
$data_function = 'load_' . $this->type; $data_function = 'load_' . $this->type;
$pub_date_function = 'pubdate_' . $this->type; $pub_date_function = 'pubdate_' . $this->type;
$data = call_user_func(array('AmpacheRSS',$data_function)); $data = call_user_func(array('Ampache_RSS',$data_function));
$pub_date = call_user_func(array('AmpacheRSS',$pub_date_function)); $pub_date = call_user_func(array('Ampache_RSS',$pub_date_function));
xmlData::set_type('rss'); XML_Data::set_type('rss');
$xml_document = xmlData::rss_feed($data,$this->get_title(),$this->get_description(),$pub_date); $xml_document = XML_Data::rss_feed($data,$this->get_title(),$this->get_description(),$pub_date);
return $xml_document; return $xml_document;
@ -250,4 +250,4 @@ class AmpacheRSS {
} // pubdate_recently_played } // pubdate_recently_played
} // end AmpacheRSS class } // end Ampache_RSS class

View file

@ -204,7 +204,7 @@ class Api {
$db_results = Dba::read($sql); $db_results = Dba::read($sql);
$catalog = Dba::fetch_assoc($db_results); $catalog = Dba::fetch_assoc($db_results);
echo xmlData::keyed_array(array('auth'=>$token, echo XML_Data::keyed_array(array('auth'=>$token,
'api'=>self::$version, 'api'=>self::$version,
'session_expire'=>date("c",time()+Config::get('session_length')-60), 'session_expire'=>date("c",time()+Config::get('session_length')-60),
'update'=>date("c",$row['update']), 'update'=>date("c",$row['update']),
@ -222,7 +222,7 @@ class Api {
} // end while } // end while
debug_event('API','Login Failed, unable to match passphrase','1'); 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 } // handshake
@ -244,7 +244,7 @@ class Api {
debug_event('API','Ping Received from ' . $_SERVER['REMOTE_ADDR'] . ' :: ' . $input['auth'],'5'); debug_event('API','Ping Received from ' . $_SERVER['REMOTE_ADDR'] . ' :: ' . $input['auth'],'5');
ob_end_clean(); ob_end_clean();
echo xmlData::keyed_array($xmldata); echo XML_Data::keyed_array($xmldata);
} // ping } // ping
@ -266,13 +266,13 @@ class Api {
Api::set_filter('update',$input['update']); Api::set_filter('update',$input['update']);
// Set the offset // Set the offset
xmlData::set_offset($input['offset']); XML_Data::set_offset($input['offset']);
xmlData::set_limit($input['limit']); XML_Data::set_limit($input['limit']);
$artists = self::$browse->get_objects(); $artists = self::$browse->get_objects();
// echo out the resulting xml document // echo out the resulting xml document
ob_end_clean(); ob_end_clean();
echo xmlData::artists($artists); echo XML_Data::artists($artists);
} // artists } // artists
@ -284,7 +284,7 @@ class Api {
public static function artist($input) { public static function artist($input) {
$uid = scrub_in($input['filter']); $uid = scrub_in($input['filter']);
echo xmlData::artists(array($uid)); echo XML_Data::artists(array($uid));
} // artist } // artist
@ -299,10 +299,10 @@ class Api {
$albums = $artist->get_albums(); $albums = $artist->get_albums();
// Set the offset // Set the offset
xmlData::set_offset($input['offset']); XML_Data::set_offset($input['offset']);
xmlData::set_limit($input['limit']); XML_Data::set_limit($input['limit']);
ob_end_clean(); ob_end_clean();
echo xmlData::albums($albums); echo XML_Data::albums($albums);
} // artist_albums } // artist_albums
@ -316,10 +316,10 @@ class Api {
$songs = $artist->get_songs(); $songs = $artist->get_songs();
// Set the offset // Set the offset
xmlData::set_offset($input['offset']); XML_Data::set_offset($input['offset']);
xmlData::set_limit($input['limit']); XML_Data::set_limit($input['limit']);
ob_end_clean(); ob_end_clean();
echo xmlData::songs($songs); echo XML_Data::songs($songs);
} // artist_songs } // artist_songs
@ -340,10 +340,10 @@ class Api {
$albums = self::$browse->get_objects(); $albums = self::$browse->get_objects();
// Set the offset // Set the offset
xmlData::set_offset($input['offset']); XML_Data::set_offset($input['offset']);
xmlData::set_limit($input['limit']); XML_Data::set_limit($input['limit']);
ob_end_clean(); ob_end_clean();
echo xmlData::albums($albums); echo XML_Data::albums($albums);
} // albums } // albums
@ -354,7 +354,7 @@ class Api {
public static function album($input) { public static function album($input) {
$uid = scrub_in($input['filter']); $uid = scrub_in($input['filter']);
echo xmlData::albums(array($uid)); echo XML_Data::albums(array($uid));
} // album } // album
@ -368,11 +368,11 @@ class Api {
$songs = $album->get_songs(); $songs = $album->get_songs();
// Set the offset // Set the offset
xmlData::set_offset($input['offset']); XML_Data::set_offset($input['offset']);
xmlData::set_limit($input['limit']); XML_Data::set_limit($input['limit']);
ob_end_clean(); ob_end_clean();
echo xmlData::songs($songs); echo XML_Data::songs($songs);
} // album_songs } // album_songs
@ -391,11 +391,11 @@ class Api {
$tags = self::$browse->get_objects(); $tags = self::$browse->get_objects();
// Set the offset // Set the offset
xmlData::set_offset($input['offset']); XML_Data::set_offset($input['offset']);
xmlData::set_limit($input['limit']); XML_Data::set_limit($input['limit']);
ob_end_clean(); ob_end_clean();
echo xmlData::tags($tags); echo XML_Data::tags($tags);
} // tags } // tags
@ -407,7 +407,7 @@ class Api {
$uid = scrub_in($input['filter']); $uid = scrub_in($input['filter']);
ob_end_clean(); ob_end_clean();
echo xmlData::tags(array($uid)); echo XML_Data::tags(array($uid));
} // tag } // tag
@ -419,11 +419,11 @@ class Api {
$artists = Tag::get_tag_objects('artist',$input['filter']); $artists = Tag::get_tag_objects('artist',$input['filter']);
xmlData::set_offset($input['offset']); XML_Data::set_offset($input['offset']);
xmlData::set_limit($input['limit']); XML_Data::set_limit($input['limit']);
ob_end_clean(); ob_end_clean();
echo xmlData::artists($artists); echo XML_Data::artists($artists);
} // tag_artists } // tag_artists
@ -435,11 +435,11 @@ class Api {
$albums = Tag::get_tag_objects('album',$input['filter']); $albums = Tag::get_tag_objects('album',$input['filter']);
xmlData::set_offset($input['offset']); XML_Data::set_offset($input['offset']);
xmlData::set_limit($input['limit']); XML_Data::set_limit($input['limit']);
ob_end_clean(); ob_end_clean();
echo xmlData::albums($albums); echo XML_Data::albums($albums);
} // tag_albums } // tag_albums
@ -451,11 +451,11 @@ class Api {
$songs = Tag::get_tag_objects('song',$input['filter']); $songs = Tag::get_tag_objects('song',$input['filter']);
xmlData::set_offset($input['offset']); XML_Data::set_offset($input['offset']);
xmlData::set_limit($input['limit']); XML_Data::set_limit($input['limit']);
ob_end_clean(); ob_end_clean();
echo xmlData::songs($songs); echo XML_Data::songs($songs);
} // tag_songs } // tag_songs
@ -477,11 +477,11 @@ class Api {
$songs = self::$browse->get_objects(); $songs = self::$browse->get_objects();
// Set the offset // Set the offset
xmlData::set_offset($input['offset']); XML_Data::set_offset($input['offset']);
xmlData::set_limit($input['limit']); XML_Data::set_limit($input['limit']);
ob_end_clean(); ob_end_clean();
echo xmlData::songs($songs); echo XML_Data::songs($songs);
} // songs } // songs
@ -494,7 +494,7 @@ class Api {
$uid = scrub_in($input['filter']); $uid = scrub_in($input['filter']);
ob_end_clean(); ob_end_clean();
echo xmlData::songs(array($uid)); echo XML_Data::songs(array($uid));
} // song } // song
@ -508,7 +508,7 @@ class Api {
$song_id = Song::parse_song_url($input['url']); $song_id = Song::parse_song_url($input['url']);
ob_end_clean(); ob_end_clean();
echo xmlData::songs(array($song_id)); echo XML_Data::songs(array($song_id));
} // url_to_song } // url_to_song
@ -527,11 +527,11 @@ class Api {
$playlist_ids = self::$browse->get_objects(); $playlist_ids = self::$browse->get_objects();
xmlData::set_offset($input['offset']); XML_Data::set_offset($input['offset']);
xmlData::set_limit($input['limit']); XML_Data::set_limit($input['limit']);
ob_end_clean(); ob_end_clean();
echo xmlData::playlists($playlist_ids); echo XML_Data::playlists($playlist_ids);
} // playlists } // playlists
@ -544,7 +544,7 @@ class Api {
$uid = scrub_in($input['filter']); $uid = scrub_in($input['filter']);
ob_end_clean(); ob_end_clean();
echo xmlData::playlists(array($uid)); echo XML_Data::playlists(array($uid));
} // playlist } // playlist
@ -563,10 +563,10 @@ class Api {
} }
} // end foreach } // end foreach
xmlData::set_offset($input['offset']); XML_Data::set_offset($input['offset']);
xmlData::set_limit($input['limit']); XML_Data::set_limit($input['limit']);
ob_end_clean(); ob_end_clean();
echo xmlData::songs($songs); echo XML_Data::songs($songs);
} // playlist_songs } // playlist_songs
@ -582,12 +582,12 @@ class Api {
ob_end_clean(); ob_end_clean();
xmlData::set_offset($input['offset']); XML_Data::set_offset($input['offset']);
xmlData::set_limit($input['limit']); XML_Data::set_limit($input['limit']);
$results = Search::run($array); $results = Search::run($array);
echo xmlData::songs($results); echo XML_Data::songs($results);
} // search_songs } // search_songs
@ -606,10 +606,10 @@ class Api {
$video_ids = self::$browse->get_objects(); $video_ids = self::$browse->get_objects();
xmlData::set_offset($input['offset']); XML_Data::set_offset($input['offset']);
xmlData::set_limit($input['limit']); XML_Data::set_limit($input['limit']);
echo xmlData::videos($video_ids); echo XML_Data::videos($video_ids);
} // videos } // videos
@ -621,7 +621,7 @@ class Api {
$video_id = scrub_in($input['filter']); $video_id = scrub_in($input['filter']);
echo xmlData::videos(array($video_id)); echo XML_Data::videos(array($video_id));
} // video } // video
@ -643,11 +643,11 @@ class Api {
case 'stop': case 'stop':
$result_status = $localplay->$input['command'](); $result_status = $localplay->$input['command']();
$xml_array = array('localplay'=>array('command'=>array($input['command']=>make_bool($result_status)))); $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; break;
default: default:
// They are doing it wrong // They are doing it wrong
echo xmlData::error('405', T_('Invalid Request')); echo XML_Data::error('405', T_('Invalid Request'));
break; break;
} // end switch on command } // end switch on command
@ -668,7 +668,7 @@ class Api {
$type = 'song'; $type = 'song';
$media = new $type($input['oid']); $media = new $type($input['oid']);
if (!$media->id) { 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; break;
} }
$democratic->add_vote(array( $democratic->add_vote(array(
@ -680,13 +680,13 @@ class Api {
// If everything was ok // If everything was ok
$xml_array = array('action'=>$input['action'],'method'=>$input['method'],'result'=>true); $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; break;
case 'devote': case 'devote':
$type = 'song'; $type = 'song';
$media = new $type($input['oid']); $media = new $type($input['oid']);
if (!$media->id) { 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); $uid = $democratic->get_uid_from_object_id($media->id,$type);
@ -694,21 +694,21 @@ class Api {
// Everything was ok // Everything was ok
$xml_array = array('action'=>$input['action'],'method'=>$input['method'],'result'=>true); $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; break;
case 'playlist': case 'playlist':
$objects = $democratic->get_items(); $objects = $democratic->get_items();
Song::build_cache($democratic->object_ids); Song::build_cache($democratic->object_ids);
Democratic::build_vote_cache($democratic->vote_ids); Democratic::build_vote_cache($democratic->vote_ids);
xmlData::democratic($objects); XML_Data::democratic($objects);
break; break;
case 'play': case 'play':
$url = $democratic->play_url(); $url = $democratic->play_url();
$xml_array = array('url'=>$url); $xml_array = array('url'=>$url);
echo xmlData::keyed_array($xml_array); echo XML_Data::keyed_array($xml_array);
break; break;
default: default:
echo xmlData::error('405', T_('Invalid Request')); echo XML_Data::error('405', T_('Invalid Request'));
break; break;
} // switch on method } // switch on method

View file

@ -43,7 +43,7 @@ class Registration {
* This sends the confirmation e-mail for the specified user * This sends the confirmation e-mail for the specified user
*/ */
public static function send_confirmation($username, $fullname, $email, $password, $validation) { public static function send_confirmation($username, $fullname, $email, $password, $validation) {
$mailer = new AmpacheMail(); $mailer = new Ampache_Mail();
// We are the system // We are the system
$mailer->set_default_sender(); $mailer->set_default_sender();

View file

@ -338,14 +338,14 @@ class Stream_Playlist {
$xml['track']['album'] = $url->album; $xml['track']['album'] = $url->album;
} }
$result .= xmlData::keyed_array($xml, true); $result .= XML_Data::keyed_array($xml, true);
} // end foreach } // end foreach
xmlData::set_type('xspf'); XML_Data::set_type('xspf');
echo xmlData::header(); echo XML_Data::header();
echo $result; echo $result;
echo xmlData::footer(); echo XML_Data::footer();
} // create_xspf } // create_xspf

View file

@ -22,13 +22,13 @@
*/ */
/** /**
* xmlData Class * XML_Data Class
* *
* This class takes care of all of the xml document stuff in Ampache these * This class takes care of all of the xml document stuff in Ampache these
* are all static calls * are all static calls
* *
*/ */
class xmlData { class XML_Data {
// This is added so that we don't pop any webservers // This is added so that we don't pop any webservers
private static $limit = '5000'; private static $limit = '5000';
@ -81,9 +81,9 @@ class xmlData {
/** /**
* set_type * 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 * @return void
*/ */
public static function set_type($type) { public static function set_type($type) {
@ -654,6 +654,6 @@ class xmlData {
} // _footer } // _footer
} // xmlData } // XML_Data
?> ?>

View file

@ -54,7 +54,7 @@ function send_newpassword($email,$current_ip){
$newpassword = generate_password(6); $newpassword = generate_password(6);
$client->update_password($newpassword); $client->update_password($newpassword);
$mailer = new AmpacheMail(); $mailer = new Ampache_Mail();
$mailer->set_default_sender(); $mailer->set_default_sender();
$mailer->subject = T_("Lost Password"); $mailer->subject = T_("Lost Password");
$mailer->recipient_name = $client->fullname; $mailer->recipient_name = $client->fullname;

View file

@ -32,7 +32,7 @@ if (!Config::get('use_rss') || Config::get('demo_mode')) {
// Add in our base hearder defining the content type // Add in our base hearder defining the content type
header("Content-Type: application/xml; charset=" . Config::get('site_charset')); 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(); echo $rss->get_xml();
?> ?>

View file

@ -40,7 +40,7 @@ header("Content-Disposition: attachment; filename=information.xml");
if (!Config::get('access_control')) { if (!Config::get('access_control')) {
ob_end_clean(); ob_end_clean();
debug_event('Access Control','Error Attempted to use XML API with Access Control turned off','3'); 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; 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') { 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'); debug_event('Access Denied','Invalid Session attempt to API [' . $_REQUEST['action'] . ']','3');
ob_end_clean(); ob_end_clean();
echo xmlData::error('401', T_('Session Expired')); echo XML_Data::error('401', T_('Session Expired'));
exit(); exit();
} }
@ -62,7 +62,7 @@ $username = ($_REQUEST['action'] == 'handshake' || $_REQUEST['action'] == 'ping'
if (!Access::check_network('init-api',$username,'5')) { if (!Access::check_network('init-api',$username,'5')) {
debug_event('Access Denied','Unauthorized access attempt to API [' . $_SERVER['REMOTE_ADDR'] . ']', '3'); debug_event('Access Denied','Unauthorized access attempt to API [' . $_SERVER['REMOTE_ADDR'] . ']', '3');
ob_end_clean(); 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(); exit();
} }
@ -93,4 +93,4 @@ foreach ($methods as $method) {
// If we manage to get here, we still need to hand out an XML document // If we manage to get here, we still need to hand out an XML document
ob_end_clean(); ob_end_clean();
echo xmlData::error('405', T_('Invalid Request')); echo XML_Data::error('405', T_('Invalid Request'));

View file

@ -28,7 +28,7 @@
*/ */
if (count($results)) { 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 show_box_top(T_('Now Playing') . $link); ?>
<?php <?php

View file

@ -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'); show_box_top(T_('Recently Played') . $link, 'box box_recently_played');
?> ?>
<table class="tabledata" cellpadding="0" cellspacing="0"> <table class="tabledata" cellpadding="0" cellspacing="0">