style(legacy): fix code format with php-cs-fixer (#1674)
This commit is contained in:
parent
e1dc69af9e
commit
69d8eae845
111 changed files with 1163 additions and 1163 deletions
|
@ -45,7 +45,7 @@ class AutoPlaylistManager
|
|||
$si = new Application_Model_ShowInstance($autoplaylist->getDbId());
|
||||
// the intro playlist should be added exactly once
|
||||
if ($introplaylistid != null) {
|
||||
//Logging::info('adding intro');
|
||||
// Logging::info('adding intro');
|
||||
$si->addPlaylistToShowStart($introplaylistid, false);
|
||||
}
|
||||
while (!$full) {
|
||||
|
@ -68,7 +68,7 @@ class AutoPlaylistManager
|
|||
if ($tempPercentScheduled == $ps) {
|
||||
break;
|
||||
}
|
||||
//now reset it to the current percent scheduled
|
||||
// now reset it to the current percent scheduled
|
||||
$tempPercentScheduled = $ps;
|
||||
}
|
||||
// the outroplaylist is added at the end, it will always overbook
|
||||
|
@ -93,7 +93,7 @@ class AutoPlaylistManager
|
|||
*/
|
||||
protected static function _upcomingAutoPlaylistShows()
|
||||
{
|
||||
//setting now so that past shows aren't referenced
|
||||
// setting now so that past shows aren't referenced
|
||||
$now = new DateTime('now', new DateTimeZone('UTC'));
|
||||
// only build playlists for shows that start up to an hour from now
|
||||
$future = clone $now;
|
||||
|
|
|
@ -4,19 +4,19 @@ class CORSHelper
|
|||
{
|
||||
public static function enableCrossOriginRequests(&$request, &$response)
|
||||
{
|
||||
//Chrome sends the Origin header for all requests, so we whitelist the webserver's hostname as well.
|
||||
// Chrome sends the Origin header for all requests, so we whitelist the webserver's hostname as well.
|
||||
$origin = $request->getHeader('Origin');
|
||||
$allowedOrigins = self::getAllowedOrigins($request);
|
||||
|
||||
if ((!(preg_match('/https?:\/\/localhost/', $origin) === 1)) && ($origin != '')
|
||||
&& (!in_array($origin, $allowedOrigins))
|
||||
) {
|
||||
//Don't allow CORS from other domains to prevent XSS.
|
||||
// Don't allow CORS from other domains to prevent XSS.
|
||||
Logging::error("request origin '{$origin}' is not in allowed '" . implode(', ', $allowedOrigins) . "'!");
|
||||
|
||||
throw new Zend_Controller_Action_Exception('Forbidden', 403);
|
||||
}
|
||||
//Allow AJAX requests from configured websites. We use this to allow other pages to use LibreTimes API.
|
||||
// Allow AJAX requests from configured websites. We use this to allow other pages to use LibreTimes API.
|
||||
if ($origin) {
|
||||
$response = $response->setHeader('Access-Control-Allow-Origin', $origin);
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ class Application_Common_DateHelper
|
|||
*/
|
||||
public static function removeSecondsFromTime($p_dateTime)
|
||||
{
|
||||
//Format is in hh:mm:ss. We want hh:mm
|
||||
// Format is in hh:mm:ss. We want hh:mm
|
||||
$timeExplode = explode(':', $p_dateTime);
|
||||
|
||||
if (count($timeExplode) == 3) {
|
||||
|
|
|
@ -44,7 +44,7 @@ class FileDataHelper
|
|||
$data['year'] = intval($data['year']);
|
||||
}
|
||||
if (array_key_exists('bpm', $data)) {
|
||||
//Some BPM tags are silly and include the word "BPM". Let's strip that...
|
||||
// Some BPM tags are silly and include the word "BPM". Let's strip that...
|
||||
$data['bpm'] = str_ireplace('BPM', '', $data['bpm']);
|
||||
// This will convert floats to ints too.
|
||||
$data['bpm'] = intval($data['bpm']);
|
||||
|
@ -143,7 +143,7 @@ class FileDataHelper
|
|||
$path_parts = pathinfo($filename);
|
||||
$file = $importDir . 'artwork/' . $path_parts['filename'];
|
||||
|
||||
//Save Data URI
|
||||
// Save Data URI
|
||||
if (file_put_contents($file, $base64)) {
|
||||
$get_img = $DbPath . 'artwork/' . $path_parts['filename'];
|
||||
} else {
|
||||
|
@ -204,7 +204,7 @@ class FileDataHelper
|
|||
$path_parts = pathinfo($fullpath);
|
||||
$file = $path_parts['filename'];
|
||||
|
||||
//Save Data URI
|
||||
// Save Data URI
|
||||
if (file_put_contents($audioPath . '/' . $file, $base64)) {
|
||||
$get_img = $dbPath . '/' . $file;
|
||||
} else {
|
||||
|
@ -261,7 +261,7 @@ class FileDataHelper
|
|||
$path_parts = pathinfo($fullpath);
|
||||
$file = $path_parts['filename'];
|
||||
|
||||
//Save Data URI
|
||||
// Save Data URI
|
||||
if (file_put_contents($audioPath . '/' . $file, $base64)) {
|
||||
$get_img = $dbPath . '/' . $file;
|
||||
} else {
|
||||
|
@ -429,7 +429,7 @@ class FileDataHelper
|
|||
$Image = 'data:image/jpeg;charset=utf-8;base64,' . base64_encode($file);
|
||||
$base64 = @$Image;
|
||||
|
||||
//Save Data URI
|
||||
// Save Data URI
|
||||
if (file_put_contents($conv_filename, $base64)) {
|
||||
} else {
|
||||
Logging::error('Could not save Data URI');
|
||||
|
|
|
@ -24,11 +24,11 @@ class Application_Common_FileIO
|
|||
throw new LibreTimeFileNotFoundException($filePath);
|
||||
}
|
||||
|
||||
//Note that $size is allowed to be zero. If that's the case, it means we don't
|
||||
//know the filesize, and we need to figure one out so modern browsers don't get
|
||||
//confused. This should only affect files imported by legacy upstream since
|
||||
//media monitor did not always set the proper size in the database but analyzer
|
||||
//seems to always have a value for this.
|
||||
// Note that $size is allowed to be zero. If that's the case, it means we don't
|
||||
// know the filesize, and we need to figure one out so modern browsers don't get
|
||||
// confused. This should only affect files imported by legacy upstream since
|
||||
// media monitor did not always set the proper size in the database but analyzer
|
||||
// seems to always have a value for this.
|
||||
if ($size === 0) {
|
||||
$fstats = fstat($fm);
|
||||
$size = $fstats['size'];
|
||||
|
@ -41,7 +41,7 @@ class Application_Common_FileIO
|
|||
$begin = 0;
|
||||
$end = $size - 1;
|
||||
|
||||
ob_start(); //Must start a buffer here for these header() functions
|
||||
ob_start(); // Must start a buffer here for these header() functions
|
||||
|
||||
if (isset($_SERVER['HTTP_RANGE'])) {
|
||||
if (preg_match('/bytes=\h*(\d+)-(\d*)[\D.*]?/i', $_SERVER['HTTP_RANGE'], $matches)) {
|
||||
|
@ -67,16 +67,16 @@ class Application_Common_FileIO
|
|||
header("Content-Range: bytes {$begin}-{$end}/{$size}");
|
||||
}
|
||||
|
||||
//We can have multiple levels of output buffering. Need to
|
||||
//keep looping until all have been disabled!!!
|
||||
//http://www.php.net/manual/en/function.ob-end-flush.php
|
||||
// We can have multiple levels of output buffering. Need to
|
||||
// keep looping until all have been disabled!!!
|
||||
// http://www.php.net/manual/en/function.ob-end-flush.php
|
||||
while (ob_get_level() > 0) {
|
||||
ob_end_flush();
|
||||
}
|
||||
|
||||
//These two lines were removed from Airtime 2.5.x at some point after Libretime forked from Airtime.
|
||||
//These lines allow seek to work for files.
|
||||
//Issue #349
|
||||
// These two lines were removed from Airtime 2.5.x at some point after Libretime forked from Airtime.
|
||||
// These lines allow seek to work for files.
|
||||
// Issue #349
|
||||
$cur = $begin;
|
||||
fseek($fm, $begin, 0);
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@ class SessionHelper
|
|||
{
|
||||
public static function reopenSessionForWriting()
|
||||
{
|
||||
//PHP will send double Set-Cookie headers if we reopen the
|
||||
//session for writing, and this breaks IE8 and some other browsers.
|
||||
//This hacky workaround prevents double headers. Background here:
|
||||
// PHP will send double Set-Cookie headers if we reopen the
|
||||
// session for writing, and this breaks IE8 and some other browsers.
|
||||
// This hacky workaround prevents double headers. Background here:
|
||||
// https://bugs.php.net/bug.php?id=38104
|
||||
ini_set('session.cache_limiter', null);
|
||||
session_start(); // Reopen the session for writing (without resending the Set-Cookie header)
|
||||
|
|
|
@ -6,7 +6,7 @@ class WidgetHelper
|
|||
{
|
||||
public static function getWeekInfo($userDefinedTimezone)
|
||||
{
|
||||
//weekStart is in station time.
|
||||
// weekStart is in station time.
|
||||
$weekStartDateTime = Application_Common_DateHelper::getWeekStartDateTime();
|
||||
|
||||
$dow = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday',
|
||||
|
@ -29,11 +29,11 @@ class WidgetHelper
|
|||
$weekStartDateTime->setTimezone($utcTimezone);
|
||||
$utcDayStart = $weekStartDateTime->format(DEFAULT_TIMESTAMP_FORMAT);
|
||||
for ($i = 0; $i < 14; ++$i) {
|
||||
//have to be in station timezone when adding 1 day for daylight savings.
|
||||
// have to be in station timezone when adding 1 day for daylight savings.
|
||||
$weekStartDateTime->setTimezone(new DateTimeZone($timezone));
|
||||
$weekStartDateTime->add(new DateInterval('P1D'));
|
||||
|
||||
//convert back to UTC to get the actual timestamp used for search.
|
||||
// convert back to UTC to get the actual timestamp used for search.
|
||||
$weekStartDateTime->setTimezone($utcTimezone);
|
||||
|
||||
$utcDayEnd = $weekStartDateTime->format(DEFAULT_TIMESTAMP_FORMAT);
|
||||
|
@ -115,7 +115,7 @@ class WidgetHelper
|
|||
|
||||
$weekStartDateTime->add(new DateInterval('P1D'));
|
||||
|
||||
//convert back to UTC to get the actual timestamp used for search.
|
||||
// convert back to UTC to get the actual timestamp used for search.
|
||||
$weekStartDateTime->setTimezone($utcTimezone);
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ class WidgetHelper
|
|||
$result['shows'] = $shows;
|
||||
|
||||
// convert image paths to point to api endpoints
|
||||
//TODO: do we need this here?
|
||||
// TODO: do we need this here?
|
||||
self::findAndConvertPaths($result);
|
||||
|
||||
return $result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue