Passed
Push — master ( aa5ce0...ecdd08 )
by Kishan
04:05
created
google_drive/gClient.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
  *
19 19
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND
20 20
  */
21
-require_once __DIR__.'/../vendor/autoload.php';
21
+require_once __DIR__ . '/../vendor/autoload.php';
22 22
 session_start();
23 23
 /**
24 24
  * Create a google Client for move album to Drive
Please login to merge, or discard this patch.
fb-callback.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
             header('Location: https://localhost:8443/SociaManager/login.php');
31 31
             exit();
32 32
         }
33
-    } catch(Facebook\Exceptions\FacebookResponseException $e) {
33
+    } catch (Facebook\Exceptions\FacebookResponseException $e) {
34 34
         // When Graph returns an error
35 35
         echo 'Graph returned an error: ' . $e->getMessage();
36 36
         exit;
37
-    } catch(Facebook\Exceptions\FacebookSDKException $e) {
37
+    } catch (Facebook\Exceptions\FacebookSDKException $e) {
38 38
         // When validation fails or other local issues
39 39
         echo 'Facebook SDK returned an error: ' . $e->getMessage();
40 40
         exit;
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     // If you know the user ID this access token belongs to, you can validate it here
52 52
     $tokenMetadata->validateExpiration();
53 53
 
54
-    if (! $accessToken->isLongLived()) {
54
+    if (!$accessToken->isLongLived()) {
55 55
         // Exchanges a short-lived access token for a long-lived one
56 56
         try {
57 57
             $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);
Please login to merge, or discard this patch.
slider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
     foreach ($albums as $album) {
28 28
         $albumUrl = $album['images'][0]['source'];
29 29
         $slides .= '<div class="mySlides fade">';
30
-        $slides .= '<img src="'. $albumUrl .'" style="width:100%; height: 450px"></div>';
30
+        $slides .= '<img src="' . $albumUrl . '" style="width:100%; height: 450px"></div>';
31 31
     }
32 32
     echo $slides;
33 33
 }
Please login to merge, or discard this patch.
google_drive/g-callback.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND
20 20
  */
21 21
 require_once 'gClient.php';
22
-$gClient =new CreateGoogleClient();
22
+$gClient = new CreateGoogleClient();
23 23
 $client = $gClient->createClient();
24 24
 
25 25
 if (!isset($_GET['code'])) {
Please login to merge, or discard this patch.
download-album.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     $fb
46 46
 ) {
47 47
     global $main_arr;
48
-    $album_directory = $album_download_directory.$album_name;
48
+    $album_directory = $album_download_directory . $album_name;
49 49
     if (!file_exists($album_directory)) {
50 50
          @mkdir($album_directory, 0777) || exit("Coudn't able to create directory");
51 51
     }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
     );
178 178
 }
179 179
 
180
-function zipFolder($album_download_directory){
180
+function zipFolder($album_download_directory) {
181 181
     if (isset($_GET['zip'])) {
182 182
         include_once 'zipper.php';
183 183
         $zipper = new Zipper();
Please login to merge, or discard this patch.
404.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
         404 => 'Not Found',
6 6
         500 => 'Internal Server Error'
7 7
     );
8
-    $source_url = 'http'.((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? 's' : '').'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
8
+    $source_url = 'http' . ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
9 9
     if (array_key_exists($code, $codes) && is_numeric($code)) {
10 10
         $error_code = $code;
11 11
         $error_name = $codes[$code];
Please login to merge, or discard this patch.
google_drive/google_login.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND
20 20
  */
21 21
 ini_set('max_execution_time', 999999);
22
-require_once __DIR__.'/gClient.php';
22
+require_once __DIR__ . '/gClient.php';
23 23
 require_once "../fb-callback.php";
24 24
 $main_arr = array();
25
-$gClient =new CreateGoogleClient();
25
+$gClient = new CreateGoogleClient();
26 26
 $client = $gClient->createClient();
27 27
 
28 28
 if (isset($_SESSION['google_access_token'])) {
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $count = 1;
75 75
         foreach ($resultAlbum as $images) {
76 76
             $url = $images['images'];
77
-            $img = $count.".jpeg";
77
+            $img = $count . ".jpeg";
78 78
             $folderId = $SubFolder->id;
79 79
             $fileMetadata = new Google_Service_Drive_DriveFile(
80 80
                 array(
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
                     'data' => $fileContent, 'mimeType' => 'image/jpeg',
90 90
                     'uploadType' => 'multipart', 'fields' => 'id')
91 91
                 );
92
-            }catch (Exception $e) {
92
+            } catch (Exception $e) {
93 93
                 print "An error occurred: " . $e->getMessage();
94 94
             }
95 95
             $count++;
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         $main_arr = array();
98 98
     }
99 99
 
100
-    function getAlbum($fb,$arr_alb,$i)
100
+    function getAlbum($fb, $arr_alb, $i)
101 101
     {
102 102
         global $main_arr;
103 103
         foreach ($arr_alb as $graphNode) {
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
             $i++;
106 106
         }
107 107
         $arr_alb_ar = $fb->next($arr_alb);
108
-        if(!empty($arr_alb_ar)) {
108
+        if (!empty($arr_alb_ar)) {
109 109
             getAlbum($fb, $arr_alb_ar, $i);
110 110
         }
111 111
         return $main_arr;
Please login to merge, or discard this patch.
zipper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
                 if (in_array(substr($file, strrpos($file, '/') + 1), array('.', '..')))
49 49
                     continue;
50 50
                 if (is_dir($file) === true) {
51
-                    $file = str_replace("/var/www/html/public/","",$file);
51
+                    $file = str_replace("/var/www/html/public/", "", $file);
52 52
                     $a[] = array(
53 53
                     'type' => 'dir',
54 54
                     'source' => str_replace($source . '/', '', $file . '/'),
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
                     'size' => 0
57 57
                     );
58 58
                 } else if (is_file($file) === true) {
59
-                    $file = str_replace("/var/www/html/public/","",$file);
59
+                    $file = str_replace("/var/www/html/public/", "", $file);
60 60
                     $src = str_replace($source . '/', '', $file);
61 61
                     $size = filesize($file);
62 62
                     $a[] = array(
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
                         $zip->addEmptyDir(end($dir));
124 124
                     } else {
125 125
                         $zip->addFromString(
126
-                            end($dir).'/'.$i.'.jpg', 
126
+                            end($dir) . '/' . $i . '.jpg', 
127 127
                             file_get_contents($entry['file'])
128 128
                         );
129 129
                         $i++;
@@ -167,9 +167,9 @@  discard block
 block discarded – undo
167 167
         $zipfilename = "";
168 168
         if (isset($album_download_directory)) {
169 169
             //$zipfilename = 'libs/resources'.DIRECTORY_SEPARATOR.'albums'.DIRECTORY_SEPARATOR.'fb-album_'.date("Y-m-d").'_'.date("H-i-s");
170
-            $zipfilename = 'public/fb-album_'.date("Y-m-d").'_'.date("H-i-s");
170
+            $zipfilename = 'public/fb-album_' . date("Y-m-d") . '_' . date("H-i-s");
171 171
             
172
-            $folder = dirname($_SERVER['PHP_SELF']).'/'.$album_download_directory;
172
+            $folder = dirname($_SERVER['PHP_SELF']) . '/' . $album_download_directory;
173 173
             // Server Root
174 174
             $root = $_SERVER["DOCUMENT_ROOT"];
175 175
             // source of the folder to unpack
Please login to merge, or discard this patch.
login.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
     header('Location: https://localhost:8443/SociaManager/index.php'); 
24 24
     exit();
25 25
 }
26
-$permissions = ['email','user_photos'];
26
+$permissions = ['email', 'user_photos'];
27 27
 $loginUrl = $helper->getLoginUrl(
28 28
     'https://localhost:8443/SociaManager/index.php', 
29 29
     $permissions
Please login to merge, or discard this patch.