@@ -148,6 +148,6 @@ |
||
| 148 | 148 | */ |
| 149 | 149 | private static function _applyCode(string $sContent, string $sCode) : string |
| 150 | 150 | { |
| 151 | - return "\033[" . $sCode . "m" . $sContent . "\033[0m\n"; |
|
| 151 | + return "\033[".$sCode."m".$sContent."\033[0m\n"; |
|
| 152 | 152 | } |
| 153 | 153 | } |
@@ -41,11 +41,11 @@ 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; } else { $iShift = (8 - $iFirstDayInYear) * 86400; } |
| 47 | 47 | |
| 48 | - if ($iWeek > 1) { $iWeekInSeconds = ($iWeek-1) * 604800; } else { $iWeekInSeconds = 0; } |
|
| 48 | + if ($iWeek > 1) { $iWeekInSeconds = ($iWeek - 1) * 604800; } else { $iWeekInSeconds = 0; } |
|
| 49 | 49 | |
| 50 | 50 | $iTimestamp = mktime(0, 0, 0, 1, 1, $iYear) + $iWeekInSeconds + $iShift; |
| 51 | 51 | $iTimestampLastDay = mktime(0, 0, 0, 1, 6, $iYear) + $iWeekInSeconds + $iShift + 604800; |
@@ -156,12 +156,12 @@ discard block |
||
| 156 | 156 | */ |
| 157 | 157 | public static function getMiddleWeek(int $iWeek, int $iYear, string $sFormat = "Y-m-d") : array |
| 158 | 158 | { |
| 159 | - $iFirstDayInYear = date("N",mktime(0, 0, 0, 1, 1, $iYear)); |
|
| 159 | + $iFirstDayInYear = date("N", mktime(0, 0, 0, 1, 1, $iYear)); |
|
| 160 | 160 | |
| 161 | 161 | if ($iFirstDayInYear < 5) { $iShift = -($iFirstDayInYear - 1) * 86400; } |
| 162 | 162 | else { $iShift = (8 - $iFirstDayInYear) * 86400; } |
| 163 | 163 | |
| 164 | - if ($iWeek > 1) { $iWeekInSeconds = ($iWeek-1) * 604800; } |
|
| 164 | + if ($iWeek > 1) { $iWeekInSeconds = ($iWeek - 1) * 604800; } |
|
| 165 | 165 | else { $iWeekInSeconds = 0; } |
| 166 | 166 | |
| 167 | 167 | if (date('N') > 2) { |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | if (preg_replace('/^([0-9]+)-[0-9]+-[0-9]+$/', '$1', $aDates[0]) != date('Y')) { |
| 181 | 181 | |
| 182 | 182 | $aDates[0] = preg_replace('/^[0-9]+(-[0-9]+-[0-9]+)$/', date('Y').'$1', $aDates[0]); |
| 183 | - $aDates[1] = preg_replace('/^[0-9]+(-[0-9]+-[0-9]+)$/', (date('Y')+1).'$1', $aDates[1]); |
|
| 183 | + $aDates[1] = preg_replace('/^[0-9]+(-[0-9]+-[0-9]+)$/', (date('Y') + 1).'$1', $aDates[1]); |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | return $aDates; |
@@ -221,10 +221,10 @@ discard block |
||
| 221 | 221 | $oDateTime = DateTime::createFromFormat('Y-m-d H:i:s', $sDateTime); |
| 222 | 222 | $iTimeStamp = time() - $oDateTime->getTimestamp(); |
| 223 | 223 | |
| 224 | - if ($iTimeStamp < 3600) { return $sStartReturn.' '.(int)($iTimeStamp/60).' '.$sMinutes.$sEndReturn; } |
|
| 225 | - if ($iTimeStamp < 86400) { return $sStartReturn.' '.(int)($iTimeStamp/3600).' '.$sHours.$sEndReturn; } |
|
| 226 | - if ($iTimeStamp < 2592000) { return $sStartReturn.' '.(int)($iTimeStamp/86400).' '.$sDays.$sEndReturn; } |
|
| 227 | - if ($iTimeStamp < 31536000) { return $sStartReturn.' '.(int)($iTimeStamp/2592000).' '.$sMonths.$sEndReturn; } |
|
| 228 | - else { return $sStartReturn.' '.(int)($iTimeStamp/31536000).' '.$sYears.$sEndReturn; } |
|
| 224 | + if ($iTimeStamp < 3600) { return $sStartReturn.' '.(int)($iTimeStamp / 60).' '.$sMinutes.$sEndReturn; } |
|
| 225 | + if ($iTimeStamp < 86400) { return $sStartReturn.' '.(int)($iTimeStamp / 3600).' '.$sHours.$sEndReturn; } |
|
| 226 | + if ($iTimeStamp < 2592000) { return $sStartReturn.' '.(int)($iTimeStamp / 86400).' '.$sDays.$sEndReturn; } |
|
| 227 | + if ($iTimeStamp < 31536000) { return $sStartReturn.' '.(int)($iTimeStamp / 2592000).' '.$sMonths.$sEndReturn; } |
|
| 228 | + else { return $sStartReturn.' '.(int)($iTimeStamp / 31536000).' '.$sYears.$sEndReturn; } |
|
| 229 | 229 | } |
| 230 | 230 | } |
@@ -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 | |
@@ -133,8 +133,8 @@ discard block |
||
| 133 | 133 | throw new \Exception(); |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - $sStringToEncode = str_replace(['à','á','â','ã','ä','ç','è','é','ê','ë','ì','í','î','ï','ñ','ò','ó','ô','õ','ö','ù','ú','û','ü','ý','ÿ','À','Á','Â','Ã','Ä','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ñ','Ò','Ó','Ô','Õ','Ö','Ù','Ú','Û','Ü','Ý'], |
|
| 137 | - ['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'], |
|
| 136 | + $sStringToEncode = str_replace(['à', 'á', 'â', 'ã', 'ä', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', 'ù', 'ú', 'û', 'ü', 'ý', 'ÿ', 'À', 'Á', 'Â', 'Ã', 'Ä', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', 'Ù', 'Ú', 'Û', 'Ü', 'Ý'], |
|
| 137 | + ['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 | 138 | $sStringToEncode); |
| 139 | 139 | |
| 140 | 140 | $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,12 +91,12 @@ 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 | $sContent = file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'common'.DIRECTORY_SEPARATOR.'Controller.php'); |
| 102 | 102 | $sContent = str_replace('Batch', $sPortal, $sContent); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | else { |
| 135 | 135 | |
| 136 | - echo 'The Project (private part) ' . $sPrivatePath . " exists\n"; |
|
| 136 | + echo 'The Project (private part) '.$sPrivatePath." exists\n"; |
|
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | public static function get(string $sName, string $sPortal = null, bool $bNoDoRedirect = false) |
| 51 | 51 | { |
| 52 | 52 | $aDirectories = []; |
| 53 | - $sJsonFile=''; |
|
| 53 | + $sJsonFile = ''; |
|
| 54 | 54 | |
| 55 | 55 | if ($bNoDoRedirect === true) { $sNameCache = $sName.'_true'; } else { $sNameCache = $sName; } |
| 56 | 56 | |