@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | |
196 | 196 | $aSeparatePut = explode('&', $sData); |
197 | 197 | |
198 | - foreach($aSeparatePut as $sOne) { |
|
198 | + foreach ($aSeparatePut as $sOne) { |
|
199 | 199 | |
200 | 200 | $aOnePut = explode('=', $sOne); |
201 | 201 | $aPut[$aOnePut[0]] = $aOnePut[1]; |
@@ -214,9 +214,9 @@ discard block |
||
214 | 214 | */ |
215 | 215 | public static function setStatus($iCode) |
216 | 216 | { |
217 | - if ($iCode === 200) { header('HTTP/1.1 200 Ok'); } |
|
218 | - else if ($iCode === 201) { header('HTTP/1.1 201 Created'); } |
|
219 | - else if ($iCode === 204) { header("HTTP/1.0 204 No Content"); } |
|
217 | + if ($iCode === 200) { header('HTTP/1.1 200 Ok'); } |
|
218 | + else if ($iCode === 201) { header('HTTP/1.1 201 Created'); } |
|
219 | + else if ($iCode === 204) { header("HTTP/1.0 204 No Content"); } |
|
220 | 220 | else if ($iCode === 403) { header('HTTP/1.1 403 Forbidden'); } |
221 | 221 | else if ($iCode === 404) { header('HTTP/1.1 404 Not Found'); } |
222 | 222 | } |
@@ -61,7 +61,7 @@ |
||
61 | 61 | * @param int $iTimeout expiration of cache |
62 | 62 | * @return mixed |
63 | 63 | */ |
64 | - public function get(string $sName, int &$iFlags = null, int $iTimeout = 0) |
|
64 | + public function get(string $sName, int&$iFlags = null, int $iTimeout = 0) |
|
65 | 65 | { |
66 | 66 | return self::$_aMemories[$sName]; |
67 | 67 | } |
@@ -74,7 +74,7 @@ |
||
74 | 74 | * @param int $iTimeout expiration of cache |
75 | 75 | * @return mixed |
76 | 76 | */ |
77 | - public function get(string $sName, int &$iFlags = null, int $iTimeout = 0) |
|
77 | + public function get(string $sName, int&$iFlags = null, int $iTimeout = 0) |
|
78 | 78 | { |
79 | 79 | if ($iTimeout > 0 && file_exists($this->_sFolder.$this->_getSubDirectory($sName).md5($sName).'.fil.cac') |
80 | 80 | && time() - filemtime($this->_sFolder.$this->_getSubDirectory($sName).md5($sName).'.fil.cac') > $iTimeout) { |
@@ -55,7 +55,7 @@ |
||
55 | 55 | * @param int $iTimeout expiration of cache |
56 | 56 | * @return mixed |
57 | 57 | */ |
58 | - public function get(string $sName, int &$iFlags = null, int $iTimeout = 0) |
|
58 | + public function get(string $sName, int&$iFlags = null, int $iTimeout = 0) |
|
59 | 59 | { |
60 | 60 | return apc_fetch($sName); |
61 | 61 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | * @param int $iTimeout expiration of cache |
40 | 40 | * @return mixed |
41 | 41 | */ |
42 | - public function get(string $sName, int &$iFlags = null, int $iTimeout = 0) |
|
42 | + public function get(string $sName, int&$iFlags = null, int $iTimeout = 0) |
|
43 | 43 | { |
44 | 44 | return false; |
45 | 45 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | * @param int $iFlags flags |
50 | 50 | * @param int $iTimeout expiration of cache |
51 | 51 | */ |
52 | - public function get(string $sName, int &$iFlags = null, int $iTimeout = 0); |
|
52 | + public function get(string $sName, int&$iFlags = null, int $iTimeout = 0); |
|
53 | 53 | |
54 | 54 | /** |
55 | 55 | * delete a value |
@@ -61,7 +61,7 @@ |
||
61 | 61 | * @param int $iTimeout expiration of cache |
62 | 62 | * @return mixed |
63 | 63 | */ |
64 | - public function get(string $sName, int &$iFlags = null, int $iTimeout = 0) |
|
64 | + public function get(string $sName, int&$iFlags = null, int $iTimeout = 0) |
|
65 | 65 | { |
66 | 66 | return parent::get($sName); |
67 | 67 | } |
@@ -41,12 +41,12 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public static function getWeek(int $iWeek, int $iYear, string $sFormat = "Y-m-d") : Date |
43 | 43 | { |
44 | - $iFirstDayInYear = date("N",mktime(0, 0, 0, 1, 1, $iYear)); |
|
44 | + $iFirstDayInYear = date("N", mktime(0, 0, 0, 1, 1, $iYear)); |
|
45 | 45 | |
46 | 46 | if ($iFirstDayInYear < 5) { $iShift = -($iFirstDayInYear - 1) * 86400; } |
47 | 47 | else { $iShift = (8 - $iFirstDayInYear) * 86400; } |
48 | 48 | |
49 | - if ($iWeek > 1) { $iWeekInSeconds = ($iWeek-1) * 604800; } |
|
49 | + if ($iWeek > 1) { $iWeekInSeconds = ($iWeek - 1) * 604800; } |
|
50 | 50 | else { $iWeekInSeconds = 0; } |
51 | 51 | |
52 | 52 | $iTimestamp = mktime(0, 0, 0, 1, 1, $iYear) + $iWeekInSeconds + $iShift; |
@@ -158,12 +158,12 @@ discard block |
||
158 | 158 | */ |
159 | 159 | public static function getMiddleWeek(int $iWeek, int $iYear, string $sFormat = "Y-m-d") : array |
160 | 160 | { |
161 | - $iFirstDayInYear = date("N",mktime(0, 0, 0, 1, 1, $iYear)); |
|
161 | + $iFirstDayInYear = date("N", mktime(0, 0, 0, 1, 1, $iYear)); |
|
162 | 162 | |
163 | 163 | if ($iFirstDayInYear < 5) { $iShift = -($iFirstDayInYear - 1) * 86400; } |
164 | 164 | else { $iShift = (8 - $iFirstDayInYear) * 86400; } |
165 | 165 | |
166 | - if ($iWeek > 1) { $iWeekInSeconds = ($iWeek-1) * 604800; } |
|
166 | + if ($iWeek > 1) { $iWeekInSeconds = ($iWeek - 1) * 604800; } |
|
167 | 167 | else { $iWeekInSeconds = 0; } |
168 | 168 | |
169 | 169 | if (date('N') > 2) { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | if (preg_replace('/^([0-9]+)-[0-9]+-[0-9]+$/', '$1', $aDates[0]) != date('Y')) { |
183 | 183 | |
184 | 184 | $aDates[0] = preg_replace('/^[0-9]+(-[0-9]+-[0-9]+)$/', date('Y').'$1', $aDates[0]); |
185 | - $aDates[1] = preg_replace('/^[0-9]+(-[0-9]+-[0-9]+)$/', (date('Y')+1).'$1', $aDates[1]); |
|
185 | + $aDates[1] = preg_replace('/^[0-9]+(-[0-9]+-[0-9]+)$/', (date('Y') + 1).'$1', $aDates[1]); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | return $aDates; |
@@ -225,10 +225,10 @@ discard block |
||
225 | 225 | $oDateTime = DateTime::createFromFormat('Y-m-d H:i:s', $sDateTime); |
226 | 226 | $iTimeStamp = time() - $oDateTime->getTimestamp(); |
227 | 227 | |
228 | - if ($iTimeStamp < 3600) { return $sStartReturn.' '.(int)($iTimeStamp/60).' '.$sMinutes.$sEndReturn; } |
|
229 | - if ($iTimeStamp < 86400) { return $sStartReturn.' '.(int)($iTimeStamp/3600).' '.$sHours.$sEndReturn; } |
|
230 | - if ($iTimeStamp < 2592000) { return $sStartReturn.' '.(int)($iTimeStamp/86400).' '.$sDays.$sEndReturn; } |
|
231 | - if ($iTimeStamp < 31536000) { return $sStartReturn.' '.(int)($iTimeStamp/2592000).' '.$sMonths.$sEndReturn; } |
|
232 | - else { return $sStartReturn.' '.(int)($iTimeStamp/31536000).' '.$sYears.$sEndReturn; } |
|
228 | + if ($iTimeStamp < 3600) { return $sStartReturn.' '.(int)($iTimeStamp / 60).' '.$sMinutes.$sEndReturn; } |
|
229 | + if ($iTimeStamp < 86400) { return $sStartReturn.' '.(int)($iTimeStamp / 3600).' '.$sHours.$sEndReturn; } |
|
230 | + if ($iTimeStamp < 2592000) { return $sStartReturn.' '.(int)($iTimeStamp / 86400).' '.$sDays.$sEndReturn; } |
|
231 | + if ($iTimeStamp < 31536000) { return $sStartReturn.' '.(int)($iTimeStamp / 2592000).' '.$sMonths.$sEndReturn; } |
|
232 | + else { return $sStartReturn.' '.(int)($iTimeStamp / 31536000).' '.$sYears.$sEndReturn; } |
|
233 | 233 | } |
234 | 234 | } |
@@ -174,34 +174,34 @@ |
||
174 | 174 | */ |
175 | 175 | public function send() : bool |
176 | 176 | { |
177 | - $sHeaders = 'From: ' . $this->_sFrom . "\r\n"; |
|
177 | + $sHeaders = 'From: '.$this->_sFrom."\r\n"; |
|
178 | 178 | |
179 | 179 | if (empty($this->_aAttachments)) { |
180 | 180 | |
181 | 181 | if ($this->_sFormat == "HTML") { |
182 | 182 | |
183 | - $sHeaders .= 'MIME-Version: 1.0' . "\r\n"; |
|
184 | - $sHeaders .= 'Content-type: text/html; charset=UTF-8' . "\r\n"; |
|
183 | + $sHeaders .= 'MIME-Version: 1.0'."\r\n"; |
|
184 | + $sHeaders .= 'Content-type: text/html; charset=UTF-8'."\r\n"; |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | return mail(implode(',', $this->_aRecipient), $this->_sSubject, $this->_sMessage, $sHeaders); |
188 | 188 | } |
189 | 189 | else { |
190 | 190 | |
191 | - $sBoundary = "_" . md5(uniqid(rand())); |
|
191 | + $sBoundary = "_".md5(uniqid(rand())); |
|
192 | 192 | |
193 | 193 | $sAttached = ""; |
194 | 194 | |
195 | 195 | foreach ($this->_aAttachments as $aAttachment) { |
196 | 196 | |
197 | 197 | $sAttached_file = chunk_split(base64_encode($aAttachment["content"])); |
198 | - $sAttached = "\n\n" . "--" . $sBoundary . "\nContent-Type: application; name=\"" . $aAttachment["name"] . "\"\r\nContent-Transfer-Encoding: base64\r\nContent-Disposition: attachment; filename=\"" . $aAttachment["name"] . "\"\r\n\n" . $sAttached_file . "--" . $sBoundary . "--"; |
|
198 | + $sAttached = "\n\n"."--".$sBoundary."\nContent-Type: application; name=\"".$aAttachment["name"]."\"\r\nContent-Transfer-Encoding: base64\r\nContent-Disposition: attachment; filename=\"".$aAttachment["name"]."\"\r\n\n".$sAttached_file."--".$sBoundary."--"; |
|
199 | 199 | } |
200 | 200 | |
201 | - $sHeaders = 'From: ' . $this->_sFrom . "\r\n"; |
|
201 | + $sHeaders = 'From: '.$this->_sFrom."\r\n"; |
|
202 | 202 | $sHeaders .= "MIME-Version: 1.0\r\nContent-Type: multipart/mixed; boundary=\"$sBoundary\"\r\n"; |
203 | 203 | |
204 | - $sBody = "--" . $sBoundary . "\nContent-Type: " . ($this->_sFormat == "HTML" ? "text/html" : "text/plain") . "; charset=UTF-8\r\n\n" . $this->_sMessage . $sAttached; |
|
204 | + $sBody = "--".$sBoundary."\nContent-Type: ".($this->_sFormat == "HTML" ? "text/html" : "text/plain")."; charset=UTF-8\r\n\n".$this->_sMessage.$sAttached; |
|
205 | 205 | |
206 | 206 | return mail(implode(',', $this->_aRecipient), $this->_sSubject, $sBody, $sHeaders); |
207 | 207 | } |