Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| test_diff [2022/09/03 10:16] – créée tutospisto | test_diff [2022/09/03 10:28] (Version actuelle) – tutospisto | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====== Voir la taille d’un répertoire avec une profondeur de 3 ====== | ||
| - | |||
| - | <code bash>du -ha --time --max-depth=2 /home/ | ||
| - | |||
| - | agi php-{mbstring, | ||
| - | mkdir / | ||
| - | | ||
| - | wget https:// | ||
| - | tar xzf phpMyAdmin-4.9.0.1-all-languages.tar.gz --strip-components=1 -C / | ||
| - | cp / | ||
| - | #pour changer la ligne ' | ||
| - | nano / | ||
| - | chmod 660 / | ||
| - | chown -R www-data: | ||
| - | systemctl restart apache2</ | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | <sxh php;> | ||
| - | |||
| - | |||
| - | <?php | ||
| - | // Affichons toutes les erreurs | ||
| - | error_reporting(E_ALL); | ||
| - | |||
| - | $arr = array(' | ||
| - | |||
| - | |||
| - | // Correct | ||
| - | print $arr[' | ||
| - | print $arr[' | ||
| - | |||
| - | // Incorrect. | ||
| - | // on utilise la constante nommée fruit qui est indéfinie | ||
| - | // | ||
| - | // Notice: Use of undefined constant fruit - assumed ' | ||
| - | print $arr[fruit]; | ||
| - | |||
| - | // Ceci définit une constante pour expliquer ce qu'il ne va pas. La valeur ' | ||
| - | // est assignée à la constante nommée fruit. | ||
| - | define(' | ||
| - | |||
| - | // Noter la différence maintenant | ||
| - | print $arr[' | ||
| - | print $arr[fruit]; | ||
| - | |||
| - | // Ce qui suit est correct, car c'est dans une chaîne. Les constantes ne sont pas recherchées | ||
| - | // dans les chaînes, et donc, aucune alerte E_NOTICE ne sera émise | ||
| - | print "Hello $arr[fruit]"; | ||
| - | |||
| - | // Avec une exception : les parenthèses autour d'un tableau dans une chaîne permettent | ||
| - | // aux constantes d' | ||
| - | print "Hello {$arr[fruit]}"; | ||
| - | print "Hello {$arr[' | ||
| - | |||
| - | // Ceci ne fonctionnera pas, et en résultera une erreur d' | ||
| - | // Parse error: parse error, expecting T_STRING' | ||
| - | // Ceci arrive lors de l' | ||
| - | print "Hello $arr[' | ||
| - | print "Hello $_GET[' | ||
| - | |||
| - | // La concaténation est une autre solution | ||
| - | print "Hello " . $arr[' | ||
| - | ?> | ||
| - | |||
| - | |||
| - | |||
| - | </ | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | <code bash>< | ||
| - | |||
| - | |||
| - | agi php-{mbstring, | ||
| - | mkdir / | ||
| - | | ||
| - | wget https:// | ||
| - | tar xzf phpMyAdmin-4.9.0.1-all-languages.tar.gz --strip-components=1 -C / | ||
| - | cp / | ||
| - | #pour changer la ligne ' | ||
| - | nano / | ||
| - | chmod 660 / | ||
| - | chown -R www-data: | ||
| - | systemctl restart apache2</ | ||
| - | |||
| - | |||
| - | |||
| - | <code php> | ||
| - | <?php | ||
| - | // Affichons toutes les erreurs | ||
| - | error_reporting(E_ALL); | ||
| - | |||
| - | $arr = array(' | ||
| - | |||
| - | // Correct | ||
| - | print $arr[' | ||
| - | print $arr[' | ||
| - | |||
| - | // Incorrect. | ||
| - | // on utilise la constante nommée fruit qui est indéfinie | ||
| - | // | ||
| - | // Notice: Use of undefined constant fruit - assumed ' | ||
| - | print $arr[fruit]; | ||
| - | |||
| - | // Ceci définit une constante pour expliquer ce qu'il ne va pas. La valeur ' | ||
| - | // est assignée à la constante nommée fruit. | ||
| - | define(' | ||
| - | |||
| - | // Noter la différence maintenant | ||
| - | print $arr[' | ||
| - | print $arr[fruit]; | ||
| - | |||
| - | // Ce qui suit est correct, car c'est dans une chaîne. Les constantes ne sont pas recherchées | ||
| - | // dans les chaînes, et donc, aucune alerte E_NOTICE ne sera émise | ||
| - | print "Hello $arr[fruit]"; | ||
| - | |||
| - | </ | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | </ | ||
| - | < | ||
| - | <? | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | </ | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | <code php [enable_line_numbers=1, | ||
| - | <?php | ||
| - | // Affichons toutes les erreurs | ||
| - | error_reporting(E_ALL); | ||
| - | |||
| - | $arr = array(' | ||
| - | |||
| - | // Correct | ||
| - | print $arr[' | ||
| - | print $arr[' | ||
| - | |||
| - | // Incorrect. | ||
| - | // on utilise la constante nommée fruit qui est indéfinie | ||
| - | // | ||
| - | // Notice: Use of undefined constant fruit - assumed ' | ||
| - | print $arr[fruit]; | ||
| - | |||
| - | // Ceci définit une constante pour expliquer ce qu'il ne va pas. La valeur ' | ||
| - | // est assignée à la constante nommée fruit. | ||
| - | define(' | ||
| - | |||
| - | // Noter la différence maintenant | ||
| - | print $arr[' | ||
| - | print $arr[fruit]; | ||
| - | |||
| - | // Ce qui suit est correct, car c'est dans une chaîne. Les constantes ne sont pas recherchées | ||
| - | // dans les chaînes, et donc, aucune alerte E_NOTICE ne sera émise | ||
| - | print "Hello $arr[fruit]"; | ||
| - | |||
| - | </ | ||
| - | |||
| - | |||
| - | |||
| <code bash yeah.sh [enable_line_numbers=1, | <code bash yeah.sh [enable_line_numbers=1, | ||
| du -ha --time --max-depth=2 /home/ | du -ha --time --max-depth=2 /home/ | ||