Completed
Push — master ( f8ff86...ec22b1 )
by Henry
03:57
created
src/Models/Auth/Session.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@
 block discarded – undo
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 {
Please login to merge, or discard this patch.
src/Models/Media/Audio.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Models/Media/Media.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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),
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Models/Media/Video.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Controllers/MediaRequestHandler.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.