diff options
author | Paul Arthur <paul.arthur@flowerysong.com> | 2013-01-25 19:54:11 -0500 |
---|---|---|
committer | Paul Arthur <paul.arthur@flowerysong.com> | 2013-01-25 19:54:11 -0500 |
commit | 9c28ed5ad1adf15f868d181b9cfca26a801550ad (patch) | |
tree | e179bafda6d487273718f7a7f16ba5687446e669 | |
parent | 7ea41a0029c903f807ce0ce3b7536bb60ac81a19 (diff) | |
download | ampache-9c28ed5ad1adf15f868d181b9cfca26a801550ad.tar.gz ampache-9c28ed5ad1adf15f868d181b9cfca26a801550ad.tar.bz2 ampache-9c28ed5ad1adf15f868d181b9cfca26a801550ad.zip |
Consistently use _ in two-word class names
-rw-r--r-- | admin/mail.php | 2 | ||||
-rw-r--r-- | lib/class/ampache_mail.class.php (renamed from lib/class/ampachemail.class.php) | 6 | ||||
-rw-r--r-- | lib/class/ampache_rss.class.php (renamed from lib/class/ampacherss.class.php) | 14 | ||||
-rw-r--r-- | lib/class/api.class.php | 122 | ||||
-rw-r--r-- | lib/class/registration.class.php | 2 | ||||
-rw-r--r-- | lib/class/stream_playlist.class.php | 8 | ||||
-rw-r--r-- | lib/class/xml_data.class.php (renamed from lib/class/xmldata.class.php) | 10 | ||||
-rw-r--r-- | lostpassword.php | 2 | ||||
-rw-r--r-- | rss.php | 2 | ||||
-rw-r--r-- | server/xml.server.php | 8 | ||||
-rw-r--r-- | templates/show_now_playing.inc.php | 2 | ||||
-rw-r--r-- | templates/show_recently_played.inc.php | 2 |
12 files changed, 90 insertions, 90 deletions
diff --git a/admin/mail.php b/admin/mail.php index c0fa4f9b..ca974ff2 100644 --- a/admin/mail.php +++ b/admin/mail.php @@ -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']; diff --git a/lib/class/ampachemail.class.php b/lib/class/ampache_mail.class.php index 812c6769..8c1d363b 100644 --- a/lib/class/ampachemail.class.php +++ b/lib/class/ampache_mail.class.php @@ -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 ?> diff --git a/lib/class/ampacherss.class.php b/lib/class/ampache_rss.class.php index 02cc6477..3b567937 100644 --- a/lib/class/ampacherss.class.php +++ b/lib/class/ampache_rss.class.php @@ -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 diff --git a/lib/class/api.class.php b/lib/class/api.class.php index 002eff2d..841d3534 100644 --- a/lib/class/api.class.php +++ b/lib/class/api.class.php @@ -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 diff --git a/lib/class/registration.class.php b/lib/class/registration.class.php index 1544e01e..d22a23ab 100644 --- a/lib/class/registration.class.php +++ b/lib/class/registration.class.php @@ -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(); diff --git a/lib/class/stream_playlist.class.php b/lib/class/stream_playlist.class.php index 0892386a..a8e66c62 100644 --- a/lib/class/stream_playlist.class.php +++ b/lib/class/stream_playlist.class.php @@ -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 diff --git a/lib/class/xmldata.class.php b/lib/class/xml_data.class.php index 96003964..da3c98c2 100644 --- a/lib/class/xmldata.class.php +++ b/lib/class/xml_data.class.php @@ -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 ?> diff --git a/lostpassword.php b/lostpassword.php index a7fbd3e5..c5deb98b 100644 --- a/lostpassword.php +++ b/lostpassword.php @@ -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; @@ -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(); ?> diff --git a/server/xml.server.php b/server/xml.server.php index bd13af57..4dfc124d 100644 --- a/server/xml.server.php +++ b/server/xml.server.php @@ -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')); diff --git a/templates/show_now_playing.inc.php b/templates/show_now_playing.inc.php index dfa55f8d..6b3c985b 100644 --- a/templates/show_now_playing.inc.php +++ b/templates/show_now_playing.inc.php @@ -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 diff --git a/templates/show_recently_played.inc.php b/templates/show_recently_played.inc.php index 6011d1f8..01a3754e 100644 --- a/templates/show_recently_played.inc.php +++ b/templates/show_recently_played.inc.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"> |