@@ -101,7 +101,7 @@ |
||
101 | 101 | // update session |
102 | 102 | $Session->setFields($sessionData); |
103 | 103 | if (function_exists('fastcgi_finish_request')) { |
104 | - register_shutdown_function(function (&$Session) { |
|
104 | + register_shutdown_function(function(&$Session) { |
|
105 | 105 | $Session->save(); |
106 | 106 | }, $Session); |
107 | 107 | } else { |
@@ -90,7 +90,7 @@ |
||
90 | 90 | $PreviewMedia = Media::createFromFile($previewPath, [ |
91 | 91 | 'ContextClass' => 'Media' |
92 | 92 | ,'ContextID' => $this->ID |
93 | - ,'Caption' => sprintf('%u sec preview (%us-%us)', static::$previewDuration, $startTime, $startTime+static::$previewDuration), |
|
93 | + ,'Caption' => sprintf('%u sec preview (%us-%us)', static::$previewDuration, $startTime, $startTime + static::$previewDuration), |
|
94 | 94 | ]); |
95 | 95 | |
96 | 96 | return $PreviewMedia; |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | // resize photo to thumbnail |
410 | 410 | if ($cropped) { |
411 | 411 | imagecopyresampled( |
412 | - $image, |
|
412 | + $image, |
|
413 | 413 | $srcImage, |
414 | 414 | ($thumbWidth - $scaledWidth) / 2, |
415 | 415 | ($thumbHeight - $scaledHeight) / 2, |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | ); |
423 | 423 | } else { |
424 | 424 | imagecopyresampled( |
425 | - $image, |
|
425 | + $image, |
|
426 | 426 | $srcImage, |
427 | 427 | round(($thumbWidth - $scaledWidth) / 2), |
428 | 428 | round(($thumbHeight - $scaledHeight) / 2), |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | public static $searchConditions = [ |
70 | 70 | 'Caption' => [ |
71 | - 'qualifiers' => ['any','caption'] |
|
71 | + 'qualifiers' => ['any', 'caption'] |
|
72 | 72 | ,'points' => 2 |
73 | 73 | ,'sql' => 'Caption LIKE "%%%s%%"', |
74 | 74 | ] |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | public static $defaultFilenameFormat = 'default.%s.jpg'; |
98 | 98 | public static $newDirectoryPermissions = 0775; |
99 | 99 | public static $newFilePermissions = 0664; |
100 | - public static $magicPath = null;//'/usr/share/misc/magic.mgc'; |
|
100 | + public static $magicPath = null; //'/usr/share/misc/magic.mgc'; |
|
101 | 101 | public static $useFaceDetection = true; |
102 | 102 | public static $faceDetectionTimeLimit = 10; |
103 | 103 | |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | |
613 | 613 | public static function getBlankPath($contextClass) |
614 | 614 | { |
615 | - $path = ['site-root','img',sprintf(static::$defaultFilenameFormat, $contextClass)]; |
|
615 | + $path = ['site-root', 'img', sprintf(static::$defaultFilenameFormat, $contextClass)]; |
|
616 | 616 | |
617 | 617 | if ($node = Site::resolvePath($path)) { |
618 | 618 | return $node->RealPath; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | // extract video streams |
119 | - $videoStreams = array_filter($output['streams'], function ($streamInfo) { |
|
119 | + $videoStreams = array_filter($output['streams'], function($streamInfo) { |
|
120 | 120 | return $streamInfo['codec_type'] == 'video'; |
121 | 121 | }); |
122 | 122 | |
@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | $mediaInfo['streams'] = $output['streams']; |
129 | 129 | $mediaInfo['videoStream'] = array_shift($videoStreams); |
130 | 130 | |
131 | - $mediaInfo['width'] = (int)$mediaInfo['videoStream']['width']; |
|
132 | - $mediaInfo['height'] = (int)$mediaInfo['videoStream']['height']; |
|
133 | - $mediaInfo['duration'] = (double)$mediaInfo['videoStream']['duration']; |
|
131 | + $mediaInfo['width'] = (int) $mediaInfo['videoStream']['width']; |
|
132 | + $mediaInfo['height'] = (int) $mediaInfo['videoStream']['height']; |
|
133 | + $mediaInfo['duration'] = (double) $mediaInfo['videoStream']['duration']; |
|
134 | 134 | |
135 | 135 | return $mediaInfo; |
136 | 136 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | public static $searchConditions = [ |
27 | 27 | 'Caption' => [ |
28 | - 'qualifiers' => ['any','caption'] |
|
28 | + 'qualifiers' => ['any', 'caption'] |
|
29 | 29 | ,'points' => 2 |
30 | 30 | ,'sql' => 'Caption LIKE "%%%s%%"', |
31 | 31 | ] |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | } elseif ($_SERVER['REQUEST_METHOD'] == 'PUT') { |
184 | 184 | $put = fopen("php://input", "r"); // open input stream |
185 | 185 | |
186 | - $tmp = tempnam("/tmp", "emr"); // use PHP to make a temporary file |
|
186 | + $tmp = tempnam("/tmp", "emr"); // use PHP to make a temporary file |
|
187 | 187 | $fp = fopen($tmp, "w"); // open write stream to temp file |
188 | 188 | |
189 | 189 | // write |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | } |
225 | 225 | |
226 | 226 | return static::respond('uploadComplete', [ |
227 | - 'success' => (boolean)$Media |
|
227 | + 'success' => (boolean) $Media |
|
228 | 228 | ,'data' => $Media |
229 | 229 | ,'TagID' => isset($Tag) ? $Tag->ID : null, |
230 | 230 | ]); |
@@ -269,9 +269,9 @@ discard block |
||
269 | 269 | } |
270 | 270 | |
271 | 271 | // send caching headers |
272 | - $expires = 60*60*24*365; |
|
272 | + $expires = 60 * 60 * 24 * 365; |
|
273 | 273 | header("Cache-Control: public, max-age=$expires"); |
274 | - header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time()+$expires)); |
|
274 | + header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + $expires)); |
|
275 | 275 | header('Pragma: public'); |
276 | 276 | |
277 | 277 | // media are immutable for a given URL, so no need to actually check anything if the browser wants to revalidate its cache |
@@ -494,9 +494,9 @@ discard block |
||
494 | 494 | public static function handleThumbnailRequest(Media $Media = null) |
495 | 495 | { |
496 | 496 | // send caching headers |
497 | - $expires = 60*60*24*365; |
|
497 | + $expires = 60 * 60 * 24 * 365; |
|
498 | 498 | header("Cache-Control: public, max-age=$expires"); |
499 | - header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time()+$expires)); |
|
499 | + header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + $expires)); |
|
500 | 500 | header('Pragma: public'); |
501 | 501 | |
502 | 502 |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @param string $label |
100 | 100 | * @return void |
101 | 101 | */ |
102 | - public static function setConnection(string $label=null) |
|
102 | + public static function setConnection(string $label = null) |
|
103 | 103 | { |
104 | 104 | if ($label === null && static::$currentConnection === null) { |
105 | 105 | static::$currentConnection = static::getDefaultLabel(); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | * @uses static::$Timezone |
133 | 133 | * @uses PDO |
134 | 134 | */ |
135 | - public static function getConnection($label=null) |
|
135 | + public static function getConnection($label = null) |
|
136 | 136 | { |
137 | 137 | if ($label === null) { |
138 | 138 | if (static::$currentConnection === null) { |
@@ -151,10 +151,10 @@ discard block |
||
151 | 151 | |
152 | 152 | if (isset($config['socket'])) { |
153 | 153 | // socket connection |
154 | - $DSN = 'mysql:unix_socket=' . $config['socket'] . ';dbname=' . $config['database']; |
|
154 | + $DSN = 'mysql:unix_socket='.$config['socket'].';dbname='.$config['database']; |
|
155 | 155 | } else { |
156 | 156 | // tcp connection |
157 | - $DSN = 'mysql:host=' . $config['host'] . ';port=' . $config['port'] .';dbname=' . $config['database']; |
|
157 | + $DSN = 'mysql:host='.$config['host'].';port='.$config['port'].';dbname='.$config['database']; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | try { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | { |
183 | 183 | if (is_string($data)) { |
184 | 184 | $data = static::getConnection()->quote($data); |
185 | - $data = substr($data, 1, strlen($data)-2); |
|
185 | + $data = substr($data, 1, strlen($data) - 2); |
|
186 | 186 | return $data; |
187 | 187 | } elseif (is_array($data)) { |
188 | 188 | foreach ($data as $key=>$string) { |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | $error = static::getConnection()->errorInfo(); |
522 | 522 | $message = $error[2]; |
523 | 523 | |
524 | - if (App::$Config['environment']=='dev') { |
|
524 | + if (App::$Config['environment'] == 'dev') { |
|
525 | 525 | $Handler = \Divergence\App::$whoops->popHandler(); |
526 | 526 | |
527 | 527 | $Handler->addDataTable("Query Information", [ |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | */ |
567 | 567 | protected static function startQueryLog($query) |
568 | 568 | { |
569 | - if (App::$Config['environment']!='dev') { |
|
569 | + if (App::$Config['environment'] != 'dev') { |
|
570 | 570 | return false; |
571 | 571 | } |
572 | 572 |