@@ -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 | } |
@@ -181,13 +181,13 @@ discard block |
||
| 181 | 181 | } |
| 182 | 182 | else if ($mType === 'radio') { |
| 183 | 183 | |
| 184 | - $this->_aElement[$sName.rand(100000,999999)] = new Radio($sName, $sLabel, $mValue, $mOptions); |
|
| 184 | + $this->_aElement[$sName.rand(100000, 999999)] = new Radio($sName, $sLabel, $mValue, $mOptions); |
|
| 185 | 185 | } |
| 186 | 186 | else if ($mType === 'date') { |
| 187 | 187 | |
| 188 | 188 | $aDay = array(); |
| 189 | 189 | |
| 190 | - for ($i = 1 ; $i <= 31 ; $i++) { |
|
| 190 | + for ($i = 1; $i <= 31; $i++) { |
|
| 191 | 191 | |
| 192 | 192 | if ($i < 10) { $aDay['0'.$i] = '0'.$i; } |
| 193 | 193 | else { $aDay[$i] = $i; } |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | |
| 215 | 215 | $aYear = array(); |
| 216 | 216 | |
| 217 | - for ($i = 1900 ; $i <= 2013 ; $i++) { |
|
| 217 | + for ($i = 1900; $i <= 2013; $i++) { |
|
| 218 | 218 | |
| 219 | 219 | $aYear[$i] = $i; |
| 220 | 220 | } |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | namespace Venus\lib\Log; |
| 17 | 17 | |
| 18 | 18 | use \Venus\lib\Debug as Debug; |
| 19 | -use \Venus\lib\Log\LoggerInterface as LoggerInterface ; |
|
| 19 | +use \Venus\lib\Log\LoggerInterface as LoggerInterface; |
|
| 20 | 20 | use \Venus\lib\Log\LogLevel as LogLevel; |
| 21 | 21 | |
| 22 | 22 | /** |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | $sExtension = strtolower(substr(strrchr($_FILES[$sFile]['name'], '.'), 1)); |
| 101 | 101 | |
| 102 | - if (count($this->_aAllowExtension) > 0 && !in_array($sExtension ,$this->_aAllowExtension)) { |
|
| 102 | + if (count($this->_aAllowExtension) > 0 && !in_array($sExtension, $this->_aAllowExtension)) { |
|
| 103 | 103 | |
| 104 | 104 | $this->_sError = "The extension is not good"; |
| 105 | 105 | return false; |
@@ -111,24 +111,24 @@ discard block |
||
| 111 | 111 | if ($this->_sExtension === null) { $this->setExtension($sExtension); } |
| 112 | 112 | |
| 113 | 113 | if ($this->_sName) { $sName = $sPath.$this->_sName.'.'.$this->_sExtension; } |
| 114 | - else { $sName = $sPath.md5(uniqid(rand(), true)).'.'.$this->_sExtension;} |
|
| 114 | + else { $sName = $sPath.md5(uniqid(rand(), true)).'.'.$this->_sExtension; } |
|
| 115 | 115 | |
| 116 | 116 | if ($this->_bProportion == true && ($this->_iWidth || $this->_iHeight)) { |
| 117 | 117 | |
| 118 | 118 | $aImageSizes = getimagesize($_FILES[$sFile]['tmp_name']); |
| 119 | 119 | |
| 120 | 120 | $fRatio = min($aImageSizes[0] / $this->_iWidth, $aImageSizes[1] / $this->_iHeight); |
| 121 | - $iHeight = $aImageSizes[1] / $fRatio; |
|
| 122 | - $iWidth = $aImageSizes[0] / $fRatio; |
|
| 121 | + $iHeight = $aImageSizes[1] / $fRatio; |
|
| 122 | + $iWidth = $aImageSizes[0] / $fRatio; |
|
| 123 | 123 | $fY = ($iHeight - $this->_iHeight) / 2 * $fRatio; |
| 124 | 124 | $fX = ($iWidth - $this->_iWidth) / 2 * $fRatio; |
| 125 | 125 | |
| 126 | 126 | $rNewImage = imagecreatefromjpeg($_FILES[$sFile]['tmp_name']); |
| 127 | 127 | |
| 128 | - $rNewImgTrueColor = imagecreatetruecolor($this->_iWidth , $this->_iHeight); |
|
| 129 | - imagecopyresampled($rNewImgTrueColor , $rNewImage, 0, 0, $fX, $fY, $this->_iWidth, $this->_iHeight, $iWidth * $fRatio - $fX * 2, $iHeight * $fRatio - $fY * 2); |
|
| 128 | + $rNewImgTrueColor = imagecreatetruecolor($this->_iWidth, $this->_iHeight); |
|
| 129 | + imagecopyresampled($rNewImgTrueColor, $rNewImage, 0, 0, $fX, $fY, $this->_iWidth, $this->_iHeight, $iWidth * $fRatio - $fX * 2, $iHeight * $fRatio - $fY * 2); |
|
| 130 | 130 | |
| 131 | - imagejpeg($rNewImgTrueColor , $sName, 100); |
|
| 131 | + imagejpeg($rNewImgTrueColor, $sName, 100); |
|
| 132 | 132 | } |
| 133 | 133 | else { |
| 134 | 134 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | public static function signUrlForGoogle(string $sUrlToSign, string $sClientId, string $sPrivateKey) : string |
| 41 | 41 | { |
| 42 | 42 | $aUrl = parse_url($sUrlToSign); |
| 43 | - $aUrl['query'] .= '&client=' .$sClientId; |
|
| 43 | + $aUrl['query'] .= '&client='.$sClientId; |
|
| 44 | 44 | |
| 45 | 45 | $aUrlToSign = $aUrl['path']."?".$aUrl['query']; |
| 46 | 46 | |
@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | $sEncodedSignature = str_replace(array('+', '/'), array('-', '_'), base64_encode($sSignature)); |
| 52 | 52 | |
| 53 | - $sOriginalUrl = $aUrl['scheme']."://".$aUrl['host'].$aUrl['path'] . "?".$aUrl['query']; |
|
| 53 | + $sOriginalUrl = $aUrl['scheme']."://".$aUrl['host'].$aUrl['path']."?".$aUrl['query']; |
|
| 54 | 54 | |
| 55 | - return $sOriginalUrl. '&signature='. $sEncodedSignature; |
|
| 55 | + return $sOriginalUrl.'&signature='.$sEncodedSignature; |
|
| 56 | 56 | } |
| 57 | 57 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | public function set(string $name, string $value = null) : Headers |
| 35 | 35 | { |
| 36 | 36 | if ($value !== null) { |
| 37 | - header($name . ': ' . $value); |
|
| 37 | + header($name.': '.$value); |
|
| 38 | 38 | } |
| 39 | 39 | else { |
| 40 | 40 | header($name); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | $aRoutes = array(); |
| 84 | 84 | |
| 85 | - foreach($oHost->routes as $sKey => $oRoute) { |
|
| 85 | + foreach ($oHost->routes as $sKey => $oRoute) { |
|
| 86 | 86 | |
| 87 | 87 | if ($sKey === $sCode) { |
| 88 | 88 | |
@@ -135,8 +135,8 @@ discard block |
||
| 135 | 135 | throw new \Exception(); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - $sStringToEncode = str_replace(['à','á','â','ã','ä','ç','è','é','ê','ë','ì','í','î','ï','ñ','ò','ó','ô','õ','ö','ù','ú','û','ü','ý','ÿ','À','Á','Â','Ã','Ä','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ñ','Ò','Ó','Ô','Õ','Ö','Ù','Ú','Û','Ü','Ý'], |
|
| 139 | - ['a','a','a','a','a','c','e','e','e','e','i','i','i','i','n','o','o','o','o','o','u','u','u','u','y','y','A','A','A','A','A','C','E','E','E','E','I','I','I','I','N','O','O','O','O','O','U','U','U','U','Y'], |
|
| 138 | + $sStringToEncode = str_replace(['à', 'á', 'â', 'ã', 'ä', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', 'ù', 'ú', 'û', 'ü', 'ý', 'ÿ', 'À', 'Á', 'Â', 'Ã', 'Ä', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', 'Ù', 'Ú', 'Û', 'Ü', 'Ý'], |
|
| 139 | + ['a', 'a', 'a', 'a', 'a', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i', 'n', 'o', 'o', 'o', 'o', 'o', 'u', 'u', 'u', 'u', 'y', 'y', 'A', 'A', 'A', 'A', 'A', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I', 'N', 'O', 'O', 'O', 'O', 'O', 'U', 'U', 'U', 'U', 'Y'], |
|
| 140 | 140 | $sStringToEncode); |
| 141 | 141 | |
| 142 | 142 | $sStringToEncode = preg_replace('/[^a-zA-Z0-9_]+/', '_', preg_quote($sStringToEncode)); |
@@ -72,13 +72,13 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | if (!file_exists($sPrivatePath.'Controller')) { |
| 74 | 74 | |
| 75 | - mkdir($sPublicPath . 'css', 0777, true); |
|
| 76 | - mkdir($sPublicPath . 'js', 0777, true); |
|
| 77 | - mkdir($sPublicPath . 'img', 0777, true); |
|
| 75 | + mkdir($sPublicPath.'css', 0777, true); |
|
| 76 | + mkdir($sPublicPath.'js', 0777, true); |
|
| 77 | + mkdir($sPublicPath.'img', 0777, true); |
|
| 78 | 78 | } |
| 79 | 79 | else { |
| 80 | 80 | |
| 81 | - echo 'The Project (public part) ' . $sPrivatePath . " exists\n"; |
|
| 81 | + echo 'The Project (public part) '.$sPrivatePath." exists\n"; |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
@@ -91,16 +91,16 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | if (!file_exists($sPrivatePath.'Controller')) { |
| 93 | 93 | |
| 94 | - mkdir($sPrivatePath . 'Controller', 0777, true); |
|
| 95 | - mkdir($sPrivatePath . 'Entity', 0777, true); |
|
| 96 | - mkdir($sPrivatePath . 'Model', 0777, true); |
|
| 97 | - mkdir($sPrivatePath . 'View', 0777, true); |
|
| 98 | - mkdir($sPrivatePath . 'conf', 0777, true); |
|
| 99 | - mkdir($sPrivatePath . 'common', 0777, true); |
|
| 94 | + mkdir($sPrivatePath.'Controller', 0777, true); |
|
| 95 | + mkdir($sPrivatePath.'Entity', 0777, true); |
|
| 96 | + mkdir($sPrivatePath.'Model', 0777, true); |
|
| 97 | + mkdir($sPrivatePath.'View', 0777, true); |
|
| 98 | + mkdir($sPrivatePath.'conf', 0777, true); |
|
| 99 | + mkdir($sPrivatePath.'common', 0777, true); |
|
| 100 | 100 | } |
| 101 | 101 | else { |
| 102 | 102 | |
| 103 | - echo 'The Project (private part) ' . $sPrivatePath . " exists\n"; |
|
| 103 | + echo 'The Project (private part) '.$sPrivatePath." exists\n"; |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | $sContent = file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'common'.DIRECTORY_SEPARATOR.'Controller.php'); |
@@ -37,10 +37,10 @@ |
||
| 37 | 37 | |
| 38 | 38 | foreach ($controllerFiles as $oneController) { |
| 39 | 39 | |
| 40 | - if (is_file(__DIR__.'/../../../../tests/'.$one.'/app/Controller/' . $oneController) && $oneController != '..' && $oneController != '.') { |
|
| 40 | + if (is_file(__DIR__.'/../../../../tests/'.$one.'/app/Controller/'.$oneController) && $oneController != '..' && $oneController != '.') { |
|
| 41 | 41 | |
| 42 | 42 | $unitTest = new \PHPUnit_TextUI_Command; |
| 43 | - $unitTest->run([__DIR__.'/../../../../tests/'.$one.'/app/Controller/' . $oneController]); |
|
| 43 | + $unitTest->run([__DIR__.'/../../../../tests/'.$one.'/app/Controller/'.$oneController]); |
|
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | } |