cvs: phpruntests /src/testcase/sections/configurationsections rtGzipPostSection.php
| From: | Zoe Slattery | Date: | Wed, 29 Apr 2009 18:51:33 +0000 |
| Subject: | cvs: phpruntests /src/testcase/sections/configurationsections rtGzipPostSection.php | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-57386@lists.php.net to get a copy of this message | ||
zoe Wed Apr 29 18:51:33 2009 UTC
Added files:
/phpruntests/src/testcase/sections/configurationsections
rtGzipPostSection.php
Log:
gzip post section class
http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/configurationsections/rtGzipPostSection.php?view=markup&rev=1.1
Index: phpruntests/src/testcase/sections/configurationsections/rtGzipPostSection.php
+++ phpruntests/src/testcase/sections/configurationsections/rtGzipPostSection.php
<?php
/**
* rtPostSection
* Sets environment variables for GZIP_POST section
*
*
* @category Testing
* @package RUNTESTS
* @author Zoe Slattery <zoe@php.net>
* @author Stefan Priebsch <spriebsch@php.net>
* @copyright 2009 The PHP Group
* @license http://www.php.net/license/3_01.txt
PHP License 3.01
* @link http://qa.php.net/
*/
class rtPostSection extends rtConfigurationSection
{
private $postVariables = array();
private $postFileName;
protected function init()
{
$postString = implode('\n', $this->sectionContents);
$gzipPostString = gzencode($postString);
$this->postVariables['CONTENT_TYPE'] =
'application/x-www-form-urlencoded';
$this->postVariables['CONTENT_LENGTH'] = strlen($gzipPostString);
$this->postVariables['REQUEST_METHOD'] = 'POST';
$this->postFileName = tempnam(sys_get_temp_dir(), 'post');
file_put_contents($this->postFileName, $postString);
}
/**
* Additional GET environment variables required by the test
*
* @return array
*/
public function getPostVariables()
{
return $this->postVariables;
}
public function getPostFileName()
{
return $this->postFileName;
}
}
?>