From 15153727c10456b2b81f95c011ceaed3e6fe9598 Mon Sep 17 00:00:00 2001 From: "paul.baranowski" Date: Tue, 22 Feb 2011 18:22:31 +0100 Subject: [PATCH] CC-1971 Remove "?>" from the end of pure-PHP files to prevent "HEADERS ALREADY SENT" --- application/configs/conf.php | 6 +- application/controllers/ApiController.php | 3 +- application/models/AccessRecur.php | 1 - application/models/Alib.php | 1 - application/models/Backup.php | 1 - application/models/BasicStor.php | 4 +- application/models/GreenBox.php | 1 - application/models/LocStor.php | 1 - application/models/M3uPlaylist.php | 1 - application/models/Playlist.php | 9 ++- application/models/Prefs.php | 2 +- application/models/Renderer.php | 1 - application/models/Restore.php | 2 +- application/models/Schedule.php | 49 +++++++-------- application/models/SmilPlaylist.php | 1 - application/models/StoredFile.php | 38 +++++------ application/models/Subjects.php | 2 +- application/models/Transport.php | 2 +- application/models/TransportRecord.php | 2 +- application/models/Validator.php | 2 +- application/models/XmlParser.php | 2 +- application/models/audioClipFormat.php | 2 - application/models/cron/Cron.php | 2 +- application/models/cron/CronJob.php | 2 +- application/models/cron/Crontab.php | 2 +- application/models/cron/croncall.php | 3 +- application/models/cron/transportCron.php | 1 - application/models/cron/transportCronJob.php | 1 - application/models/index.php | 14 ----- application/models/playlistFormat.php | 5 -- application/models/tests/AllTests.php | 2 +- application/models/tests/PlaylistTests.php | 2 +- .../models/tests/SchedulerExportTests.php | 1 - application/models/tests/SchedulerTests.php | 1 - application/models/tests/StoredFileTests.php | 1 - application/models/tests/analyze.php | 1 - application/models/tests/index.php | 1 - application/models/tests/pdoTest.php | 2 +- application/models/tests/transTest.php | 1 - application/models/tests/webstreamTest.php | 1 - application/models/webstreamFormat.php | 5 -- application/models/xmlrpc/XR_LocStor.php | 2 +- application/models/xmlrpc/index.php | 1 - application/models/xmlrpc/put.php | 2 +- .../models/xmlrpc/schedulerPhpClient.php | 1 - application/models/xmlrpc/simpleGet.php | 1 - application/models/xmlrpc/xrLocStor.php | 2 +- application/models/xmlrpc/xr_cli_test.php | 1 - application/validate/UserNameValidate.php | 11 ++-- application/views/helpers/LoggedInAs.php | 5 +- install/airtime-install.php | 8 +-- install/airtime-uninstall.php | 2 +- install/airtime-user.php | 2 +- install/index.php | 1 - install/installInit.php | 2 +- install/install_twitter_plugin.php | 7 +-- install/uninstall_twitter_plugin.php | 6 -- pypo/test/airtime-schedule-insert.php | 1 - utils/CleanStor.php | 1 - utils/airtime-backup.php | 2 - utils/airtime-import.php | 1 - utils/restore.php | 1 - utils/restore2.php | 63 +++++++++---------- utils/serbianLatinToCyrillicConverter.py | 3 - 64 files changed, 113 insertions(+), 194 deletions(-) diff --git a/application/configs/conf.php b/application/configs/conf.php index be67fb6cc..fc61e9793 100644 --- a/application/configs/conf.php +++ b/application/configs/conf.php @@ -171,13 +171,11 @@ set_include_path('.'.PATH_SEPARATOR.$CC_CONFIG['pearPath'] //$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC); function load_db_config(){ $ini_array = parse_ini_file(dirname(__FILE__).'/../../build/database.conf', true); - - return array( + + return array( 'username' => $ini_array['database']['dbuser'], 'password' => $ini_array['database']['dbpass'], 'hostspec' => $ini_array['database']['host'], 'phptype' => 'pgsql', 'database' => $ini_array['database']['dbname']); } - -?> diff --git a/application/controllers/ApiController.php b/application/controllers/ApiController.php index 3b1432b7b..1a46506b3 100644 --- a/application/controllers/ApiController.php +++ b/application/controllers/ApiController.php @@ -83,7 +83,7 @@ class ApiController extends Zend_Controller_Action //header("Content-Type: $mtype"); */ - + $ext = pathinfo($filename, PATHINFO_EXTENSION); if ($ext == "ogg") header("Content-Type: audio/ogg"); @@ -212,4 +212,3 @@ class ApiController extends Zend_Controller_Action } } -?> diff --git a/application/models/AccessRecur.php b/application/models/AccessRecur.php index e0fc2a008..ff18f11f7 100644 --- a/application/models/AccessRecur.php +++ b/application/models/AccessRecur.php @@ -181,4 +181,3 @@ class AccessRecur { } } // class AccessRecur -?> diff --git a/application/models/Alib.php b/application/models/Alib.php index f0dba6f89..5a465c965 100644 --- a/application/models/Alib.php +++ b/application/models/Alib.php @@ -619,4 +619,3 @@ class Alib { } // fn test } // class Alib -?> diff --git a/application/models/Backup.php b/application/models/Backup.php index f6ae4b9e5..6b5c33c80 100755 --- a/application/models/Backup.php +++ b/application/models/Backup.php @@ -484,4 +484,3 @@ class Backup } } // classs Backup -?> diff --git a/application/models/BasicStor.php b/application/models/BasicStor.php index 744278440..5809879dc 100644 --- a/application/models/BasicStor.php +++ b/application/models/BasicStor.php @@ -2182,5 +2182,5 @@ class BasicStor { fclose($fp); } - } // class BasicStor - ?> +} // class BasicStor + diff --git a/application/models/GreenBox.php b/application/models/GreenBox.php index ded87bc8c..a00275888 100644 --- a/application/models/GreenBox.php +++ b/application/models/GreenBox.php @@ -1723,4 +1723,3 @@ class GreenBox extends BasicStor { } // fn removePerm } // class GreenBox -?> diff --git a/application/models/LocStor.php b/application/models/LocStor.php index 5e7b31778..d90da7cc5 100644 --- a/application/models/LocStor.php +++ b/application/models/LocStor.php @@ -1746,4 +1746,3 @@ class LocStor extends BasicStor { /* ==================================================== auxiliary methods */ } // class LocStor -?> diff --git a/application/models/M3uPlaylist.php b/application/models/M3uPlaylist.php index 963f3226c..8504ac9e3 100644 --- a/application/models/M3uPlaylist.php +++ b/application/models/M3uPlaylist.php @@ -349,4 +349,3 @@ class M3uPlaylistAnimateElement { } } -?> diff --git a/application/models/Playlist.php b/application/models/Playlist.php index 726d66b17..9d9905e7b 100644 --- a/application/models/Playlist.php +++ b/application/models/Playlist.php @@ -172,7 +172,7 @@ class Playlist { $storedPlaylist->currentlyaccessing = $pl->getDbCurrentlyaccessing(); $storedPlaylist->editedby = $pl->getDbEditedby(); $storedPlaylist->mtime = $pl->getDbMtime(); - + return $storedPlaylist; } @@ -931,17 +931,17 @@ class Playlist { if(is_null($fadeIn)) { if($defaultFade != "") - $fadeIn = $defaultFade; + $fadeIn = $defaultFade; else $fadeIn = '00:00:00.000'; } if(is_null($fadeOut)) { if($defaultFade != "") - $fadeOut = $defaultFade; + $fadeOut = $defaultFade; else $fadeOut = '00:00:00.000'; } - + $row = new CcPlaylistcontents(); $row->setDbPlaylistId($plId); $row->setDbFileId($fileId); @@ -1386,4 +1386,3 @@ class PlaylistMetadataExport } } -?> diff --git a/application/models/Prefs.php b/application/models/Prefs.php index c06385fe3..e3b0bde3d 100644 --- a/application/models/Prefs.php +++ b/application/models/Prefs.php @@ -439,4 +439,4 @@ class Prefs { } } // class Prefs -?> + diff --git a/application/models/Renderer.php b/application/models/Renderer.php index a569fc8da..4ee908a50 100644 --- a/application/models/Renderer.php +++ b/application/models/Renderer.php @@ -287,4 +287,3 @@ class Renderer } // class Renderer -?> diff --git a/application/models/Restore.php b/application/models/Restore.php index decbf728d..7c03fe5de 100644 --- a/application/models/Restore.php +++ b/application/models/Restore.php @@ -433,4 +433,4 @@ class Restore { } } // class Restore -?> + diff --git a/application/models/Schedule.php b/application/models/Schedule.php index 87ff2193b..50640e8e6 100644 --- a/application/models/Schedule.php +++ b/application/models/Schedule.php @@ -175,7 +175,7 @@ class ScheduleGroup { // Get the end time for the given entry $sql = "SELECT MAX(ends) FROM ".$CC_CONFIG["scheduleTable"] ." WHERE group_id=$p_groupId"; - + $startTime = $CC_DBC->GetOne($sql); return $this->add($show_instance, $startTime, null, $p_playlistId); } @@ -281,8 +281,8 @@ class Schedule { public static function getTimeUnScheduledInRange($s_datetime, $e_datetime) { global $CC_CONFIG, $CC_DBC; - $sql = "SELECT SUM(clip_length) FROM ".$CC_CONFIG["scheduleTable"]." - WHERE (starts >= '{$s_datetime}') + $sql = "SELECT SUM(clip_length) FROM ".$CC_CONFIG["scheduleTable"]." + WHERE (starts >= '{$s_datetime}') AND (ends <= '{$e_datetime}')"; $time = $CC_DBC->GetOne($sql); @@ -302,12 +302,12 @@ class Schedule { public static function getTimeScheduledInRange($s_datetime, $e_datetime) { global $CC_CONFIG, $CC_DBC; - $sql = "SELECT SUM(clip_length) FROM ".$CC_CONFIG["scheduleTable"]." - WHERE (starts >= '{$s_datetime}') + $sql = "SELECT SUM(clip_length) FROM ".$CC_CONFIG["scheduleTable"]." + WHERE (starts >= '{$s_datetime}') AND (ends <= '{$e_datetime}')"; $res = $CC_DBC->GetOne($sql); - + if(is_null($res)) return 0; @@ -315,9 +315,9 @@ class Schedule { } public static function getPercentScheduledInRange($s_datetime, $e_datetime) { - + $time = Schedule::getTimeScheduledInRange($s_datetime, $e_datetime); - + $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME); $sql = "SELECT EXTRACT(EPOCH FROM TIMESTAMP WITH TIME ZONE '{$s_datetime}')"; @@ -333,11 +333,11 @@ class Schedule { $i_epoch = $r->fetchColumn(0); $percent = ceil(($i_epoch / ($e_epoch - $s_epoch)) * 100); - + return $percent; } - + /** * Return TRUE if file is going to be played in the future. * @@ -444,58 +444,58 @@ class Schedule { "timezone"=> date("T"), "timezoneOffset"=> date("Z")); } - + /** * Builds an SQL Query for accessing scheduled item information from - * the database. + * the database. * * @param int $timeNow * @param int $timePeriod * @param int $count * @param String $interval * @return date - * - * $timeNow is the the currentTime in the format "Y-m-d H:i:s". + * + * $timeNow is the the currentTime in the format "Y-m-d H:i:s". * For example: 2011-02-02 22:00:54 - * + * * $timePeriod can be either negative, zero or positive. This is used * to indicate whether we want items from the past, present or future. - * + * * $count indicates how many results we want to limit ourselves to. - * + * * $interval is used to indicate how far into the past or future we * want to search the database. For example "5 days", "18 hours", "60 minutes", * "30 seconds" etc. */ public static function Get_Scheduled_Item_Data($timeStamp, $timePeriod=0, $count = 0, $interval="0 hours"){ global $CC_CONFIG, $CC_DBC; - + $sql = "SELECT DISTINCT pt.name, ft.track_title, ft.artist_name, ft.album_title, st.starts, st.ends, st.clip_length, st.group_id, show.name as show_name, st.instance_id" ." FROM $CC_CONFIG[scheduleTable] st, $CC_CONFIG[filesTable] ft, $CC_CONFIG[playListTable] pt, $CC_CONFIG[showInstances] si, $CC_CONFIG[showTable] show" ." WHERE st.playlist_id = pt.id" ." AND st.file_id = ft.id" ." AND st.instance_id = si.id" ." AND si.show_id = show.id"; - + if ($timePeriod < 0){ $sql .= " AND st.ends < TIMESTAMP '$timeStamp'" ." AND st.ends > (TIMESTAMP '$timeStamp' - INTERVAL '$interval')" ." ORDER BY st.starts DESC" - ." LIMIT $count"; + ." LIMIT $count"; } else if ($timePeriod == 0){ $sql .= " AND st.starts <= TIMESTAMP '$timeStamp'" - ." AND st.ends >= TIMESTAMP '$timeStamp'"; + ." AND st.ends >= TIMESTAMP '$timeStamp'"; } else if ($timePeriod > 0){ $sql .= " AND st.starts > TIMESTAMP '$timeStamp'" - ." AND st.starts < (TIMESTAMP '$timeStamp' + INTERVAL '$interval')" + ." AND st.starts < (TIMESTAMP '$timeStamp' + INTERVAL '$interval')" ." ORDER BY st.starts" - ." LIMIT $count"; + ." LIMIT $count"; } $rows = $CC_DBC->GetAll($sql); return $rows; } - + /** * Convert a time string in the format "YYYY-MM-DD HH:mm:SS" @@ -701,4 +701,3 @@ class Schedule { } -?> diff --git a/application/models/SmilPlaylist.php b/application/models/SmilPlaylist.php index fad9049e1..a5c5fc735 100644 --- a/application/models/SmilPlaylist.php +++ b/application/models/SmilPlaylist.php @@ -310,4 +310,3 @@ class SmilPlaylistAnimateElement { } } // class SmilPlaylistAnimateElement -?> diff --git a/application/models/StoredFile.php b/application/models/StoredFile.php index 9190c48f1..3892cd2a9 100644 --- a/application/models/StoredFile.php +++ b/application/models/StoredFile.php @@ -492,9 +492,9 @@ class StoredFile { $escapedValue = pg_escape_string($this->gunid); $sql = "SELECT * FROM ".$CC_CONFIG["filesTable"] ." WHERE gunid='$escapedValue'"; - + $this->md = $CC_DBC->getRow($sql); - + if (PEAR::isError($this->md)) { $error = $this->md; $this->md = null; @@ -511,7 +511,7 @@ class StoredFile { $compatibilityData[$xmlName] = $value; } } - + //$this->md = array_merge($this->md, $compatibilityData); $this->md = $compatibilityData; } @@ -706,7 +706,7 @@ class StoredFile { $sql = "SELECT *" ." FROM ".$CC_CONFIG['filesTable'] ." WHERE $cond"; - + $row = $CC_DBC->getRow($sql); if (PEAR::isError($row) || is_null($row)) { return $row; @@ -1784,7 +1784,7 @@ class StoredFile { (".$fileSelect."id FROM ".$CC_CONFIG["filesTable"]." AS FILES)) AS RESULTS"; return StoredFile::searchFiles($fromTable, $datatables); - + } public static function searchPlaylistsForSchedule($p_length, $datatables) { @@ -1793,9 +1793,9 @@ class StoredFile { $datatables["optWhere"][] = "plt.length <= INTERVAL '{$p_length}'"; $datatables["optWhere"][] = "plt.length > INTERVAL '00:00:00'"; - + return StoredFile::searchFiles($fromTable, $datatables); - } + } public static function searchFiles($fromTable, $data) { @@ -1814,8 +1814,8 @@ class StoredFile { // Where clause if(isset($data["optWhere"])) { - - $where[] = join(" AND ", $data["optWhere"]); + + $where[] = join(" AND ", $data["optWhere"]); } if(isset($searchTerms)) { @@ -1823,7 +1823,7 @@ class StoredFile { $searchCols = array(); for($i=0; $i<$data["iColumns"]; $i++) { - + if($data["bSearchable_".$i] == "true") { $searchCols[] = $columnsDisplayed[$i]; } @@ -1832,14 +1832,14 @@ class StoredFile { $outerCond = array(); foreach($searchTerms as $term) { - + $innerCond = array(); foreach($searchCols as $col) { - $innerCond[] = "{$col}::text ILIKE '%{$term}%'"; + $innerCond[] = "{$col}::text ILIKE '%{$term}%'"; } - $outerCond[] = "(".join(" OR ", $innerCond).")"; + $outerCond[] = "(".join(" OR ", $innerCond).")"; } $where[] = "(".join(" AND ", $outerCond).")"; } @@ -1869,12 +1869,12 @@ class StoredFile { else { $sql = $selectorRows." FROM ".$fromTable." ORDER BY ".$orderby." OFFSET ".$data["iDisplayStart"]." LIMIT ".$data["iDisplayLength"]; } - + $results = $CC_DBC->getAll($sql); //echo $results; //echo $sql; - //put back to default fetch mode. + //put back to default fetch mode. $CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC); if(!isset($totalDisplayRows)) { @@ -1883,8 +1883,8 @@ class StoredFile { return array("sEcho" => intval($data["sEcho"]), "iTotalDisplayRecords" => $totalDisplayRows, "iTotalRecords" => $totalRows, "aaData" => $results); - - + + /* @@ -1921,7 +1921,7 @@ class StoredFile { $and_cond[] = $string; } - + if(count($and_cond) > 0) { $or_cond[] = "(".join(" ".$inner." ", $and_cond).")"; } @@ -1958,4 +1958,4 @@ class StoredFile { } } -?> + diff --git a/application/models/Subjects.php b/application/models/Subjects.php index f307d47ac..b37f6dadf 100644 --- a/application/models/Subjects.php +++ b/application/models/Subjects.php @@ -680,4 +680,4 @@ class Subjects { } // fn test } // class Subjects -?> + diff --git a/application/models/Transport.php b/application/models/Transport.php index 151c75a29..5478618ce 100644 --- a/application/models/Transport.php +++ b/application/models/Transport.php @@ -1830,4 +1830,4 @@ class Transport } -?> + diff --git a/application/models/TransportRecord.php b/application/models/TransportRecord.php index deafd736f..43b3a529a 100644 --- a/application/models/TransportRecord.php +++ b/application/models/TransportRecord.php @@ -416,4 +416,4 @@ class TransportRecord } } // class TransportRecord -?> + diff --git a/application/models/Validator.php b/application/models/Validator.php index 87f1eef22..077f0aba6 100644 --- a/application/models/Validator.php +++ b/application/models/Validator.php @@ -382,4 +382,4 @@ class Validator { } // class Validator -?> + diff --git a/application/models/XmlParser.php b/application/models/XmlParser.php index 8b6f0ef30..bf2989ab6 100644 --- a/application/models/XmlParser.php +++ b/application/models/XmlParser.php @@ -395,4 +395,4 @@ class XmlParser { } } -?> + diff --git a/application/models/audioClipFormat.php b/application/models/audioClipFormat.php index f7fd506b7..d8460ccfa 100644 --- a/application/models/audioClipFormat.php +++ b/application/models/audioClipFormat.php @@ -324,5 +324,3 @@ $audioClipFormat = array( // 'regexp'=>'^\d{4}(-\d{2}(-\d{2}(T\d{2}:\d{2}(:\d{2}\.\d+)?(Z)|([\+\-]?\d{2}:\d{2}))?)?)?$', ), ); - -?> \ No newline at end of file diff --git a/application/models/cron/Cron.php b/application/models/cron/Cron.php index b4b0eb723..300fbc701 100755 --- a/application/models/cron/Cron.php +++ b/application/models/cron/Cron.php @@ -211,4 +211,4 @@ class Cron { return $this->cronfile.' "'.str_replace('"','\"',serialize($this->params)).'"'; } } -?> + diff --git a/application/models/cron/CronJob.php b/application/models/cron/CronJob.php index 3f6697121..a9e56adb0 100755 --- a/application/models/cron/CronJob.php +++ b/application/models/cron/CronJob.php @@ -14,4 +14,4 @@ class CronJob { } } -?> + diff --git a/application/models/cron/Crontab.php b/application/models/cron/Crontab.php index 3bd1f655c..b94ee1bc5 100755 --- a/application/models/cron/Crontab.php +++ b/application/models/cron/Crontab.php @@ -281,4 +281,4 @@ class Crontab return $returnar; } } -?> + diff --git a/application/models/cron/croncall.php b/application/models/cron/croncall.php index bae49815b..1c46966ae 100755 --- a/application/models/cron/croncall.php +++ b/application/models/cron/croncall.php @@ -1,4 +1,4 @@ -#!/usr/bin/php +#!/usr/bin/php execute($p['params']); exit(0); -?> \ No newline at end of file diff --git a/application/models/cron/transportCron.php b/application/models/cron/transportCron.php index 63845ee9d..caf6a24ac 100755 --- a/application/models/cron/transportCron.php +++ b/application/models/cron/transportCron.php @@ -18,4 +18,3 @@ if (!$r) { } exit(0); -?> \ No newline at end of file diff --git a/application/models/cron/transportCronJob.php b/application/models/cron/transportCronJob.php index 795dd659a..0a0f66f3d 100755 --- a/application/models/cron/transportCronJob.php +++ b/application/models/cron/transportCronJob.php @@ -39,4 +39,3 @@ if (TR_LOG_LEVEL>1) { $tr->trLog("transportCronJob($pid) end ($trtok)"); } exit(0); -?> \ No newline at end of file diff --git a/application/models/index.php b/application/models/index.php index cc0d4bdf3..ce253b51f 100644 --- a/application/models/index.php +++ b/application/models/index.php @@ -1,17 +1,3 @@ - -StorageServer module - -

StorageServer module

-
-HTML client
-XmlRpc test
-Test
- - \ No newline at end of file diff --git a/application/models/playlistFormat.php b/application/models/playlistFormat.php index 367d5c391..36342163e 100644 --- a/application/models/playlistFormat.php +++ b/application/models/playlistFormat.php @@ -110,8 +110,3 @@ $playlistFormat = array( */ ); -/* -? -ls:filename Text auto -*/ -?> diff --git a/application/models/tests/AllTests.php b/application/models/tests/AllTests.php index 9ca76645e..7ff5a8d9f 100644 --- a/application/models/tests/AllTests.php +++ b/application/models/tests/AllTests.php @@ -21,4 +21,4 @@ $result = PHPUnit::run($suite); echo $result->toString(); -?> + diff --git a/application/models/tests/PlaylistTests.php b/application/models/tests/PlaylistTests.php index 27501a954..834efb506 100644 --- a/application/models/tests/PlaylistTests.php +++ b/application/models/tests/PlaylistTests.php @@ -178,4 +178,4 @@ class PlaylistTests extends PHPUnit_TestCase { } } -?> + diff --git a/application/models/tests/SchedulerExportTests.php b/application/models/tests/SchedulerExportTests.php index 6bdbd4ee2..50b80e946 100644 --- a/application/models/tests/SchedulerExportTests.php +++ b/application/models/tests/SchedulerExportTests.php @@ -39,4 +39,3 @@ class SchedulerExportTests extends PHPUnit_TestCase { } } -?> \ No newline at end of file diff --git a/application/models/tests/SchedulerTests.php b/application/models/tests/SchedulerTests.php index 36c0084df..2064830b8 100644 --- a/application/models/tests/SchedulerTests.php +++ b/application/models/tests/SchedulerTests.php @@ -125,4 +125,3 @@ class SchedulerTests extends PHPUnit_TestCase { } } -?> \ No newline at end of file diff --git a/application/models/tests/StoredFileTests.php b/application/models/tests/StoredFileTests.php index e2ebcca08..7061e2b5f 100644 --- a/application/models/tests/StoredFileTests.php +++ b/application/models/tests/StoredFileTests.php @@ -84,4 +84,3 @@ class StoredFileTest extends PHPUnit_TestCase { } } -?> \ No newline at end of file diff --git a/application/models/tests/analyze.php b/application/models/tests/analyze.php index c1435b9c8..7e2a9fbac 100755 --- a/application/models/tests/analyze.php +++ b/application/models/tests/analyze.php @@ -22,4 +22,3 @@ if (is_array($r)) { print_r($r); } echo"\n"; -?> \ No newline at end of file diff --git a/application/models/tests/index.php b/application/models/tests/index.php index 125fdaf8e..4674d9c4c 100644 --- a/application/models/tests/index.php +++ b/application/models/tests/index.php @@ -1,4 +1,3 @@ \ No newline at end of file diff --git a/application/models/tests/pdoTest.php b/application/models/tests/pdoTest.php index 2037d5506..2c7c9235e 100644 --- a/application/models/tests/pdoTest.php +++ b/application/models/tests/pdoTest.php @@ -22,4 +22,4 @@ $sql3 = "SELECT TIMESTAMP '2011-01-01 00:00:00.000' + INTERVAL '01:00:00.123456' $result3 = $con->query($sql3); var_dump($result3->fetchAll()); -?> + diff --git a/application/models/tests/transTest.php b/application/models/tests/transTest.php index edf04354c..daaf98bda 100644 --- a/application/models/tests/transTest.php +++ b/application/models/tests/transTest.php @@ -140,4 +140,3 @@ $comm = "ls -l ".$CC_CONFIG['storageDir']."/a23"; echo `$comm`; if(file_exists("../trans/log")) echo `tail -n 25 ../trans/log`; echo "#Transport test: OK.\n\n"; */ -?> \ No newline at end of file diff --git a/application/models/tests/webstreamTest.php b/application/models/tests/webstreamTest.php index d8393867c..6b84f6524 100644 --- a/application/models/tests/webstreamTest.php +++ b/application/models/tests/webstreamTest.php @@ -59,4 +59,3 @@ echo "$r\n"; echo "#storeWebstream test: OK.\n\n" */ -?> \ No newline at end of file diff --git a/application/models/webstreamFormat.php b/application/models/webstreamFormat.php index 219230779..48d6354fa 100644 --- a/application/models/webstreamFormat.php +++ b/application/models/webstreamFormat.php @@ -338,8 +338,3 @@ $webstreamFormat = array( */ ); -/* -? -ls:filename Text auto -*/ -?> \ No newline at end of file diff --git a/application/models/xmlrpc/XR_LocStor.php b/application/models/xmlrpc/XR_LocStor.php index 50077dd39..2208f07d5 100644 --- a/application/models/xmlrpc/XR_LocStor.php +++ b/application/models/xmlrpc/XR_LocStor.php @@ -3830,4 +3830,4 @@ class XR_LocStor extends LocStor { } // class XR_LocStor -?> + diff --git a/application/models/xmlrpc/index.php b/application/models/xmlrpc/index.php index e1ee867a4..07176fc80 100644 --- a/application/models/xmlrpc/index.php +++ b/application/models/xmlrpc/index.php @@ -1,4 +1,3 @@ \ No newline at end of file diff --git a/application/models/xmlrpc/put.php b/application/models/xmlrpc/put.php index 57b9bae93..acc837c15 100644 --- a/application/models/xmlrpc/put.php +++ b/application/models/xmlrpc/put.php @@ -96,4 +96,4 @@ fclose($fp); fclose($putdata); header("HTTP/1.1 200"); -?> + diff --git a/application/models/xmlrpc/schedulerPhpClient.php b/application/models/xmlrpc/schedulerPhpClient.php index d3fce621a..c591f5bbd 100644 --- a/application/models/xmlrpc/schedulerPhpClient.php +++ b/application/models/xmlrpc/schedulerPhpClient.php @@ -508,4 +508,3 @@ $r = $spc->DisplayScheduleMethod($this->Base->sessid, '20040101T00:00:00', '2005 #$r = $spc->GetSchedulerTimeMethod(); var_dump($r); ================= */ -?> \ No newline at end of file diff --git a/application/models/xmlrpc/simpleGet.php b/application/models/xmlrpc/simpleGet.php index ebb0cf8dc..19b723605 100644 --- a/application/models/xmlrpc/simpleGet.php +++ b/application/models/xmlrpc/simpleGet.php @@ -125,4 +125,3 @@ switch ($ftype) { // var_dump($ftype); http_error(500, "500 Unknown ftype ($ftype)"); } -?> \ No newline at end of file diff --git a/application/models/xmlrpc/xrLocStor.php b/application/models/xmlrpc/xrLocStor.php index 4bfb50fca..5f5b55040 100644 --- a/application/models/xmlrpc/xrLocStor.php +++ b/application/models/xmlrpc/xrLocStor.php @@ -169,4 +169,4 @@ foreach ($methods as $method => $description) { $s = new XML_RPC_Server($defs); -?> + diff --git a/application/models/xmlrpc/xr_cli_test.php b/application/models/xmlrpc/xr_cli_test.php index c282be12b..47f890ba5 100644 --- a/application/models/xmlrpc/xr_cli_test.php +++ b/application/models/xmlrpc/xr_cli_test.php @@ -365,4 +365,3 @@ if (isset($infos[$method]['r'])) { } } -?> \ No newline at end of file diff --git a/application/validate/UserNameValidate.php b/application/validate/UserNameValidate.php index b6ff6ec92..1338b6c72 100644 --- a/application/validate/UserNameValidate.php +++ b/application/validate/UserNameValidate.php @@ -3,24 +3,23 @@ class Application_Validate_UserNameValidate extends Zend_Validate_Abstract { const LOGIN = 'login'; - + protected $_messageTemplates = array( self::LOGIN => "'%value%' is already taken" ); - + public function isValid($value) { $this->_setValue($value); - + $count = CcSubjsQuery::create()->filterByDbLogin($value)->count(); - + if ($count != 0) { $this->_error(self::LOGIN); return false; } - + return true; } } -?> diff --git a/application/views/helpers/LoggedInAs.php b/application/views/helpers/LoggedInAs.php index 3d560f9d6..77f0b663e 100644 --- a/application/views/helpers/LoggedInAs.php +++ b/application/views/helpers/LoggedInAs.php @@ -1,6 +1,6 @@ hasIdentity()) { $username = $auth->getIdentity()->login; } - return $username; + return $username; } } -?> diff --git a/install/airtime-install.php b/install/airtime-install.php index 833a5ab7c..7d8021902 100644 --- a/install/airtime-install.php +++ b/install/airtime-install.php @@ -24,7 +24,7 @@ function checkIfRoot(){ if(exec("whoami") != "root"){ echo "Must be root user.\n"; exit(1); - } + } } // Need to check if build.properties project home is set correctly. @@ -41,7 +41,7 @@ function setBuildPropertiesPath(){ foreach($lines as $key => $line){ fwrite($fp, $line); } - fclose($fp); + fclose($fp); } function directorySetup($CC_CONFIG){ @@ -69,7 +69,7 @@ echo " *** Directory Setup ***\n"; //exit(1); } $CC_CONFIG[$d] = $rp; - } + } } @@ -132,4 +132,4 @@ $command = __DIR__."/../utils/airtime-import --copy ../audio_samples/ > /dev/nul $command = "python ".__DIR__."/../pypo/install/pypo-install.py"; system($command); echo "******************************* Install Complete *******************************\n"; -?> + diff --git a/install/airtime-uninstall.php b/install/airtime-uninstall.php index dd3e5ca30..07c938538 100644 --- a/install/airtime-uninstall.php +++ b/install/airtime-uninstall.php @@ -227,4 +227,4 @@ airtime_uninstall_delete_files($CC_CONFIG['storageDir']); $command = "python ".__DIR__."/../pypo/install/pypo-uninstall.py"; system($command); echo "****************************** Uninstall Complete ******************************\n"; -?> + diff --git a/install/airtime-user.php b/install/airtime-user.php index ea591fd7e..6c4b0c0f0 100644 --- a/install/airtime-user.php +++ b/install/airtime-user.php @@ -99,4 +99,4 @@ if (PEAR::isError($r)) { die($r->getMessage()); } exit(0); -?> + diff --git a/install/index.php b/install/index.php index 125fdaf8e..4674d9c4c 100644 --- a/install/index.php +++ b/install/index.php @@ -1,4 +1,3 @@ \ No newline at end of file diff --git a/install/installInit.php b/install/installInit.php index 525aa6945..14b707c1b 100644 --- a/install/installInit.php +++ b/install/installInit.php @@ -84,4 +84,4 @@ function install_setDirPermissions($filePath) { // } } -?> + diff --git a/install/install_twitter_plugin.php b/install/install_twitter_plugin.php index 295bb46f0..1c473fb2b 100644 --- a/install/install_twitter_plugin.php +++ b/install/install_twitter_plugin.php @@ -8,12 +8,7 @@ if (isset($arr["DOCUMENT_ROOT"]) && ($arr["DOCUMENT_ROOT"] != "") ) { exit(1); } -?> -//------------------------------------------------------------------------ -// Install twitter Cron job -//------------------------------------------------------------------------ -ct->addCron($m, $h, $dom, $mon, $dow, $command); $cron->closeCrontab(); echo "Done.\n"; -?> + diff --git a/install/uninstall_twitter_plugin.php b/install/uninstall_twitter_plugin.php index bd6f3d86b..6fd9c6731 100644 --- a/install/uninstall_twitter_plugin.php +++ b/install/uninstall_twitter_plugin.php @@ -8,12 +8,7 @@ if (isset($arr["DOCUMENT_ROOT"]) && ($arr["DOCUMENT_ROOT"] != "") ) { exit(1); } -?> -//------------------------------------------------------------------------ -// Uninstall twitter Cron job -//------------------------------------------------------------------------ -ct->getByType(CRON_CMD) as $id => $line) { $cron->closeCrontab(); echo "Done.\n"; -?> \ No newline at end of file diff --git a/pypo/test/airtime-schedule-insert.php b/pypo/test/airtime-schedule-insert.php index 8861f1d55..6d3e37951 100644 --- a/pypo/test/airtime-schedule-insert.php +++ b/pypo/test/airtime-schedule-insert.php @@ -97,4 +97,3 @@ $scheduleGroup = new ScheduleGroup(); $scheduleGroup->add($playTime, null, $pl->getId()); echo " SUCCESS: Playlist scheduled at $playTime\n\n"; -?> diff --git a/utils/CleanStor.php b/utils/CleanStor.php index 192e410cb..17afe8200 100644 --- a/utils/CleanStor.php +++ b/utils/CleanStor.php @@ -122,4 +122,3 @@ switch($argv[1]){ } -?> diff --git a/utils/airtime-backup.php b/utils/airtime-backup.php index de0f0e405..7a544d3eb 100644 --- a/utils/airtime-backup.php +++ b/utils/airtime-backup.php @@ -192,5 +192,3 @@ function admDumpGroup(&$bs, $gid, $ind='') #var_export($res); #var_dump($res); echo "$res"; - - ?> \ No newline at end of file diff --git a/utils/airtime-import.php b/utils/airtime-import.php index 2323abbf4..714da2510 100644 --- a/utils/airtime-import.php +++ b/utils/airtime-import.php @@ -346,4 +346,3 @@ if ($g_errors > 0) { echo " *** Total: ".($g_fileCount+$g_duplicates)." files in $time seconds = $speed files/second.\n"; echo "==========================================================================\n"; -?> diff --git a/utils/restore.php b/utils/restore.php index c83c1be21..ad2004476 100644 --- a/utils/restore.php +++ b/utils/restore.php @@ -252,4 +252,3 @@ foreach ($groups as $grname => $group) { /* -------------------------------------------------------- restoring objects */ ls_restore_restoreObject($tree, /*$storId,*/ FALSE); -?> \ No newline at end of file diff --git a/utils/restore2.php b/utils/restore2.php index a1bf4f38f..026a6fe18 100755 --- a/utils/restore2.php +++ b/utils/restore2.php @@ -1,41 +1,36 @@ -#!/usr/bin/php - getMessage()); - } - $CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC); +PEAR::setErrorHandling(PEAR_ERROR_RETURN); +$CC_DBC = DB::connect($CC_CONFIG['dsn'], TRUE); +if (DB::isError($CC_DBC)) { + die($CC_DBC->getMessage()); +} +$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC); - $gb = new GreenBox(); - $rs = new Restore($gb); +$gb = new GreenBox(); +$rs = new Restore($gb); - if ($rs->loglevel=='debug') { - $rs->addLogItem('argv:'.print_r($argv,true)); - } +if ($rs->loglevel=='debug') { + $rs->addLogItem('argv:'.print_r($argv,true)); +} -# sleep(2); +$backupfile = $argv[1]; +$token = $argv[3]; +$sessid = $argv[4]; +$rs->startRestore($backupfile,$token,$sessid); - $backupfile = $argv[1]; - $token = $argv[3]; - $sessid = $argv[4]; - $rs->startRestore($backupfile,$token,$sessid); - -?> \ No newline at end of file diff --git a/utils/serbianLatinToCyrillicConverter.py b/utils/serbianLatinToCyrillicConverter.py index d2b53701f..0ef31f060 100755 --- a/utils/serbianLatinToCyrillicConverter.py +++ b/utils/serbianLatinToCyrillicConverter.py @@ -22,9 +22,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # -# Author : $Author$ -# Version : $Revision$ -# Location : $URL$ #------------------------------------------------------------------------------- #-------------------------------------------------------------------------------