@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | $this->getModel(); |
| 97 | 97 | |
| 98 | - if (! empty($this->helpers)) { |
|
| 98 | + if (!empty($this->helpers)) { |
|
| 99 | 99 | helper($this->helpers); |
| 100 | 100 | } |
| 101 | 101 | } |
@@ -113,13 +113,13 @@ discard block |
||
| 113 | 113 | $this->modelName = is_object($which) ? null : $which; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - if (empty($this->model) && ! empty($this->modelName) && class_exists($this->modelName)) { |
|
| 116 | + if (empty($this->model) && !empty($this->modelName) && class_exists($this->modelName)) { |
|
| 117 | 117 | $this->model = model($this->modelName, [ |
| 118 | 118 | 'preferApp' => false |
| 119 | 119 | ]); |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - if (! empty($this->model) && empty($this->modelName)) { |
|
| 122 | + if (!empty($this->model) && empty($this->modelName)) { |
|
| 123 | 123 | $this->modelName = get_class($this->model); |
| 124 | 124 | } |
| 125 | 125 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | private function getModel() |
| 159 | 159 | { |
| 160 | - if (! empty($this->modelName)) { |
|
| 160 | + if (!empty($this->modelName)) { |
|
| 161 | 161 | $model = $this->modelName; |
| 162 | 162 | } else { |
| 163 | 163 | $model = str_replace('Controller', 'Model', static::class); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | class DatabaseCollector extends BaseCollector |
| 23 | 23 | { |
| 24 | - /** |
|
| 24 | + /** |
|
| 25 | 25 | * {@inheritDoc} |
| 26 | 26 | */ |
| 27 | 27 | protected $hasTimeline = true; |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| 67 | - /** |
|
| 67 | + /** |
|
| 68 | 68 | * La méthode statique utilisée lors des événements pour collecter des données. |
| 69 | 69 | */ |
| 70 | 70 | public static function collect(Event $event) |
@@ -78,141 +78,141 @@ discard block |
||
| 78 | 78 | // Fournit la valeur par défaut au cas où elle n'est pas définie |
| 79 | 79 | $max = $config->max_queries ?: 100; |
| 80 | 80 | |
| 81 | - if (count(static::$queries) < $max) { |
|
| 81 | + if (count(static::$queries) < $max) { |
|
| 82 | 82 | static::$queries[] = (object) $result->details(); |
| 83 | - } |
|
| 84 | - } |
|
| 85 | - |
|
| 86 | - /** |
|
| 87 | - * {@inheritDoc} |
|
| 88 | - */ |
|
| 89 | - protected function formatTimelineData(): array |
|
| 90 | - { |
|
| 91 | - $data = []; |
|
| 92 | - |
|
| 93 | - foreach ($this->connections as $alias => $connection) { |
|
| 94 | - $data[] = [ |
|
| 95 | - 'name' => 'Connecting to Database: "' . $connection->getDatabase() . '". Config: "' . $alias . '"', |
|
| 96 | - 'component' => 'Database', |
|
| 97 | - 'start' => $connection->getConnectStart(), |
|
| 98 | - 'duration' => $connection->getConnectDuration(), |
|
| 99 | - ]; |
|
| 100 | - } |
|
| 101 | - |
|
| 102 | - foreach (static::$queries as $query) { |
|
| 103 | - $data[] = [ |
|
| 104 | - 'name' => 'Query', |
|
| 105 | - 'component' => 'Database', |
|
| 106 | - 'query' => $query->sql, |
|
| 107 | - 'start' => $query->start, |
|
| 108 | - 'duration' => $query->duration |
|
| 109 | - ]; |
|
| 110 | - } |
|
| 111 | - |
|
| 112 | - return $data; |
|
| 113 | - } |
|
| 83 | + } |
|
| 84 | + } |
|
| 114 | 85 | |
| 115 | 86 | /** |
| 116 | - * {@inheritDoc} |
|
| 117 | - */ |
|
| 118 | - public function display(): array |
|
| 119 | - { |
|
| 120 | - // Mots clés que nous voulons mettre en gras |
|
| 121 | - $highlight = [ |
|
| 122 | - 'SELECT', |
|
| 123 | - 'DISTINCT', |
|
| 124 | - 'FROM', |
|
| 125 | - 'WHERE', |
|
| 126 | - 'AND', |
|
| 127 | - 'INNER JOIN', |
|
| 128 | - 'LEFT JOIN', |
|
| 129 | - 'RIGHT JOIN', |
|
| 130 | - 'JOIN', |
|
| 131 | - 'ORDER BY', |
|
| 132 | - 'ASC', |
|
| 133 | - 'DESC', |
|
| 134 | - 'GROUP BY', |
|
| 135 | - 'LIMIT', |
|
| 136 | - 'INSERT', |
|
| 137 | - 'INTO', |
|
| 138 | - 'VALUES', |
|
| 139 | - 'UPDATE', |
|
| 140 | - 'OR ', |
|
| 141 | - 'HAVING', |
|
| 142 | - 'OFFSET', |
|
| 143 | - 'NOT IN', |
|
| 144 | - 'IN', |
|
| 145 | - 'NOT LIKE', |
|
| 146 | - 'LIKE', |
|
| 147 | - 'COUNT', |
|
| 148 | - 'MAX', |
|
| 149 | - 'MIN', |
|
| 150 | - 'ON', |
|
| 151 | - 'AS', |
|
| 152 | - 'AVG', |
|
| 153 | - 'SUM', |
|
| 154 | - 'UPPER', |
|
| 155 | - 'LOWER', |
|
| 156 | - '(', |
|
| 157 | - ')', |
|
| 158 | - ]; |
|
| 159 | - |
|
| 160 | - $data = [ |
|
| 161 | - 'queries' => [], |
|
| 162 | - ]; |
|
| 87 | + * {@inheritDoc} |
|
| 88 | + */ |
|
| 89 | + protected function formatTimelineData(): array |
|
| 90 | + { |
|
| 91 | + $data = []; |
|
| 92 | + |
|
| 93 | + foreach ($this->connections as $alias => $connection) { |
|
| 94 | + $data[] = [ |
|
| 95 | + 'name' => 'Connecting to Database: "' . $connection->getDatabase() . '". Config: "' . $alias . '"', |
|
| 96 | + 'component' => 'Database', |
|
| 97 | + 'start' => $connection->getConnectStart(), |
|
| 98 | + 'duration' => $connection->getConnectDuration(), |
|
| 99 | + ]; |
|
| 100 | + } |
|
| 101 | + |
|
| 102 | + foreach (static::$queries as $query) { |
|
| 103 | + $data[] = [ |
|
| 104 | + 'name' => 'Query', |
|
| 105 | + 'component' => 'Database', |
|
| 106 | + 'query' => $query->sql, |
|
| 107 | + 'start' => $query->start, |
|
| 108 | + 'duration' => $query->duration |
|
| 109 | + ]; |
|
| 110 | + } |
|
| 111 | + |
|
| 112 | + return $data; |
|
| 113 | + } |
|
| 114 | + |
|
| 115 | + /** |
|
| 116 | + * {@inheritDoc} |
|
| 117 | + */ |
|
| 118 | + public function display(): array |
|
| 119 | + { |
|
| 120 | + // Mots clés que nous voulons mettre en gras |
|
| 121 | + $highlight = [ |
|
| 122 | + 'SELECT', |
|
| 123 | + 'DISTINCT', |
|
| 124 | + 'FROM', |
|
| 125 | + 'WHERE', |
|
| 126 | + 'AND', |
|
| 127 | + 'INNER JOIN', |
|
| 128 | + 'LEFT JOIN', |
|
| 129 | + 'RIGHT JOIN', |
|
| 130 | + 'JOIN', |
|
| 131 | + 'ORDER BY', |
|
| 132 | + 'ASC', |
|
| 133 | + 'DESC', |
|
| 134 | + 'GROUP BY', |
|
| 135 | + 'LIMIT', |
|
| 136 | + 'INSERT', |
|
| 137 | + 'INTO', |
|
| 138 | + 'VALUES', |
|
| 139 | + 'UPDATE', |
|
| 140 | + 'OR ', |
|
| 141 | + 'HAVING', |
|
| 142 | + 'OFFSET', |
|
| 143 | + 'NOT IN', |
|
| 144 | + 'IN', |
|
| 145 | + 'NOT LIKE', |
|
| 146 | + 'LIKE', |
|
| 147 | + 'COUNT', |
|
| 148 | + 'MAX', |
|
| 149 | + 'MIN', |
|
| 150 | + 'ON', |
|
| 151 | + 'AS', |
|
| 152 | + 'AVG', |
|
| 153 | + 'SUM', |
|
| 154 | + 'UPPER', |
|
| 155 | + 'LOWER', |
|
| 156 | + '(', |
|
| 157 | + ')', |
|
| 158 | + ]; |
|
| 159 | + |
|
| 160 | + $data = [ |
|
| 161 | + 'queries' => [], |
|
| 162 | + ]; |
|
| 163 | 163 | |
| 164 | 164 | |
| 165 | - foreach (static::$queries as $query) { |
|
| 166 | - $sql = $query->sql; |
|
| 165 | + foreach (static::$queries as $query) { |
|
| 166 | + $sql = $query->sql; |
|
| 167 | 167 | |
| 168 | - foreach ($highlight as $term) { |
|
| 169 | - $sql = str_replace($term, "<strong>{$term}</strong>", $sql); |
|
| 170 | - } |
|
| 168 | + foreach ($highlight as $term) { |
|
| 169 | + $sql = str_replace($term, "<strong>{$term}</strong>", $sql); |
|
| 170 | + } |
|
| 171 | 171 | |
| 172 | - $data['queries'][] = [ |
|
| 172 | + $data['queries'][] = [ |
|
| 173 | 173 | 'duration' => (number_format($query->duration, 5) * 1000) . ' ms', |
| 174 | 174 | 'sql' => $sql, |
| 175 | 175 | 'affected_rows' => $query->affected_rows |
| 176 | - ]; |
|
| 177 | - } |
|
| 176 | + ]; |
|
| 177 | + } |
|
| 178 | 178 | |
| 179 | - return $data; |
|
| 180 | - } |
|
| 181 | - |
|
| 182 | - /** |
|
| 183 | - * {@inheritDoc} |
|
| 184 | - */ |
|
| 185 | - public function getBadgeValue(): int |
|
| 186 | - { |
|
| 187 | - return count(static::$queries); |
|
| 188 | - } |
|
| 189 | - |
|
| 190 | - /** |
|
| 191 | - * {@inheritDoc} |
|
| 192 | - * |
|
| 193 | - * @return string Le nombre de requêtes (entre parenthèses) ou une chaîne vide. |
|
| 194 | - */ |
|
| 195 | - public function getTitleDetails(): string |
|
| 196 | - { |
|
| 197 | - return '(' . count(static::$queries) . ' Queries across ' . ($countConnection = count($this->connections)) . ' Connection' . |
|
| 198 | - ($countConnection > 1 ? 's' : '') . ')'; |
|
| 199 | - } |
|
| 200 | - |
|
| 201 | - /** |
|
| 202 | - * {@inheritDoc} |
|
| 203 | - */ |
|
| 204 | - public function isEmpty(): bool |
|
| 205 | - { |
|
| 206 | - return empty(static::$queries); |
|
| 207 | - } |
|
| 208 | - |
|
| 209 | - /** |
|
| 210 | - * {@inheritDoc} |
|
| 211 | - */ |
|
| 212 | - public function icon(): string |
|
| 213 | - { |
|
| 214 | - return 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADMSURBVEhLY6A3YExLSwsA4nIycQDIDIhRWEBqamo/UNF/SjDQjF6ocZgAKPkRiFeEhoYyQ4WIBiA9QAuWAPEHqBAmgLqgHcolGQD1V4DMgHIxwbCxYD+QBqcKINseKo6eWrBioPrtQBq/BcgY5ht0cUIYbBg2AJKkRxCNWkDQgtFUNJwtABr+F6igE8olGQD114HMgHIxAVDyAhA/AlpSA8RYUwoeXAPVex5qHCbIyMgwBCkAuQJIY00huDBUz/mUlBQDqHGjgBjAwAAACexpph6oHSQAAAAASUVORK5CYII='; |
|
| 215 | - } |
|
| 179 | + return $data; |
|
| 180 | + } |
|
| 181 | + |
|
| 182 | + /** |
|
| 183 | + * {@inheritDoc} |
|
| 184 | + */ |
|
| 185 | + public function getBadgeValue(): int |
|
| 186 | + { |
|
| 187 | + return count(static::$queries); |
|
| 188 | + } |
|
| 189 | + |
|
| 190 | + /** |
|
| 191 | + * {@inheritDoc} |
|
| 192 | + * |
|
| 193 | + * @return string Le nombre de requêtes (entre parenthèses) ou une chaîne vide. |
|
| 194 | + */ |
|
| 195 | + public function getTitleDetails(): string |
|
| 196 | + { |
|
| 197 | + return '(' . count(static::$queries) . ' Queries across ' . ($countConnection = count($this->connections)) . ' Connection' . |
|
| 198 | + ($countConnection > 1 ? 's' : '') . ')'; |
|
| 199 | + } |
|
| 200 | + |
|
| 201 | + /** |
|
| 202 | + * {@inheritDoc} |
|
| 203 | + */ |
|
| 204 | + public function isEmpty(): bool |
|
| 205 | + { |
|
| 206 | + return empty(static::$queries); |
|
| 207 | + } |
|
| 208 | + |
|
| 209 | + /** |
|
| 210 | + * {@inheritDoc} |
|
| 211 | + */ |
|
| 212 | + public function icon(): string |
|
| 213 | + { |
|
| 214 | + return 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADMSURBVEhLY6A3YExLSwsA4nIycQDIDIhRWEBqamo/UNF/SjDQjF6ocZgAKPkRiFeEhoYyQ4WIBiA9QAuWAPEHqBAmgLqgHcolGQD1V4DMgHIxwbCxYD+QBqcKINseKo6eWrBioPrtQBq/BcgY5ht0cUIYbBg2AJKkRxCNWkDQgtFUNJwtABr+F6igE8olGQD114HMgHIxAVDyAhA/AlpSA8RYUwoeXAPVex5qHCbIyMgwBCkAuQJIY00huDBUz/mUlBQDqHGjgBjAwAAACexpph6oHSQAAAAASUVORK5CYII='; |
|
| 215 | + } |
|
| 216 | 216 | |
| 217 | 217 | /** |
| 218 | 218 | * Obtient les connexions à partir de la configuration de la base de données |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | public function display(): array |
| 119 | 119 | { |
| 120 | 120 | // Mots clés que nous voulons mettre en gras |
| 121 | - $highlight = [ |
|
| 121 | + $highlight = [ |
|
| 122 | 122 | 'SELECT', |
| 123 | 123 | 'DISTINCT', |
| 124 | 124 | 'FROM', |
@@ -80,9 +80,9 @@ |
||
| 80 | 80 | $session = Services::session(); |
| 81 | 81 | |
| 82 | 82 | $session->setFlashdata('_blitz_old_input', [ |
| 83 | - 'get' => $_GET ?? [], |
|
| 84 | - 'post' => $_POST ?? [], |
|
| 85 | - ]); |
|
| 83 | + 'get' => $_GET ?? [], |
|
| 84 | + 'post' => $_POST ?? [], |
|
| 85 | + ]); |
|
| 86 | 86 | |
| 87 | 87 | // Si la validation contient des erreurs, retransmettez-les |
| 88 | 88 | // afin qu'ils puissent être affichés lors de la validation |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | { |
| 71 | 71 | helper('assets'); |
| 72 | 72 | |
| 73 | - if (! empty($viewPathLocator)) { |
|
| 73 | + if (!empty($viewPathLocator)) { |
|
| 74 | 74 | if (is_string($viewPathLocator)) { |
| 75 | 75 | $this->viewPath = rtrim($viewPathLocator, '\\/ ') . DS; |
| 76 | 76 | } |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | $options = (array) $options; |
| 224 | 224 | |
| 225 | 225 | $viewPath = $options['viewPath'] ?? $this->viewPath; |
| 226 | - if (! empty($viewPath)) { |
|
| 226 | + if (!empty($viewPath)) { |
|
| 227 | 227 | $file = str_replace('/', DS, rtrim($viewPath, '/\\') . DS . ltrim($view, '/\\')); |
| 228 | 228 | } |
| 229 | 229 | else { |
@@ -232,12 +232,12 @@ discard block |
||
| 232 | 232 | |
| 233 | 233 | $file = Helpers::ensureExt($file, $ext); |
| 234 | 234 | |
| 235 | - if (! is_file($file) && $this->locator instanceof Locator) { |
|
| 235 | + if (!is_file($file) && $this->locator instanceof Locator) { |
|
| 236 | 236 | $file = $this->locator->locateFile($view, 'Views', empty($ext) ? 'php' : $ext); |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | // locateFile renverra une chaîne vide si le fichier est introuvable. |
| 240 | - if (! is_file($file)) { |
|
| 240 | + if (!is_file($file)) { |
|
| 241 | 241 | throw ViewException::invalidFile($view); |
| 242 | 242 | } |
| 243 | 243 | |
@@ -73,12 +73,10 @@ discard block |
||
| 73 | 73 | if (! empty($viewPathLocator)) { |
| 74 | 74 | if (is_string($viewPathLocator)) { |
| 75 | 75 | $this->viewPath = rtrim($viewPathLocator, '\\/ ') . DS; |
| 76 | - } |
|
| 77 | - else if ($viewPathLocator instanceof Locator) { |
|
| 76 | + } else if ($viewPathLocator instanceof Locator) { |
|
| 78 | 77 | $this->locator = $viewPathLocator; |
| 79 | 78 | } |
| 80 | - } |
|
| 81 | - else { |
|
| 79 | + } else { |
|
| 82 | 80 | $this->locator = Services::locator(); |
| 83 | 81 | } |
| 84 | 82 | } |
@@ -225,8 +223,7 @@ discard block |
||
| 225 | 223 | $viewPath = $options['viewPath'] ?? $this->viewPath; |
| 226 | 224 | if (! empty($viewPath)) { |
| 227 | 225 | $file = str_replace('/', DS, rtrim($viewPath, '/\\') . DS . ltrim($view, '/\\')); |
| 228 | - } |
|
| 229 | - else { |
|
| 226 | + } else { |
|
| 230 | 227 | $file = $view; |
| 231 | 228 | } |
| 232 | 229 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | // ================================= FONCTIONS D'ACCESSIBILITE ================================= // |
| 26 | 26 | |
| 27 | -if (! function_exists('env')) { |
|
| 27 | +if (!function_exists('env')) { |
|
| 28 | 28 | /** |
| 29 | 29 | * Obtient une variable d'environnement à partir des sources disponibles et fournit une émulation |
| 30 | 30 | * pour les variables d'environnement non prises en charge ou incohérentes |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | -if (! function_exists('helper')) { |
|
| 43 | +if (!function_exists('helper')) { |
|
| 44 | 44 | /** |
| 45 | 45 | * Charge un fichier d'aide en mémoire. Prend en charge les assistants d'espace de noms, |
| 46 | 46 | * à la fois dans et hors du répertoire 'helpers' d'un répertoire à espace de noms. |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | -if (! function_exists('model')) { |
|
| 61 | +if (!function_exists('model')) { |
|
| 62 | 62 | /** |
| 63 | 63 | * Simple maniere d'obtenir un modele. |
| 64 | 64 | * |
@@ -68,13 +68,13 @@ discard block |
||
| 68 | 68 | * |
| 69 | 69 | * @return T |
| 70 | 70 | */ |
| 71 | - function model(string|array $name, array $options = [], ?ConnectionInterface &$conn = null) |
|
| 71 | + function model(string|array $name, array $options = [], ?ConnectionInterface&$conn = null) |
|
| 72 | 72 | { |
| 73 | 73 | return Load::model($name, $options, $conn); |
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | -if (! function_exists('service')) { |
|
| 77 | +if (!function_exists('service')) { |
|
| 78 | 78 | /** |
| 79 | 79 | * Permet un accès plus propre au fichier de configuration des services. |
| 80 | 80 | * Renvoie toujours une instance SHARED de la classe, donc |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | -if (! function_exists('single_service')) { |
|
| 94 | +if (!function_exists('single_service')) { |
|
| 95 | 95 | /** |
| 96 | 96 | * Autoriser l'accès propre à un service. |
| 97 | 97 | * Renvoie toujours une nouvelle instance de la classe. |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | -if (! function_exists('show404')) { |
|
| 108 | +if (!function_exists('show404')) { |
|
| 109 | 109 | /** |
| 110 | 110 | * Afficher une page 404 introuvable dans le navigateur |
| 111 | 111 | */ |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | -if (! function_exists('config')) { |
|
| 118 | +if (!function_exists('config')) { |
|
| 119 | 119 | /** |
| 120 | 120 | * GET/SET App config |
| 121 | 121 | * |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | function config(string $config, $value = null, bool $force_set = false) |
| 127 | 127 | { |
| 128 | - if (! empty($value) || (empty($value) && true === $force_set)) { |
|
| 128 | + if (!empty($value) || (empty($value) && true === $force_set)) { |
|
| 129 | 129 | Config::set($config, $value); |
| 130 | 130 | } |
| 131 | 131 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | // =========================== FONCTIONS DE PREVENTION D'ATTAQUE =========================== // |
| 137 | 137 | |
| 138 | -if (! function_exists('esc')) { |
|
| 138 | +if (!function_exists('esc')) { |
|
| 139 | 139 | /** |
| 140 | 140 | * Effectue un simple échappement automatique des données pour des raisons de sécurité. |
| 141 | 141 | * Pourrait envisager de rendre cela plus complexe à une date ultérieure. |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | } |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | -if (! function_exists('h')) { |
|
| 165 | +if (!function_exists('h')) { |
|
| 166 | 166 | /** |
| 167 | 167 | * Méthode pratique pour htmlspecialchars. |
| 168 | 168 | * |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | -if (! function_exists('purify')) { |
|
| 184 | +if (!function_exists('purify')) { |
|
| 185 | 185 | /** |
| 186 | 186 | * Purifiez l'entrée à l'aide de la classe autonome HTMLPurifier. |
| 187 | 187 | * Utilisez facilement plusieurs configurations de purificateur. |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | } |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | -if (! function_exists('remove_invisible_characters')) { |
|
| 202 | +if (!function_exists('remove_invisible_characters')) { |
|
| 203 | 203 | /** |
| 204 | 204 | * Supprimer les caractères invisibles |
| 205 | 205 | * |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | -if (! function_exists('stringify_attributes')) { |
|
| 215 | +if (!function_exists('stringify_attributes')) { |
|
| 216 | 216 | /** |
| 217 | 217 | * Chaîner les attributs à utiliser dans les balises HTML. |
| 218 | 218 | * |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | |
| 227 | 227 | // ================================= FONCTIONS D'ENVIRONNEMENT D'EXECUTION ================================= // |
| 228 | 228 | |
| 229 | -if (! function_exists('on_dev')) { |
|
| 229 | +if (!function_exists('on_dev')) { |
|
| 230 | 230 | /** |
| 231 | 231 | * Testez pour voir si nous sommes dans un environnement de développement. |
| 232 | 232 | */ |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | } |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | -if (! function_exists('on_prod')) { |
|
| 245 | +if (!function_exists('on_prod')) { |
|
| 246 | 246 | /** |
| 247 | 247 | * Testez pour voir si nous sommes dans un environnement de production. |
| 248 | 248 | */ |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | } |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | -if (! function_exists('on_test')) { |
|
| 261 | +if (!function_exists('on_test')) { |
|
| 262 | 262 | /** |
| 263 | 263 | * Testez pour voir si nous sommes dans un environnement de test |
| 264 | 264 | */ |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | } |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | -if (! function_exists('is_cli')) { |
|
| 273 | +if (!function_exists('is_cli')) { |
|
| 274 | 274 | /** |
| 275 | 275 | * Testez pour voir si une demande a été faite à partir de la ligne de commande. |
| 276 | 276 | */ |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | } |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | -if (! function_exists('is_php')) { |
|
| 283 | +if (!function_exists('is_php')) { |
|
| 284 | 284 | /** |
| 285 | 285 | * Détermine si la version actuelle de PHP est égale ou supérieure à la valeur fournie. |
| 286 | 286 | */ |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | } |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | -if (! function_exists('is_windows')) { |
|
| 293 | +if (!function_exists('is_windows')) { |
|
| 294 | 294 | /** |
| 295 | 295 | * Déterminez si l'environnement actuel est basé sur Windows. |
| 296 | 296 | */ |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | } |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | -if (! function_exists('is_https')) { |
|
| 303 | +if (!function_exists('is_https')) { |
|
| 304 | 304 | /** |
| 305 | 305 | * Determines if the application is accessed via an encrypted * (HTTPS) connection. |
| 306 | 306 | */ |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | } |
| 311 | 311 | } |
| 312 | 312 | |
| 313 | -if (! function_exists('is_localfile')) { |
|
| 313 | +if (!function_exists('is_localfile')) { |
|
| 314 | 314 | /** |
| 315 | 315 | * Vérifiez si le fichier auquel vous souhaitez accéder est un fichier local de votre application ou non |
| 316 | 316 | */ |
@@ -320,11 +320,11 @@ discard block |
||
| 320 | 320 | return true; |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | - return ! preg_match('#^(https?://)#i', $name); |
|
| 323 | + return !preg_match('#^(https?://)#i', $name); |
|
| 324 | 324 | } |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | -if (! function_exists('is_online')) { |
|
| 327 | +if (!function_exists('is_online')) { |
|
| 328 | 328 | /** |
| 329 | 329 | * Tester si l'application s'exécute en local ou en ligne. |
| 330 | 330 | */ |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | } |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | -if (! function_exists('is_connected')) { |
|
| 337 | +if (!function_exists('is_connected')) { |
|
| 338 | 338 | /** |
| 339 | 339 | * Verifie si l'utilisateur a une connexion internet active. |
| 340 | 340 | */ |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | } |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | -if (! function_exists('is_ajax_request')) { |
|
| 347 | +if (!function_exists('is_ajax_request')) { |
|
| 348 | 348 | /** |
| 349 | 349 | * Testez pour voir si une requête contient l'en-tête HTTP_X_REQUESTED_WITH. |
| 350 | 350 | */ |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | } |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | -if (! function_exists('redirection')) { |
|
| 357 | +if (!function_exists('redirection')) { |
|
| 358 | 358 | /** |
| 359 | 359 | * Redirige l'utilisateur |
| 360 | 360 | */ |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | } |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | -if (! function_exists('redirect')) { |
|
| 371 | +if (!function_exists('redirect')) { |
|
| 372 | 372 | /** |
| 373 | 373 | * Méthode pratique qui fonctionne avec la $request globale actuelle et |
| 374 | 374 | * l'instance $router à rediriger à l'aide de routes nommées et le routage inversé |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | { |
| 383 | 383 | $redirection = Services::redirection(); |
| 384 | 384 | |
| 385 | - if (! empty($uri)) { |
|
| 385 | + if (!empty($uri)) { |
|
| 386 | 386 | return $redirection->route($uri); |
| 387 | 387 | } |
| 388 | 388 | |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | } |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | -if (! function_exists('link_to')) { |
|
| 393 | +if (!function_exists('link_to')) { |
|
| 394 | 394 | /** |
| 395 | 395 | * Étant donné une chaîne de contrôleur/méthode et tous les paramètres, |
| 396 | 396 | * tentera de créer l'URL relative à la route correspondante. |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | } |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | -if (! function_exists('clean_path')) { |
|
| 409 | +if (!function_exists('clean_path')) { |
|
| 410 | 410 | /** |
| 411 | 411 | * Une méthode pratique pour nettoyer les chemins pour |
| 412 | 412 | * une sortie plus belle. Utile pour les exceptions |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | |
| 438 | 438 | // ================================= FONCTIONS DE DEBOGAGE ================================= // |
| 439 | 439 | |
| 440 | -if (! function_exists('dd')) { |
|
| 440 | +if (!function_exists('dd')) { |
|
| 441 | 441 | /** |
| 442 | 442 | * Prints a Kint debug report and exits. |
| 443 | 443 | * |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | } |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | -if (! function_exists('dump')) { |
|
| 459 | +if (!function_exists('dump')) { |
|
| 460 | 460 | /** |
| 461 | 461 | * Prints a Kint debug report and exits. |
| 462 | 462 | * |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | } |
| 474 | 474 | } |
| 475 | 475 | |
| 476 | -if (! function_exists('deprecationWarning')) { |
|
| 476 | +if (!function_exists('deprecationWarning')) { |
|
| 477 | 477 | /** |
| 478 | 478 | * Méthode d'assistance pour générer des avertissements d'obsolescence |
| 479 | 479 | * |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | } |
| 490 | 490 | } |
| 491 | 491 | |
| 492 | -if (! function_exists('logger')) { |
|
| 492 | +if (!function_exists('logger')) { |
|
| 493 | 493 | /** |
| 494 | 494 | * A convenience/compatibility method for logging events through |
| 495 | 495 | * the Log system. |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | { |
| 513 | 513 | $logger = Services::logger(); |
| 514 | 514 | |
| 515 | - if (! empty($level) && ! empty($message)) { |
|
| 515 | + if (!empty($level) && !empty($message)) { |
|
| 516 | 516 | return $logger->log($level, $message, $context); |
| 517 | 517 | } |
| 518 | 518 | |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | } |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | -if (! function_exists('cache')) { |
|
| 523 | +if (!function_exists('cache')) { |
|
| 524 | 524 | /** |
| 525 | 525 | * Une méthode pratique qui donne accès au cache |
| 526 | 526 | * objet. Si aucun paramètre n'est fourni, renverra l'objet, |
@@ -550,7 +550,7 @@ discard block |
||
| 550 | 550 | } |
| 551 | 551 | } |
| 552 | 552 | |
| 553 | -if (! function_exists('session')) { |
|
| 553 | +if (!function_exists('session')) { |
|
| 554 | 554 | /** |
| 555 | 555 | * Une méthode pratique pour accéder à l'instance de session, ou un élément qui a été défini dans la session. |
| 556 | 556 | * |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | } |
| 574 | 574 | } |
| 575 | 575 | |
| 576 | -if (! function_exists('pr')) { |
|
| 576 | +if (!function_exists('pr')) { |
|
| 577 | 577 | /** |
| 578 | 578 | * print_r() convenience function. |
| 579 | 579 | * |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | } |
| 596 | 596 | } |
| 597 | 597 | |
| 598 | -if (! function_exists('pj')) { |
|
| 598 | +if (!function_exists('pj')) { |
|
| 599 | 599 | /** |
| 600 | 600 | * json pretty print convenience function. |
| 601 | 601 | * |
@@ -616,7 +616,7 @@ discard block |
||
| 616 | 616 | } |
| 617 | 617 | } |
| 618 | 618 | |
| 619 | -if (! function_exists('trigger_warning')) { |
|
| 619 | +if (!function_exists('trigger_warning')) { |
|
| 620 | 620 | /** |
| 621 | 621 | * Déclenche un E_USER_WARNING. |
| 622 | 622 | */ |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | } |
| 627 | 627 | } |
| 628 | 628 | |
| 629 | -if (! function_exists('vd')) { |
|
| 629 | +if (!function_exists('vd')) { |
|
| 630 | 630 | /** |
| 631 | 631 | * Shortcut to ref, HTML mode |
| 632 | 632 | * |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | } |
| 639 | 639 | } |
| 640 | 640 | |
| 641 | -if (! function_exists('vdt')) { |
|
| 641 | +if (!function_exists('vdt')) { |
|
| 642 | 642 | /** |
| 643 | 643 | * Shortcut to ref, plain text mode |
| 644 | 644 | * |
@@ -652,7 +652,7 @@ discard block |
||
| 652 | 652 | |
| 653 | 653 | // ================================= FONCTIONS DIVERSES ================================= // |
| 654 | 654 | |
| 655 | -if (! function_exists('force_https')) { |
|
| 655 | +if (!function_exists('force_https')) { |
|
| 656 | 656 | /** |
| 657 | 657 | * Utilisé pour forcer l'accès à une page via HTTPS. |
| 658 | 658 | * Utilise une redirection standard, plus définira l'en-tête HSTS |
@@ -710,7 +710,7 @@ discard block |
||
| 710 | 710 | } |
| 711 | 711 | } |
| 712 | 712 | |
| 713 | -if (! function_exists('getTypeName')) { |
|
| 713 | +if (!function_exists('getTypeName')) { |
|
| 714 | 714 | /** |
| 715 | 715 | * Renvoie la classe d'objets ou le type var de ce n'est pas un objet |
| 716 | 716 | * |
@@ -724,7 +724,7 @@ discard block |
||
| 724 | 724 | } |
| 725 | 725 | } |
| 726 | 726 | |
| 727 | -if (! function_exists('ip_address')) { |
|
| 727 | +if (!function_exists('ip_address')) { |
|
| 728 | 728 | /** |
| 729 | 729 | * Renvoie l'adresse IP de l'utilisateur actuel |
| 730 | 730 | */ |
@@ -734,7 +734,7 @@ discard block |
||
| 734 | 734 | } |
| 735 | 735 | } |
| 736 | 736 | |
| 737 | -if (! function_exists('is_really_writable')) { |
|
| 737 | +if (!function_exists('is_really_writable')) { |
|
| 738 | 738 | /** |
| 739 | 739 | * Tests d'inscriptibilité des fichiers |
| 740 | 740 | */ |
@@ -744,7 +744,7 @@ discard block |
||
| 744 | 744 | } |
| 745 | 745 | } |
| 746 | 746 | |
| 747 | -if (! function_exists('lang')) { |
|
| 747 | +if (!function_exists('lang')) { |
|
| 748 | 748 | /** |
| 749 | 749 | * Une méthode pratique pour traduire une chaîne ou un tableau d'entrées et formater |
| 750 | 750 | * le résultat avec le MessageFormatter de l'extension intl. |
@@ -755,7 +755,7 @@ discard block |
||
| 755 | 755 | } |
| 756 | 756 | } |
| 757 | 757 | |
| 758 | -if (! function_exists('namespace_split')) { |
|
| 758 | +if (!function_exists('namespace_split')) { |
|
| 759 | 759 | /** |
| 760 | 760 | * Séparez l'espace de noms du nom de classe. |
| 761 | 761 | * |
@@ -776,7 +776,7 @@ discard block |
||
| 776 | 776 | } |
| 777 | 777 | } |
| 778 | 778 | |
| 779 | -if (! function_exists('view_exist')) { |
|
| 779 | +if (!function_exists('view_exist')) { |
|
| 780 | 780 | /** |
| 781 | 781 | * Verifie si un fichier de vue existe. Utile pour limiter les failles include |
| 782 | 782 | */ |
@@ -790,7 +790,7 @@ discard block |
||
| 790 | 790 | } |
| 791 | 791 | } |
| 792 | 792 | |
| 793 | -if (! function_exists('view')) { |
|
| 793 | +if (!function_exists('view')) { |
|
| 794 | 794 | /** |
| 795 | 795 | * Charge une vue |
| 796 | 796 | * |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | } |
| 807 | 807 | } |
| 808 | 808 | |
| 809 | -if (! function_exists('flash')) { |
|
| 809 | +if (!function_exists('flash')) { |
|
| 810 | 810 | /** |
| 811 | 811 | * Fournisseur d'acces rapide a la classe PHP Flash |
| 812 | 812 | * |
@@ -838,7 +838,7 @@ discard block |
||
| 838 | 838 | }*/ |
| 839 | 839 | } |
| 840 | 840 | |
| 841 | -if (! function_exists('geo_ip')) { |
|
| 841 | +if (!function_exists('geo_ip')) { |
|
| 842 | 842 | /** |
| 843 | 843 | * Recuperation des coordonnees (pays, ville, etc) d'un utilisateur en fonction de son ip |
| 844 | 844 | */ |
@@ -848,7 +848,7 @@ discard block |
||
| 848 | 848 | } |
| 849 | 849 | } |
| 850 | 850 | |
| 851 | -if (! function_exists('to_stream')) { |
|
| 851 | +if (!function_exists('to_stream')) { |
|
| 852 | 852 | /** |
| 853 | 853 | * Créez un nouveau flux basé sur le type d'entrée. |
| 854 | 854 | * |
@@ -871,7 +871,7 @@ discard block |
||
| 871 | 871 | } |
| 872 | 872 | } |
| 873 | 873 | |
| 874 | -if (! function_exists('value')) { |
|
| 874 | +if (!function_exists('value')) { |
|
| 875 | 875 | /** |
| 876 | 876 | * Renvoie la valeur par défaut de la valeur donnée. |
| 877 | 877 | */ |
@@ -881,7 +881,7 @@ discard block |
||
| 881 | 881 | } |
| 882 | 882 | } |
| 883 | 883 | |
| 884 | -if (! function_exists('collect')) { |
|
| 884 | +if (!function_exists('collect')) { |
|
| 885 | 885 | /** |
| 886 | 886 | * Créez une collection à partir de la valeur donnée. |
| 887 | 887 | */ |
@@ -891,7 +891,7 @@ discard block |
||
| 891 | 891 | } |
| 892 | 892 | } |
| 893 | 893 | |
| 894 | -if (! function_exists('with')) { |
|
| 894 | +if (!function_exists('with')) { |
|
| 895 | 895 | /** |
| 896 | 896 | * Renvoie la valeur donnée, éventuellement transmise via le rappel donné. |
| 897 | 897 | * |
@@ -903,7 +903,7 @@ discard block |
||
| 903 | 903 | } |
| 904 | 904 | } |
| 905 | 905 | |
| 906 | -if (! function_exists('tap')) { |
|
| 906 | +if (!function_exists('tap')) { |
|
| 907 | 907 | /** |
| 908 | 908 | * Appelez la Closure donnée avec cette instance puis renvoyez l'instance. |
| 909 | 909 | */ |