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 <z...@php.net>
 * @author    Stefan Priebsch <sprieb...@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;
    }
}
?>


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to