Completed
Push — master ( 68208f...51a787 )
by Florian
12:17
created
code/SecionIO.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
     {
39 39
         $image = Image::get()->byID($imageID);
40 40
         if ($image && $image->exists()) {
41
-            $exp = 'obj.http.x-url ~ "^/'.preg_quote($image->getFilename()).'$"'; // image itself
42
-            $exp    .= ' || obj.http.x-url ~ "^/'.preg_quote($image->Parent()->getFilename())
43
-                    .'_resampled/(.*)\-'.preg_quote($image->Name).'$"'; // resampled versions
41
+            $exp = 'obj.http.x-url ~ "^/' . preg_quote($image->getFilename()) . '$"'; // image itself
42
+            $exp .= ' || obj.http.x-url ~ "^/' . preg_quote($image->Parent()->getFilename())
43
+                    .'_resampled/(.*)\-' . preg_quote($image->Name) . '$"'; // resampled versions
44 44
             return static::performFlush($exp);
45 45
         }
46 46
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     {
52 52
         $file = File::get()->byID($fileID);
53 53
         if ($file && $file->exists()) {
54
-            $exp = 'obj.http.x-url ~ "^/'.preg_quote($file->getFilename()).'$"';
54
+            $exp = 'obj.http.x-url ~ "^/' . preg_quote($file->getFilename()) . '$"';
55 55
 
56 56
             return static::performFlush($exp);
57 57
         }
@@ -67,23 +67,23 @@  discard block
 block discarded – undo
67 67
             switch ($strategy) {
68 68
 
69 69
                 case 'single':
70
-                    $exp = 'obj.http.content-type ~ "'.preg_quote('text/html').'"';
71
-                    $exp .= ' && obj.http.x-url ~ "^'.preg_quote($sitetree->Link()).'$"';
70
+                    $exp = 'obj.http.content-type ~ "' . preg_quote('text/html') . '"';
71
+                    $exp .= ' && obj.http.x-url ~ "^' . preg_quote($sitetree->Link()) . '$"';
72 72
                     break;
73 73
 
74 74
                 case 'parents':
75
-                    $exp = 'obj.http.content-type ~ "'.preg_quote('text/html').'"';
76
-                    $exp .= ' && (obj.http.x-url ~ "^'.preg_quote($sitetree->Link()).'$"';
75
+                    $exp = 'obj.http.content-type ~ "' . preg_quote('text/html') . '"';
76
+                    $exp .= ' && (obj.http.x-url ~ "^' . preg_quote($sitetree->Link()) . '$"';
77 77
                     $parent = $sitetree->getParent();
78 78
                     while ($parent && $parent->exists()) {
79
-                        $exp .= ' || obj.http.x-url ~ "^'.preg_quote($parent->Link()).'$"';
79
+                        $exp .= ' || obj.http.x-url ~ "^' . preg_quote($parent->Link()) . '$"';
80 80
                         $parent = $parent->getParent();
81 81
                     }
82 82
                     $exp .= ')';
83 83
                     break;
84 84
 
85 85
                 case 'all':
86
-                    $exp = 'obj.http.content-type ~ "'.preg_quote('text/html').'"';
86
+                    $exp = 'obj.http.content-type ~ "' . preg_quote('text/html') . '"';
87 87
                     break;
88 88
 
89 89
                 case 'everyting':
@@ -120,10 +120,10 @@  discard block
 block discarded – undo
120 120
                 $conn = $service->request(null, 'POST', null, $headers, $options);
121 121
 
122 122
                 if ($conn->isError()) {
123
-                    SS_Log::log('SectionIO::performFlush :: '.$conn->getStatusCode().' : '.$conn->getStatusDescription().' : '.$url, SS_Log::ERR);
123
+                    SS_Log::log('SectionIO::performFlush :: ' . $conn->getStatusCode() . ' : ' . $conn->getStatusDescription() . ' : ' . $url, SS_Log::ERR);
124 124
                     $success = $success && false;
125 125
                 } else {
126
-                    SS_Log::log('SectionIO::performFlush :: ban successful. url: '.$url."; ban expression: '".$banExpression."'", SS_Log::ERR);
126
+                    SS_Log::log('SectionIO::performFlush :: ban successful. url: ' . $url . "; ban expression: '" . $banExpression . "'", SS_Log::ERR);
127 127
                 }
128 128
             }
129 129
         } else {
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     {
170 170
         $cert = ini_get('curl.cainfo');
171 171
         if (!$cert) {
172
-            $cert = BASE_PATH.'/'.SECTIONIO_BASE.'/cert/cacert.pem';
172
+            $cert = BASE_PATH . '/' . SECTIONIO_BASE . '/cert/cacert.pem';
173 173
         }
174 174
 
175 175
         return $cert;
Please login to merge, or discard this patch.