Last active
August 29, 2015 14:02
-
-
Save SebSept/cce51726817b7f00dd74 to your computer and use it in GitHub Desktop.
Script fourni à git bisect pour trouver le commit fautif.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env php | |
<?php | |
// suppression du cache (pas necessaire) | |
`sudo rm -Rf /home/seb/dev/htdocs/perso/lblog/app/storage/cache/*`; | |
// premier appel de la page, pour créer le cache, il faut donc s'assurer que le cache 'file' est bien activé avant. | |
`wget http://localhost/perso/lblog/public/aut-ex-accusantium-quo-tenetur-harum -q -O /tmp/o`; | |
// second appel de la page, contenu stocké dans /tmp/o et header stocké dans /tmp/h, au cas ou la page ne serait pas présente dans la base a se moment (ou non public) | |
`wget http://localhost/perso/lblog/public/aut-ex-accusantium-quo-tenetur-harum -O /tmp/o -o /tmp/h`; | |
$headers = file_get_contents('/tmp/h'); | |
// cas ou on ne peut pas savoir si le bug est présent avec ce script. | |
if(strpos($headers, '404 Not Found')) { | |
print '404'; | |
exit(125); | |
} | |
$file = file_get_contents('/tmp/o'); | |
// le contenu de la page ramenée fait de 50 charactères, la page n'est pas blanche (ce sont des données serialisées) | |
if(strlen($file) > 50 ){ | |
print 'ok'; | |
exit(0); | |
} | |
// sinon (<50 charactères) page blanche. | |
print 'echec'; | |
exit(1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment