Running PHP index without a `.env` setup fails with an unclear error
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 42/100
Línea de trabajo
Empieza ejecutando php index.php sin un archivo .env para reproducir el fallo. Lee index.php y src/model/APNSCredentials.php, especialmente la llamada al constructor y el error de strlen() indicado. Se considera terminado cuando la falta de credenciales produce un mensaje claro sobre la ausencia de .env y sobre cómo configurarlo, en lugar del TypeError actual.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hey @jkmassel, as you know, I'm a PHP noob. So feel free to close this issue if what I'm saying doesn't make sense.
I'm tracking this as an issue rather than a Slack convo because it feels tidier. Also, it might be a chance for me to link a PR to this issue to practice fixing.
After cloning the repo and running Composer, I tried to run php index.php knowing that I had no credentials setup to see the kind of error I'd get. This is what happened
➜ php index.php
=== Push Notification Server ===
PHP Fatal error: Uncaught TypeError: strlen() expects parameter 1 to be string, bool given in /Users/gio/Developer/a8c/php-push/src/model/APNSCredentials.php:12
Stack trace:
#0 /Users/gio/Developer/a8c/php-push/index.php(7): APNSCredentials->__construct(false, false, false)
#1 {main}
thrown in /Users/gio/Developer/a8c/php-push/src/model/APNSCredentials.php on line 12
Fatal error: Uncaught TypeError: strlen() expects parameter 1 to be string, bool given in /Users/gio/Developer/a8c/php-push/src/model/APNSCredentials.php:12
Stack trace:
#0 /Users/gio/Developer/a8c/php-push/index.php(7): APNSCredentials->__construct(false, false, false)
#1 {main}
thrown in /Users/gio/Developer/a8c/php-push/src/model/APNSCredentials.php on line 12
What I would have expected was a message about the missing .env with info on how to set it up.
Granted, for the context of this application, handling as one-off basic task like setting app .env might be overkill. Still worth tracking, though, I think.
- Lenguaje dominante
- PHP
- Estrellas
- 5
- Forks
- 2
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Automattic/php-push
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
Automattic/php-push#31 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
Automattic/php-push#6 · 4 comentarios ·
Todos los issues de Automattic/php-push
Issues similares
-
priority: p3
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
googleapis/librarian#7636 ·
-
0. Needs triage bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
nextcloud/fulltextsearch#1011 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
phpstan/phpstan-doctrine#794 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Automattic/static-site-importer#1767 ·