@@ -39,29 +39,29 @@ |
||
| 39 | 39 | */ |
| 40 | 40 | public function replaceBy(array $aParams = array()) : string |
| 41 | 41 | { |
| 42 | - $aParams['template'] = trim(str_replace(["'", '"'], "", $aParams['template'])); |
|
| 42 | + $aParams['template'] = trim(str_replace(["'", '"'], "", $aParams['template'])); |
|
| 43 | 43 | |
| 44 | 44 | if (isset($aParams['template'])) { |
| 45 | 45 | |
| 46 | - $aTemplates = explode(';', $aParams['template']); |
|
| 47 | - $sGetUrl = 'getCss?'; |
|
| 46 | + $aTemplates = explode(';', $aParams['template']); |
|
| 47 | + $sGetUrl = 'getCss?'; |
|
| 48 | 48 | |
| 49 | - foreach ($aTemplates as $sTemplate) { |
|
| 49 | + foreach ($aTemplates as $sTemplate) { |
|
| 50 | 50 | |
| 51 | - if (strstr($sTemplate, 'css/')) { |
|
| 51 | + if (strstr($sTemplate, 'css/')) { |
|
| 52 | 52 | |
| 53 | - $sGetUrl .= $sTemplate.'&'; |
|
| 54 | - } |
|
| 55 | - else if (strstr($sTemplate, 'js/')) { |
|
| 53 | + $sGetUrl .= $sTemplate.'&'; |
|
| 54 | + } |
|
| 55 | + else if (strstr($sTemplate, 'js/')) { |
|
| 56 | 56 | |
| 57 | - $sGetUrl .= $sTemplate.'&'; |
|
| 58 | - } |
|
| 59 | - } |
|
| 57 | + $sGetUrl .= $sTemplate.'&'; |
|
| 58 | + } |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | - if (defined('ASSET_VERSION') && ASSET_VERSION !== false) { |
|
| 61 | + if (defined('ASSET_VERSION') && ASSET_VERSION !== false) { |
|
| 62 | 62 | |
| 63 | - $sGetUrl .= ASSET_VERSION; |
|
| 64 | - } |
|
| 63 | + $sGetUrl .= ASSET_VERSION; |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | 66 | return $sGetUrl; |
| 67 | 67 | } |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | if (strstr($sTemplate, 'css/')) { |
| 52 | 52 | |
| 53 | 53 | $sGetUrl .= $sTemplate.'&'; |
| 54 | - } |
|
| 55 | - else if (strstr($sTemplate, 'js/')) { |
|
| 54 | + } else if (strstr($sTemplate, 'js/')) { |
|
| 56 | 55 | |
| 57 | 56 | $sGetUrl .= $sTemplate.'&'; |
| 58 | 57 | } |
@@ -28,30 +28,30 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | class Geocoding |
| 30 | 30 | { |
| 31 | - /** |
|
| 32 | - * get the URL with the signature for the Pro account of Google Map |
|
| 33 | - * |
|
| 34 | - * @access public |
|
| 35 | - * @param unknown $sUrlToSign |
|
| 36 | - * @param unknown $sClientId |
|
| 37 | - * @param unknown $sPrivateKey |
|
| 38 | - * @return string |
|
| 39 | - */ |
|
| 40 | - public static function signUrlForGoogle(string $sUrlToSign, string $sClientId, string $sPrivateKey) : string |
|
| 41 | - { |
|
| 42 | - $aUrl = parse_url($sUrlToSign); |
|
| 43 | - $aUrl['query'] .= '&client=' .$sClientId; |
|
| 31 | + /** |
|
| 32 | + * get the URL with the signature for the Pro account of Google Map |
|
| 33 | + * |
|
| 34 | + * @access public |
|
| 35 | + * @param unknown $sUrlToSign |
|
| 36 | + * @param unknown $sClientId |
|
| 37 | + * @param unknown $sPrivateKey |
|
| 38 | + * @return string |
|
| 39 | + */ |
|
| 40 | + public static function signUrlForGoogle(string $sUrlToSign, string $sClientId, string $sPrivateKey) : string |
|
| 41 | + { |
|
| 42 | + $aUrl = parse_url($sUrlToSign); |
|
| 43 | + $aUrl['query'] .= '&client=' .$sClientId; |
|
| 44 | 44 | |
| 45 | - $aUrlToSign = $aUrl['path']."?".$aUrl['query']; |
|
| 45 | + $aUrlToSign = $aUrl['path']."?".$aUrl['query']; |
|
| 46 | 46 | |
| 47 | - $decodedKey = base64_decode(str_replace(array('-', '_'), array('+', '/'), $sPrivateKey)); |
|
| 47 | + $decodedKey = base64_decode(str_replace(array('-', '_'), array('+', '/'), $sPrivateKey)); |
|
| 48 | 48 | |
| 49 | - $sSignature = hash_hmac("sha1", $aUrlToSign, $decodedKey, true); |
|
| 49 | + $sSignature = hash_hmac("sha1", $aUrlToSign, $decodedKey, true); |
|
| 50 | 50 | |
| 51 | - $sEncodedSignature = str_replace(array('+', '/'), array('-', '_'), base64_encode($sSignature)); |
|
| 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; |
|
| 56 | - } |
|
| 55 | + return $sOriginalUrl. '&signature='. $sEncodedSignature; |
|
| 56 | + } |
|
| 57 | 57 | } |
@@ -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 | } |
@@ -30,10 +30,10 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | class Typescript |
| 32 | 32 | { |
| 33 | - /** |
|
| 34 | - * @var string |
|
| 35 | - */ |
|
| 36 | - const TYPESCRIPT_WINDOWS = TYPESCRIPT_WINDOWS; |
|
| 33 | + /** |
|
| 34 | + * @var string |
|
| 35 | + */ |
|
| 36 | + const TYPESCRIPT_WINDOWS = TYPESCRIPT_WINDOWS; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * translate the content |
@@ -44,21 +44,21 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public static function toJs(string $sFile) : string |
| 46 | 46 | { |
| 47 | - $aFile = pathinfo($sFile); |
|
| 48 | - $sFolder = uniqid(); |
|
| 47 | + $aFile = pathinfo($sFile); |
|
| 48 | + $sFolder = uniqid(); |
|
| 49 | 49 | |
| 50 | - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { |
|
| 50 | + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { |
|
| 51 | 51 | |
| 52 | - $sCmd = self::TYPESCRIPT_WINDOWS." ".$sFile." --outDir ".__DIR__.'../../'.CACHE_DIR.$sFolder.'/'; |
|
| 53 | - $sContent = shell_exec($sCmd); |
|
| 54 | - } |
|
| 55 | - else { |
|
| 52 | + $sCmd = self::TYPESCRIPT_WINDOWS." ".$sFile." --outDir ".__DIR__.'../../'.CACHE_DIR.$sFolder.'/'; |
|
| 53 | + $sContent = shell_exec($sCmd); |
|
| 54 | + } |
|
| 55 | + else { |
|
| 56 | 56 | |
| 57 | - $sCmd = "tsc ".$sFile." --outDir ".__DIR__.'../../'.CACHE_DIR.$sFolder.'/'; |
|
| 58 | - $sContent = shell_exec($sCmd); |
|
| 59 | - } |
|
| 57 | + $sCmd = "tsc ".$sFile." --outDir ".__DIR__.'../../'.CACHE_DIR.$sFolder.'/'; |
|
| 58 | + $sContent = shell_exec($sCmd); |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | - header("content-type:text/javascript"); |
|
| 62 | - return file_get_contents(__DIR__.'../../'.CACHE_DIR.$sFolder.'/'.$aFile['filename'].'.js'); |
|
| 61 | + header("content-type:text/javascript"); |
|
| 62 | + return file_get_contents(__DIR__.'../../'.CACHE_DIR.$sFolder.'/'.$aFile['filename'].'.js'); |
|
| 63 | 63 | } |
| 64 | 64 | } |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | |
| 52 | 52 | $sCmd = self::TYPESCRIPT_WINDOWS." ".$sFile." --outDir ".__DIR__.'../../'.CACHE_DIR.$sFolder.'/'; |
| 53 | 53 | $sContent = shell_exec($sCmd); |
| 54 | - } |
|
| 55 | - else { |
|
| 54 | + } else { |
|
| 56 | 55 | |
| 57 | 56 | $sCmd = "tsc ".$sFile." --outDir ".__DIR__.'../../'.CACHE_DIR.$sFolder.'/'; |
| 58 | 57 | $sContent = shell_exec($sCmd); |
@@ -9,19 +9,19 @@ |
||
| 9 | 9 | |
| 10 | 10 | class Server implements RequestInterface |
| 11 | 11 | { |
| 12 | - /** |
|
| 13 | - * get parameter |
|
| 14 | - * @param string $name |
|
| 15 | - * @param string $default |
|
| 16 | - * @return string |
|
| 17 | - */ |
|
| 18 | - public function get(string $name, string $default = null) : string |
|
| 19 | - { |
|
| 20 | - if (isset($_SERVER[$name]) && $_SERVER[$name] != '') { |
|
| 21 | - return $_SERVER[$name]; |
|
| 22 | - } |
|
| 23 | - else if ($default != null) { |
|
| 24 | - return $default; |
|
| 25 | - } |
|
| 26 | - } |
|
| 12 | + /** |
|
| 13 | + * get parameter |
|
| 14 | + * @param string $name |
|
| 15 | + * @param string $default |
|
| 16 | + * @return string |
|
| 17 | + */ |
|
| 18 | + public function get(string $name, string $default = null) : string |
|
| 19 | + { |
|
| 20 | + if (isset($_SERVER[$name]) && $_SERVER[$name] != '') { |
|
| 21 | + return $_SERVER[$name]; |
|
| 22 | + } |
|
| 23 | + else if ($default != null) { |
|
| 24 | + return $default; |
|
| 25 | + } |
|
| 26 | + } |
|
| 27 | 27 | } |
| 28 | 28 | \ No newline at end of file |
@@ -19,8 +19,7 @@ |
||
| 19 | 19 | { |
| 20 | 20 | if (isset($_COOKIE[$name]) && $_COOKIE[$name] != '') { |
| 21 | 21 | return $_COOKIE[$name]; |
| 22 | - } |
|
| 23 | - else if ($default != null) { |
|
| 22 | + } else if ($default != null) { |
|
| 24 | 23 | return $default; |
| 25 | 24 | } |
| 26 | 25 | } |
@@ -9,19 +9,19 @@ |
||
| 9 | 9 | |
| 10 | 10 | class Files implements RequestInterface |
| 11 | 11 | { |
| 12 | - /** |
|
| 13 | - * get parameter |
|
| 14 | - * @param string $name |
|
| 15 | - * @param string $default |
|
| 16 | - * @return string |
|
| 17 | - */ |
|
| 18 | - public function get(string $name, string $default = null) : string |
|
| 19 | - { |
|
| 20 | - if (isset($_FILES[$name]) && $_FILES[$name] != '') { |
|
| 21 | - return $_FILES[$name]; |
|
| 22 | - } |
|
| 23 | - else if ($default != null) { |
|
| 24 | - return $default; |
|
| 25 | - } |
|
| 26 | - } |
|
| 12 | + /** |
|
| 13 | + * get parameter |
|
| 14 | + * @param string $name |
|
| 15 | + * @param string $default |
|
| 16 | + * @return string |
|
| 17 | + */ |
|
| 18 | + public function get(string $name, string $default = null) : string |
|
| 19 | + { |
|
| 20 | + if (isset($_FILES[$name]) && $_FILES[$name] != '') { |
|
| 21 | + return $_FILES[$name]; |
|
| 22 | + } |
|
| 23 | + else if ($default != null) { |
|
| 24 | + return $default; |
|
| 25 | + } |
|
| 26 | + } |
|
| 27 | 27 | } |
| 28 | 28 | \ No newline at end of file |
@@ -19,8 +19,7 @@ |
||
| 19 | 19 | { |
| 20 | 20 | if (isset($_COOKIE[$name]) && $_COOKIE[$name] != '') { |
| 21 | 21 | return $_COOKIE[$name]; |
| 22 | - } |
|
| 23 | - else if ($default != null) { |
|
| 22 | + } else if ($default != null) { |
|
| 24 | 23 | return $default; |
| 25 | 24 | } |
| 26 | 25 | } |
@@ -9,37 +9,37 @@ |
||
| 9 | 9 | |
| 10 | 10 | class Headers implements RequestInterface |
| 11 | 11 | { |
| 12 | - /** |
|
| 13 | - * get parameter |
|
| 14 | - * @param string $name |
|
| 15 | - * @param string $default |
|
| 16 | - * @return string |
|
| 17 | - */ |
|
| 18 | - public function get(string $name, string $default = null) : string |
|
| 19 | - { |
|
| 20 | - if (isset(apache_request_headers()[$name]) && apache_request_headers()[$name] != '') { |
|
| 21 | - return apache_request_headers()[$name]; |
|
| 22 | - } |
|
| 23 | - else if ($default != null) { |
|
| 24 | - return $default; |
|
| 25 | - } |
|
| 26 | - } |
|
| 12 | + /** |
|
| 13 | + * get parameter |
|
| 14 | + * @param string $name |
|
| 15 | + * @param string $default |
|
| 16 | + * @return string |
|
| 17 | + */ |
|
| 18 | + public function get(string $name, string $default = null) : string |
|
| 19 | + { |
|
| 20 | + if (isset(apache_request_headers()[$name]) && apache_request_headers()[$name] != '') { |
|
| 21 | + return apache_request_headers()[$name]; |
|
| 22 | + } |
|
| 23 | + else if ($default != null) { |
|
| 24 | + return $default; |
|
| 25 | + } |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * set a new header |
|
| 30 | - * @param string $name |
|
| 31 | - * @param string $value |
|
| 32 | - * @return string|Headers |
|
| 33 | - */ |
|
| 34 | - public function set(string $name, string $value = null) : Headers |
|
| 35 | - { |
|
| 36 | - if ($value !== null) { |
|
| 37 | - header($name . ': ' . $value); |
|
| 38 | - } |
|
| 39 | - else { |
|
| 40 | - header($name); |
|
| 41 | - } |
|
| 28 | + /** |
|
| 29 | + * set a new header |
|
| 30 | + * @param string $name |
|
| 31 | + * @param string $value |
|
| 32 | + * @return string|Headers |
|
| 33 | + */ |
|
| 34 | + public function set(string $name, string $value = null) : Headers |
|
| 35 | + { |
|
| 36 | + if ($value !== null) { |
|
| 37 | + header($name . ': ' . $value); |
|
| 38 | + } |
|
| 39 | + else { |
|
| 40 | + header($name); |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - return $this; |
|
| 44 | - } |
|
| 43 | + return $this; |
|
| 44 | + } |
|
| 45 | 45 | } |
| 46 | 46 | \ No newline at end of file |
@@ -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); |
@@ -19,8 +19,7 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | if (isset(apache_request_headers()[$name]) && apache_request_headers()[$name] != '') { |
| 21 | 21 | return apache_request_headers()[$name]; |
| 22 | - } |
|
| 23 | - else if ($default != null) { |
|
| 22 | + } else if ($default != null) { |
|
| 24 | 23 | return $default; |
| 25 | 24 | } |
| 26 | 25 | } |
@@ -35,8 +34,7 @@ discard block |
||
| 35 | 34 | { |
| 36 | 35 | if ($value !== null) { |
| 37 | 36 | header($name . ': ' . $value); |
| 38 | - } |
|
| 39 | - else { |
|
| 37 | + } else { |
|
| 40 | 38 | header($name); |
| 41 | 39 | } |
| 42 | 40 | |
@@ -9,11 +9,11 @@ |
||
| 9 | 9 | |
| 10 | 10 | interface RequestInterface |
| 11 | 11 | { |
| 12 | - /** |
|
| 13 | - * get parameter |
|
| 14 | - * @param string $name |
|
| 15 | - * @param string $default |
|
| 16 | - * @return string |
|
| 17 | - */ |
|
| 18 | - public function get(string $name, string $default = null) : string; |
|
| 12 | + /** |
|
| 13 | + * get parameter |
|
| 14 | + * @param string $name |
|
| 15 | + * @param string $default |
|
| 16 | + * @return string |
|
| 17 | + */ |
|
| 18 | + public function get(string $name, string $default = null) : string; |
|
| 19 | 19 | } |
| 20 | 20 | \ No newline at end of file |
@@ -9,19 +9,19 @@ |
||
| 9 | 9 | |
| 10 | 10 | class Request implements RequestInterface |
| 11 | 11 | { |
| 12 | - /** |
|
| 13 | - * get parameter |
|
| 14 | - * @param string $name |
|
| 15 | - * @param string $default |
|
| 16 | - * @return string |
|
| 17 | - */ |
|
| 18 | - public function get(string $name, string $default = null) : string |
|
| 19 | - { |
|
| 20 | - if (isset($_POST[$name]) && $_POST[$name] != '') { |
|
| 21 | - return $_POST[$name]; |
|
| 22 | - } |
|
| 23 | - else if ($default != null) { |
|
| 24 | - return $default; |
|
| 25 | - } |
|
| 26 | - } |
|
| 12 | + /** |
|
| 13 | + * get parameter |
|
| 14 | + * @param string $name |
|
| 15 | + * @param string $default |
|
| 16 | + * @return string |
|
| 17 | + */ |
|
| 18 | + public function get(string $name, string $default = null) : string |
|
| 19 | + { |
|
| 20 | + if (isset($_POST[$name]) && $_POST[$name] != '') { |
|
| 21 | + return $_POST[$name]; |
|
| 22 | + } |
|
| 23 | + else if ($default != null) { |
|
| 24 | + return $default; |
|
| 25 | + } |
|
| 26 | + } |
|
| 27 | 27 | } |
| 28 | 28 | \ No newline at end of file |
@@ -19,8 +19,7 @@ |
||
| 19 | 19 | { |
| 20 | 20 | if (isset($_COOKIE[$name]) && $_COOKIE[$name] != '') { |
| 21 | 21 | return $_COOKIE[$name]; |
| 22 | - } |
|
| 23 | - else if ($default != null) { |
|
| 22 | + } else if ($default != null) { |
|
| 24 | 23 | return $default; |
| 25 | 24 | } |
| 26 | 25 | } |
@@ -9,19 +9,19 @@ |
||
| 9 | 9 | |
| 10 | 10 | class Query implements RequestInterface |
| 11 | 11 | { |
| 12 | - /** |
|
| 13 | - * get parameter |
|
| 14 | - * @param string $name |
|
| 15 | - * @param string $default |
|
| 16 | - * @return string |
|
| 17 | - */ |
|
| 18 | - public function get(string $name, string $default = null) : string |
|
| 19 | - { |
|
| 20 | - if (isset($_GET[$name]) && $_GET[$name] != '') { |
|
| 21 | - return $_GET[$name]; |
|
| 22 | - } |
|
| 23 | - else if ($default != null) { |
|
| 24 | - return $default; |
|
| 25 | - } |
|
| 26 | - } |
|
| 12 | + /** |
|
| 13 | + * get parameter |
|
| 14 | + * @param string $name |
|
| 15 | + * @param string $default |
|
| 16 | + * @return string |
|
| 17 | + */ |
|
| 18 | + public function get(string $name, string $default = null) : string |
|
| 19 | + { |
|
| 20 | + if (isset($_GET[$name]) && $_GET[$name] != '') { |
|
| 21 | + return $_GET[$name]; |
|
| 22 | + } |
|
| 23 | + else if ($default != null) { |
|
| 24 | + return $default; |
|
| 25 | + } |
|
| 26 | + } |
|
| 27 | 27 | } |
| 28 | 28 | \ No newline at end of file |
@@ -19,8 +19,7 @@ |
||
| 19 | 19 | { |
| 20 | 20 | if (isset($_COOKIE[$name]) && $_COOKIE[$name] != '') { |
| 21 | 21 | return $_COOKIE[$name]; |
| 22 | - } |
|
| 23 | - else if ($default != null) { |
|
| 22 | + } else if ($default != null) { |
|
| 24 | 23 | return $default; |
| 25 | 24 | } |
| 26 | 25 | } |