git clone https://gist.github.com/8578209.git try-patchwork-dumper
cd try-patchwork-dumper
composer install
php test-cli.php
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
<?php | |
$len = 1000000; | |
$a = range(1, $len); | |
$f = SplFixedArray::fromArray($a); | |
$s = microtime(1); | |
$i = $len; |
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
<?php | |
// composer require patchwork/dumper '1.0.*' | |
require __DIR__ . '/vendor/autoload.php'; | |
set_debug_handler(function ($var) { | |
$c = new Patchwork\Dumper\Collector\PhpCollector(); | |
$data = $c->collect($var); | |
$data->dump(new Patchwork\Dumper\CliDumper()); | |
}); |
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
git clone https://github.com/nicolas-grekas/Patchwork-PHP-Parser.git ppp | |
cd ppp | |
./bin/ppp t1.php #see below for t1.php (and t2.php, required by t1.php) |
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
<?php | |
if (isset($_GET['i'])) | |
{ | |
// Send a blank gzipped GIF to test browser capability to decode it | |
// See http://www.stevesouders.com/blog/2010/07/12/velocity-forcing-gzip-compression/ | |
header('Content-Type: image/gif'); | |
header('Content-Encoding: deflate'); | |
header('Pragma: no-cache'); |
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
<?php /****************** vi: set fenc=utf-8 ts=4 sw=4 et: ***************** | |
* | |
* Copyright : (C) 2012 Nicolas Grekas. All rights reserved. | |
* Email : p@tchwork.org | |
* License : http://apache.org/licenses/LICENSE-2.0 | |
* | |
* This library is free software; you can redistribute it and/or | |
* modify it under the terms of the Apache License version 2. | |
* | |
***************************************************************************/ |
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
<?php /****************** vi: set fenc=utf-8 ts=4 sw=4 et: ***************** | |
* | |
* Copyright : (C) 2011 Nicolas Grekas. All rights reserved. | |
* Email : p@tchwork.org | |
* License : http://www.gnu.org/licenses/lgpl.txt GNU/LGPL | |
* | |
* This program is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU Lesser General Public License as | |
* published by the Free Software Foundation, either version 3 of the | |
* License, or (at your option) any later version. |
Nicolas Grekas - nicolas.grekas, gmail.com
17 June 2011 - Last updated on 3 sept. 2011
Not updated any more on this gist. See:
Nicolas Grekas - nicolas.grekas, gmail.com
17 juin 2011 - Dernière mise à jour le 3 sept. 2011
Ce gist n'est plus mis à jour. Voir maintenant :
- Version française : https://github.com/nicolas-grekas/Patchwork-Doc/blob/master/Advanced-HTTP-fr.md
NewerOlder