test-python-scriptsticket-693
Last change
on this file since f160ff2 was
f160ff2,
checked in by Antonio Emmanuel Guerrero Silva <aguerrero@…>, 8 months ago
|
refs #693 add docker files for test
|
-
Property mode set to
100644
|
File size:
1.9 KB
|
Line | |
---|
1 | <!DOCTYPE html> |
---|
2 | <html lang="en"> |
---|
3 | <head> |
---|
4 | <meta charset="UTF-8"> |
---|
5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
---|
6 | <title>Variables de Entorno y Árbol de Directorio</title> |
---|
7 | </head> |
---|
8 | <body> |
---|
9 | <h1>Variables de Entorno</h1> |
---|
10 | <table border="1" cellpadding="10"> |
---|
11 | <thead> |
---|
12 | <tr> |
---|
13 | <th>Clave</th> |
---|
14 | <th>Valor</th> |
---|
15 | </tr> |
---|
16 | </thead> |
---|
17 | <tbody> |
---|
18 | <?php |
---|
19 | // Obtener todas las variables de entorno |
---|
20 | $env_vars = getenv(); |
---|
21 | |
---|
22 | // Listar cada variable de entorno en una fila de la tabla |
---|
23 | foreach ($env_vars as $key => $value) { |
---|
24 | echo "<tr><td>{$key}</td><td>{$value}</td></tr>"; |
---|
25 | } |
---|
26 | ?> |
---|
27 | </tbody> |
---|
28 | </table> |
---|
29 | |
---|
30 | <h1>Árbol de Directorio de ./client</h1> |
---|
31 | <pre> |
---|
32 | <?php |
---|
33 | // Función para listar el árbol de directorios recursivamente |
---|
34 | function listar_directorios($directorio, $nivel = 0) { |
---|
35 | if (is_dir($directorio)) { |
---|
36 | $items = scandir($directorio); |
---|
37 | foreach ($items as $item) { |
---|
38 | if ($item != '.' && $item != '..') { |
---|
39 | // Imprimir espacios para la jerarquía del árbol |
---|
40 | echo str_repeat(' ', $nivel * 4) . $item . "\n"; |
---|
41 | // Si es un directorio, llamar recursivamente |
---|
42 | if (is_dir($directorio . '/' . $item)) { |
---|
43 | listar_directorios($directorio . '/' . $item, $nivel + 1); |
---|
44 | } |
---|
45 | } |
---|
46 | } |
---|
47 | } else { |
---|
48 | echo "El directorio ./client no existe."; |
---|
49 | } |
---|
50 | } |
---|
51 | |
---|
52 | // Listar el árbol de directorio de ./client |
---|
53 | listar_directorios('/var/www/html/client'); |
---|
54 | ?> |
---|
55 | </pre> |
---|
56 | </body> |
---|
57 | </html> |
---|
58 | |
---|
Note: See
TracBrowser
for help on using the repository browser.