Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php /** * This php file is used to unit test Piwik::serverStaticFile() * Unit tests fo..

Decoded Output download

<?php /**
 * This php file is used to unit test Piwik::serverStaticFile()
 * Unit tests for this method should normally be located in /tests/core/Piwik.test.php
 * To make a comprehensive test suit for Piwik::serverStaticFile() (ie. being able to test combinations of request
 * headers, being able to test response headers and so on) we need to simulate static file requests in a controlled
 * environment
 * The php code which simulates requests using Piwik::serverStaticFile() is provided in the same file (ie. this one)
 * as the unit testing code for Piwik::serverStaticFile()
 * This decision has a structural impact on the usual unit test file structure
 * serverStaticFile.test.php has been created to avoid making too many modifications to /tests/core/Piwik.test.php
 */ namespace Piwik\Tests\Integration;use Exception;use Piwik\ProxyHttp;use Piwik\SettingsServer;use Piwik\Tests\Framework\Fixture;define(base64_decode('VEVTVF9GSUxFX0xPQ0FUSU9O'),realpath(dirname(__FILE__).base64_decode('Ly4uLy4uL3Jlc291cmNlcy9saXBzdW0udHh0')));define(base64_decode('VEVTVF9GSUxFX0NPTlRFTlRfVFlQRQ=='),base64_decode('dGV4dC9wbGFpbg=='));define(base64_decode('RklMRV9NT0RFX1JFUVVFU1RfVkFS'),base64_decode('ZmlsZU1vZGU='));define(base64_decode('U1JWX01PREVfUkVRVUVTVF9WQVI='),base64_decode('c2VydmVyTW9kZQ=='));define(base64_decode('WkxJQl9PVVRQVVRfUkVRVUVTVF9WQVI='),base64_decode('emxpYk91dHB1dA=='));/**
 * These constants define the mode in which this php file is used :
 * - for unit testing Piwik::serverStaticFile() or
 * - as a static file server
 */ define(base64_decode('U1RBVElDX1NFUlZFUl9NT0RF'),base64_decode('c3RhdGljU2VydmVyTW9kZQ=='));define(base64_decode('VU5JVF9URVNUX01PREU='),base64_decode('dW5pdFRlc3RNb2Rl'));define(base64_decode('TlVMTF9GSUxFX1NSVl9NT0RF'),base64_decode('bnVsbEZpbGU='));define(base64_decode('R0hPU1RfRklMRV9TUlZfTU9ERQ=='),base64_decode('Z2hvc3RGaWxl'));define(base64_decode('VEVTVF9GSUxFX1NSVl9NT0RF'),base64_decode('dGVzdEZpbGU='));define(base64_decode('UEFSVElBTF9URVNUX0ZJTEVfU1JWX01PREU='),base64_decode('cGFydGlhbFRlc3RGaWxl'));define(base64_decode('V0hPTEVfVEVTVF9GSUxFX1dJVEhfUkFOR0VfU1JWX01PREU='),base64_decode('d2hvbGVUZXN0RmlsZVdpdGhSYW5nZQ=='));define(base64_decode('UEFSVElBTF9CWVRFX1NUQVJU'),1204);define(base64_decode('UEFSVElBTF9CWVRFX0VORA=='),14724);class afwu1e extends ynm1f
mwd20vdz21{public function uzri0():void{parent::uzri0();if(!chmod(TEST_FILE_LOCATION,0644)){throw new mklf22(base64_decode('Q291bGQgbm90IGNobW9kIDA2NDQg').TEST_FILE_LOCATION);}}/**
     * Test that php compression isn't enabled ... otherwise, lots of tests will fail
     *
     * @group Core
     */ public function rhxe1(){$this->dcfd23(ProxyHttp::krab24());}/**
     * Checks that "HTTP/1.0 404 Not Found" is returned when Piwik::serverStaticFile is called with a null file
     *
     * @group Core
     */ public function retq2(){$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->rtph11());curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_exec($arjv25);$svxz26=curl_getinfo($arjv25);curl_close($arjv25);$this->gjzj27($svxz26[base64_decode('aHR0cF9jb2Rl')],404);}/**
     * Checks that "HTTP/1.0 404 Not Found" is returned when Piwik::serverStaticFile is called with a non existing file
     *
     *
     * @group Core
     */ public function npuz3(){$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->eowt12());curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_exec($arjv25);$svxz26=curl_getinfo($arjv25);curl_close($arjv25);$this->gjzj27($svxz26[base64_decode('aHR0cF9jb2Rl')],404);}/**
     * Checks that "HTTP/1.0 505 Internal server error" is returned when Piwik::serverStaticFile is called with a
     * non-readable file
     *
     * @group Core
     */ public function mvzl4(){/**
         * This test would fail on a windows environment because it is not possible to remove reading rights on a
         * windows file using PHP.
         */ if(SettingsServer::ogqa28()){return;}chmod(TEST_FILE_LOCATION,0200);$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$edjv29=$this->wjtr13());curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_exec($arjv25);$svxz26=curl_getinfo($arjv25);curl_close($arjv25);chmod(TEST_FILE_LOCATION,0644);$this->gjzj27($svxz26[base64_decode('aHR0cF9jb2Rl')],500);}/**
     * Context :
     *  - First access to test file
     *  - zlib.output_compression = 0
     *  - no compression
     * Expected :
     *  - file is send back without compression
     *  - cache control headers are correctly set
     *
     * @group Core
     */ public function gpwl5(){$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->wjtr13());curl_setopt($arjv25,CURLOPT_HEADER,true);curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);$mszj2a=curl_exec($arjv25);$svxz26=curl_getinfo($arjv25);curl_close($arjv25);$this->gjzj27(200,$svxz26[base64_decode('aHR0cF9jb2Rl')]);self::vcwg2b(TEST_FILE_CONTENT_TYPE,$svxz26[base64_decode('Y29udGVudF90eXBl')]);$this->itsz2c($this->duam17($mszj2a));$this->gjzj27(filesize(TEST_FILE_LOCATION),$svxz26[base64_decode('c2l6ZV9kb3dubG9hZA==')]);$this->gjzj27(gmdate(base64_decode('RCwgZCBNIFkgSDppOnM='),filemtime(TEST_FILE_LOCATION)).base64_decode('IEdNVA=='),$this->plil1b($mszj2a));$this->gjzj27(base64_decode('cHVibGljLCBtdXN0LXJldmFsaWRhdGU='),$this->kpae18($mszj2a));$hylw2d=$this->bchc19($mszj2a);$this->ukeg2e($hylw2d==null||$hylw2d==base64_decode('UHJhZ21hOg=='));$ofxy2f=$this->dcpf1a($mszj2a);$this->ukeg2e(strtotime($ofxy2f)>time()+99*86400);}/**
     * Context :
     *  - Second access to test file
     *  - If-Modified-Since set to test file modification date
     * Expected :
     *  - "HTTP/1.1 304 Not Modified" sent back to client
     *
     * @group Core
     */ public function jttc6(){$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->wjtr13());curl_setopt($arjv25,CURLOPT_TIMECONDITION,1);curl_setopt($arjv25,CURLOPT_TIMEVALUE,filemtime(TEST_FILE_LOCATION));curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_exec($arjv25);$svxz26=curl_getinfo($arjv25);curl_close($arjv25);$this->gjzj27($svxz26[base64_decode('aHR0cF9jb2Rl')],304);}/**
     * Context :
     *  - Second access to test file
     *  - If-Modified-Since set to test file modification date minus 1 second
     * Expected :
     *  - http return code 200 sent back to client
     *
     * @group Core
     */ public function oiaa7(){$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->wjtr13());curl_setopt($arjv25,CURLOPT_TIMECONDITION,1);curl_setopt($arjv25,CURLOPT_TIMEVALUE,filemtime(TEST_FILE_LOCATION)-1);curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_exec($arjv25);$svxz26=curl_getinfo($arjv25);curl_close($arjv25);$this->gjzj27($svxz26[base64_decode('aHR0cF9jb2Rl')],200);}/**
     * Context :
     *  - First access to file
     *  - zlib output compression is on
     * Expected :
     *  - the response has to be readable, it tests the proxy doesn't compress the file when compression
     *      is enabled in php.
     *
     * @group Core
     */ public function atly8(){$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->bwtu16(($this->wjtr13())));curl_setopt($arjv25,CURLOPT_ENCODING,'');curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);$mszj2a=curl_exec($arjv25);curl_close($arjv25);$this->gjzj27($mszj2a,file_get_contents(TEST_FILE_LOCATION));}/**
     * Context :
     *  - First access to file
     *  - Content-Encoding: deflate
     * Expected :
     *  - the response has to be readable
     *  - the compression method used must be gzdeflate and not gzcompression to be IE compatible
     *
     * @group Core
     */ public function drwt9(){$this->jstp1d();$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->wjtr13());curl_setopt($arjv25,CURLOPT_ENCODING,base64_decode('ZGVmbGF0ZQ=='));curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);$mszj2a=curl_exec($arjv25);curl_close($arjv25);$this->gjzj27($mszj2a,file_get_contents(TEST_FILE_LOCATION));$ncha30=$this->dmba1c().base64_decode('LmRlZmxhdGU=');$this->bdxd31($ncha30);$this->gjzj27(gzinflate(file_get_contents($ncha30)),file_get_contents(TEST_FILE_LOCATION));$this->jstp1d();}/**
     * Context :
     *  - First access to file
     *  - Content-Encoding: gzip
     * Expected :
     *  - the response has to be readable
     *  - the compression method used is gzip
     *
     * @group Core
     */ public function iddwa(){$this->jstp1d();$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->wjtr13());curl_setopt($arjv25,CURLOPT_ENCODING,base64_decode('Z3ppcA=='));curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);$mszj2a=curl_exec($arjv25);curl_close($arjv25);$this->gjzj27($mszj2a,file_get_contents(TEST_FILE_LOCATION));$mkxh32=$this->dmba1c().base64_decode('Lmd6');$this->bdxd31($mkxh32);$this->jstp1d();}/**
     * Context :
     *  - First access to file
     *  - Content-Encoding: deflate
     *  - Repeat twice
     * Expected :
     *  - the compressed file cache mechanism works file, ie. the .deflate file is not generated twice
     *
     * @group Core
     */ public function kvhjb(){$this->jstp1d();$ncha30=$this->dmba1c().base64_decode('LmRlZmxhdGU=');$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->wjtr13());curl_setopt($arjv25,CURLOPT_ENCODING,base64_decode('ZGVmbGF0ZQ=='));curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_exec($arjv25);curl_close($arjv25);$tnno33=filemtime($ncha30);sleep(1);$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->wjtr13());curl_setopt($arjv25,CURLOPT_ENCODING,base64_decode('ZGVmbGF0ZQ=='));curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_exec($arjv25);curl_close($arjv25);clearstatcache();$this->gjzj27($tnno33,filemtime($ncha30));$this->jstp1d();}/**
     * Context :
     *  - First access to file
     *  - Content-Encoding: deflate
     *  - Repeat twice, in between: update the modification date of the test file
     * Expected :
     *  - the test file has been updated, the cached compressed file should be regenerated
     *
     * @group Core
     */ public function aymcc(){$this->jstp1d();$ncha30=$this->dmba1c().base64_decode('LmRlZmxhdGU=');$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->wjtr13());curl_setopt($arjv25,CURLOPT_ENCODING,base64_decode('ZGVmbGF0ZQ=='));curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_exec($arjv25);curl_close($arjv25);$tnno33=filemtime($ncha30);sleep(1);touch(TEST_FILE_LOCATION);$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->wjtr13());curl_setopt($arjv25,CURLOPT_ENCODING,base64_decode('ZGVmbGF0ZQ=='));curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_exec($arjv25);curl_close($arjv25);clearstatcache();$this->cnec34($tnno33,filemtime($ncha30));$this->jstp1d();}/**
     * @group Core
     */ public function xjuhd(){$this->jstp1d();$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->ggmx14());curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);$whtv35=curl_exec($arjv25);$svxz26=curl_getinfo($arjv25);curl_close($arjv25);clearstatcache();$this->dcfd23(file_exists($this->dmba1c().base64_decode('LmRlZmxhdGU=')));$this->dcfd23(file_exists($this->dmba1c().base64_decode('Lmd6')));$this->gjzj27(PARTIAL_BYTE_END-PARTIAL_BYTE_START,$svxz26[base64_decode('c2l6ZV9kb3dubG9hZA==')]);$nkai36=substr(file_get_contents(TEST_FILE_LOCATION),PARTIAL_BYTE_START,PARTIAL_BYTE_END-PARTIAL_BYTE_START);$this->gjzj27($nkai36,$whtv35);}/**
     * @group Core
     * @group TestToExec
     */ public function qzrje(){$this->jstp1d();$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->ggmx14());curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_setopt($arjv25,CURLOPT_ENCODING,base64_decode('ZGVmbGF0ZQ=='));$whtv35=curl_exec($arjv25);curl_getinfo($arjv25);curl_close($arjv25);clearstatcache();$this->bdxd31($this->dmba1c().base64_decode('Lg==').PARTIAL_BYTE_START.base64_decode('Lg==').PARTIAL_BYTE_END.base64_decode('LmRlZmxhdGU='));$this->wlxd37($this->dmba1c().base64_decode('Lmd6'));$nkai36=substr(file_get_contents(TEST_FILE_LOCATION),PARTIAL_BYTE_START,PARTIAL_BYTE_END-PARTIAL_BYTE_START);$this->gjzj27($nkai36,$whtv35);$this->jstp1d();}/**
     * @group Core
     */ public function vmjuf(){$this->jstp1d();$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->qqer15());curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_setopt($arjv25,CURLOPT_ENCODING,base64_decode('ZGVmbGF0ZQ=='));$mszj2a=curl_exec($arjv25);curl_getinfo($arjv25);curl_close($arjv25);clearstatcache();$this->bdxd31($this->dmba1c().base64_decode('LmRlZmxhdGU='));$this->wlxd37($this->dmba1c().base64_decode('Lmd6'));$this->gjzj27(file_get_contents(TEST_FILE_LOCATION),$mszj2a);$this->jstp1d();}/**
     * Helper methods
     */ private function wvbs10(){$edjv29=Fixture::wxwc38();$edjv29.=base64_decode('L3Rlc3RzL3Jlc291cmNlcy8=');return $edjv29.base64_decode('c3RhdGljRmlsZVNlcnZlci5waHA/').FILE_MODE_REQUEST_VAR.base64_decode('PQ==').STATIC_SERVER_MODE.base64_decode('Jg==').SRV_MODE_REQUEST_VAR.base64_decode('PQ==');}private function rtph11(){return $this->wvbs10().NULL_FILE_SRV_MODE;}private function eowt12(){return $this->wvbs10().GHOST_FILE_SRV_MODE;}private function wjtr13(){return $this->wvbs10().TEST_FILE_SRV_MODE;}private function ggmx14(){return $this->wvbs10().PARTIAL_TEST_FILE_SRV_MODE;}private function qqer15(){return $this->wvbs10().WHOLE_TEST_FILE_WITH_RANGE_SRV_MODE;}private function bwtu16($edjv29){return $edjv29.base64_decode('Jg==').ZLIB_OUTPUT_REQUEST_VAR.base64_decode('PTE=');}private function duam17($mszj2a){preg_match_all(base64_decode('L0NvbnRlbnQtRW5jb2Rpbmc6W1xzKl0oW1s6cHJpbnQ6XV0qKS8='),$mszj2a,$nykd39);if(isset($nykd39[1][0])){return $nykd39[1][0];}return null;}private function kpae18($mszj2a){preg_match_all(base64_decode('L0NhY2hlLUNvbnRyb2w6W1xzKl0oW1s6cHJpbnQ6XV0qKS8='),$mszj2a,$nykd39);if(isset($nykd39[1][0])){return $nykd39[1][0];}return null;}private function bchc19($mszj2a){preg_match_all(base64_decode('LyhQcmFnbWE6W1s6cHJpbnQ6XV0qKS8='),$mszj2a,$nykd39);if(isset($nykd39[1][0])){return trim($nykd39[1][0]);}return null;}private function dcpf1a($mszj2a){preg_match_all(base64_decode('L0V4cGlyZXM6IChbWzpwcmludDpdXSopLw=='),$mszj2a,$nykd39);if(isset($nykd39[1][0])){return trim($nykd39[1][0]);}return null;}private function plil1b($mszj2a){preg_match_all(base64_decode('L0xhc3QtTW9kaWZpZWQ6W1xzKl0oW1s6cHJpbnQ6XV0qKS8='),$mszj2a,$nykd39);if(isset($nykd39[1][0])){return $nykd39[1][0];}return null;}private function dmba1c(){return \Piwik\AssetManager::uswt3a()->laet3b().base64_decode('Lw==').basename(TEST_FILE_LOCATION);}private function jstp1d(){@unlink($this->dmba1c().base64_decode('LmRlZmxhdGU='));@unlink($this->dmba1c().base64_decode('Lmd6'));}}?>

Did this file decode correctly?

Original Code

<?php /**
 * This php file is used to unit test Piwik::serverStaticFile()
 * Unit tests for this method should normally be located in /tests/core/Piwik.test.php
 * To make a comprehensive test suit for Piwik::serverStaticFile() (ie. being able to test combinations of request
 * headers, being able to test response headers and so on) we need to simulate static file requests in a controlled
 * environment
 * The php code which simulates requests using Piwik::serverStaticFile() is provided in the same file (ie. this one)
 * as the unit testing code for Piwik::serverStaticFile()
 * This decision has a structural impact on the usual unit test file structure
 * serverStaticFile.test.php has been created to avoid making too many modifications to /tests/core/Piwik.test.php
 */ namespace Piwik\Tests\Integration;use Exception;use Piwik\ProxyHttp;use Piwik\SettingsServer;use Piwik\Tests\Framework\Fixture;define(base64_decode('VEVTVF9GSUxFX0xPQ0FUSU9O'),realpath(dirname(__FILE__).base64_decode('Ly4uLy4uL3Jlc291cmNlcy9saXBzdW0udHh0')));define(base64_decode('VEVTVF9GSUxFX0NPTlRFTlRfVFlQRQ=='),base64_decode('dGV4dC9wbGFpbg=='));define(base64_decode('RklMRV9NT0RFX1JFUVVFU1RfVkFS'),base64_decode('ZmlsZU1vZGU='));define(base64_decode('U1JWX01PREVfUkVRVUVTVF9WQVI='),base64_decode('c2VydmVyTW9kZQ=='));define(base64_decode('WkxJQl9PVVRQVVRfUkVRVUVTVF9WQVI='),base64_decode('emxpYk91dHB1dA=='));/**
 * These constants define the mode in which this php file is used :
 * - for unit testing Piwik::serverStaticFile() or
 * - as a static file server
 */ define(base64_decode('U1RBVElDX1NFUlZFUl9NT0RF'),base64_decode('c3RhdGljU2VydmVyTW9kZQ=='));define(base64_decode('VU5JVF9URVNUX01PREU='),base64_decode('dW5pdFRlc3RNb2Rl'));define(base64_decode('TlVMTF9GSUxFX1NSVl9NT0RF'),base64_decode('bnVsbEZpbGU='));define(base64_decode('R0hPU1RfRklMRV9TUlZfTU9ERQ=='),base64_decode('Z2hvc3RGaWxl'));define(base64_decode('VEVTVF9GSUxFX1NSVl9NT0RF'),base64_decode('dGVzdEZpbGU='));define(base64_decode('UEFSVElBTF9URVNUX0ZJTEVfU1JWX01PREU='),base64_decode('cGFydGlhbFRlc3RGaWxl'));define(base64_decode('V0hPTEVfVEVTVF9GSUxFX1dJVEhfUkFOR0VfU1JWX01PREU='),base64_decode('d2hvbGVUZXN0RmlsZVdpdGhSYW5nZQ=='));define(base64_decode('UEFSVElBTF9CWVRFX1NUQVJU'),1204);define(base64_decode('UEFSVElBTF9CWVRFX0VORA=='),14724);class afwu1e extends \aynm1f\rmwd20\avdz21{public function uzri0():void{parent::uzri0();if(!chmod(TEST_FILE_LOCATION,0644)){throw new mklf22(base64_decode('Q291bGQgbm90IGNobW9kIDA2NDQg').TEST_FILE_LOCATION);}}/**
     * Test that php compression isn't enabled ... otherwise, lots of tests will fail
     *
     * @group Core
     */ public function rhxe1(){$this->dcfd23(ProxyHttp::krab24());}/**
     * Checks that "HTTP/1.0 404 Not Found" is returned when Piwik::serverStaticFile is called with a null file
     *
     * @group Core
     */ public function retq2(){$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->rtph11());curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_exec($arjv25);$svxz26=curl_getinfo($arjv25);curl_close($arjv25);$this->gjzj27($svxz26[base64_decode('aHR0cF9jb2Rl')],404);}/**
     * Checks that "HTTP/1.0 404 Not Found" is returned when Piwik::serverStaticFile is called with a non existing file
     *
     *
     * @group Core
     */ public function npuz3(){$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->eowt12());curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_exec($arjv25);$svxz26=curl_getinfo($arjv25);curl_close($arjv25);$this->gjzj27($svxz26[base64_decode('aHR0cF9jb2Rl')],404);}/**
     * Checks that "HTTP/1.0 505 Internal server error" is returned when Piwik::serverStaticFile is called with a
     * non-readable file
     *
     * @group Core
     */ public function mvzl4(){/**
         * This test would fail on a windows environment because it is not possible to remove reading rights on a
         * windows file using PHP.
         */ if(SettingsServer::ogqa28()){return;}chmod(TEST_FILE_LOCATION,0200);$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$edjv29=$this->wjtr13());curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_exec($arjv25);$svxz26=curl_getinfo($arjv25);curl_close($arjv25);chmod(TEST_FILE_LOCATION,0644);$this->gjzj27($svxz26[base64_decode('aHR0cF9jb2Rl')],500);}/**
     * Context :
     *  - First access to test file
     *  - zlib.output_compression = 0
     *  - no compression
     * Expected :
     *  - file is send back without compression
     *  - cache control headers are correctly set
     *
     * @group Core
     */ public function gpwl5(){$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->wjtr13());curl_setopt($arjv25,CURLOPT_HEADER,true);curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);$mszj2a=curl_exec($arjv25);$svxz26=curl_getinfo($arjv25);curl_close($arjv25);$this->gjzj27(200,$svxz26[base64_decode('aHR0cF9jb2Rl')]);self::vcwg2b(TEST_FILE_CONTENT_TYPE,$svxz26[base64_decode('Y29udGVudF90eXBl')]);$this->itsz2c($this->duam17($mszj2a));$this->gjzj27(filesize(TEST_FILE_LOCATION),$svxz26[base64_decode('c2l6ZV9kb3dubG9hZA==')]);$this->gjzj27(gmdate(base64_decode('RCwgZCBNIFkgSDppOnM='),filemtime(TEST_FILE_LOCATION)).base64_decode('IEdNVA=='),$this->plil1b($mszj2a));$this->gjzj27(base64_decode('cHVibGljLCBtdXN0LXJldmFsaWRhdGU='),$this->kpae18($mszj2a));$hylw2d=$this->bchc19($mszj2a);$this->ukeg2e($hylw2d==null||$hylw2d==base64_decode('UHJhZ21hOg=='));$ofxy2f=$this->dcpf1a($mszj2a);$this->ukeg2e(strtotime($ofxy2f)>time()+99*86400);}/**
     * Context :
     *  - Second access to test file
     *  - If-Modified-Since set to test file modification date
     * Expected :
     *  - "HTTP/1.1 304 Not Modified" sent back to client
     *
     * @group Core
     */ public function jttc6(){$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->wjtr13());curl_setopt($arjv25,CURLOPT_TIMECONDITION,1);curl_setopt($arjv25,CURLOPT_TIMEVALUE,filemtime(TEST_FILE_LOCATION));curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_exec($arjv25);$svxz26=curl_getinfo($arjv25);curl_close($arjv25);$this->gjzj27($svxz26[base64_decode('aHR0cF9jb2Rl')],304);}/**
     * Context :
     *  - Second access to test file
     *  - If-Modified-Since set to test file modification date minus 1 second
     * Expected :
     *  - http return code 200 sent back to client
     *
     * @group Core
     */ public function oiaa7(){$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->wjtr13());curl_setopt($arjv25,CURLOPT_TIMECONDITION,1);curl_setopt($arjv25,CURLOPT_TIMEVALUE,filemtime(TEST_FILE_LOCATION)-1);curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_exec($arjv25);$svxz26=curl_getinfo($arjv25);curl_close($arjv25);$this->gjzj27($svxz26[base64_decode('aHR0cF9jb2Rl')],200);}/**
     * Context :
     *  - First access to file
     *  - zlib output compression is on
     * Expected :
     *  - the response has to be readable, it tests the proxy doesn't compress the file when compression
     *      is enabled in php.
     *
     * @group Core
     */ public function atly8(){$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->bwtu16(($this->wjtr13())));curl_setopt($arjv25,CURLOPT_ENCODING,'');curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);$mszj2a=curl_exec($arjv25);curl_close($arjv25);$this->gjzj27($mszj2a,file_get_contents(TEST_FILE_LOCATION));}/**
     * Context :
     *  - First access to file
     *  - Content-Encoding: deflate
     * Expected :
     *  - the response has to be readable
     *  - the compression method used must be gzdeflate and not gzcompression to be IE compatible
     *
     * @group Core
     */ public function drwt9(){$this->jstp1d();$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->wjtr13());curl_setopt($arjv25,CURLOPT_ENCODING,base64_decode('ZGVmbGF0ZQ=='));curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);$mszj2a=curl_exec($arjv25);curl_close($arjv25);$this->gjzj27($mszj2a,file_get_contents(TEST_FILE_LOCATION));$ncha30=$this->dmba1c().base64_decode('LmRlZmxhdGU=');$this->bdxd31($ncha30);$this->gjzj27(gzinflate(file_get_contents($ncha30)),file_get_contents(TEST_FILE_LOCATION));$this->jstp1d();}/**
     * Context :
     *  - First access to file
     *  - Content-Encoding: gzip
     * Expected :
     *  - the response has to be readable
     *  - the compression method used is gzip
     *
     * @group Core
     */ public function iddwa(){$this->jstp1d();$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->wjtr13());curl_setopt($arjv25,CURLOPT_ENCODING,base64_decode('Z3ppcA=='));curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);$mszj2a=curl_exec($arjv25);curl_close($arjv25);$this->gjzj27($mszj2a,file_get_contents(TEST_FILE_LOCATION));$mkxh32=$this->dmba1c().base64_decode('Lmd6');$this->bdxd31($mkxh32);$this->jstp1d();}/**
     * Context :
     *  - First access to file
     *  - Content-Encoding: deflate
     *  - Repeat twice
     * Expected :
     *  - the compressed file cache mechanism works file, ie. the .deflate file is not generated twice
     *
     * @group Core
     */ public function kvhjb(){$this->jstp1d();$ncha30=$this->dmba1c().base64_decode('LmRlZmxhdGU=');$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->wjtr13());curl_setopt($arjv25,CURLOPT_ENCODING,base64_decode('ZGVmbGF0ZQ=='));curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_exec($arjv25);curl_close($arjv25);$tnno33=filemtime($ncha30);sleep(1);$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->wjtr13());curl_setopt($arjv25,CURLOPT_ENCODING,base64_decode('ZGVmbGF0ZQ=='));curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_exec($arjv25);curl_close($arjv25);clearstatcache();$this->gjzj27($tnno33,filemtime($ncha30));$this->jstp1d();}/**
     * Context :
     *  - First access to file
     *  - Content-Encoding: deflate
     *  - Repeat twice, in between: update the modification date of the test file
     * Expected :
     *  - the test file has been updated, the cached compressed file should be regenerated
     *
     * @group Core
     */ public function aymcc(){$this->jstp1d();$ncha30=$this->dmba1c().base64_decode('LmRlZmxhdGU=');$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->wjtr13());curl_setopt($arjv25,CURLOPT_ENCODING,base64_decode('ZGVmbGF0ZQ=='));curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_exec($arjv25);curl_close($arjv25);$tnno33=filemtime($ncha30);sleep(1);touch(TEST_FILE_LOCATION);$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->wjtr13());curl_setopt($arjv25,CURLOPT_ENCODING,base64_decode('ZGVmbGF0ZQ=='));curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_exec($arjv25);curl_close($arjv25);clearstatcache();$this->cnec34($tnno33,filemtime($ncha30));$this->jstp1d();}/**
     * @group Core
     */ public function xjuhd(){$this->jstp1d();$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->ggmx14());curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);$whtv35=curl_exec($arjv25);$svxz26=curl_getinfo($arjv25);curl_close($arjv25);clearstatcache();$this->dcfd23(file_exists($this->dmba1c().base64_decode('LmRlZmxhdGU=')));$this->dcfd23(file_exists($this->dmba1c().base64_decode('Lmd6')));$this->gjzj27(PARTIAL_BYTE_END-PARTIAL_BYTE_START,$svxz26[base64_decode('c2l6ZV9kb3dubG9hZA==')]);$nkai36=substr(file_get_contents(TEST_FILE_LOCATION),PARTIAL_BYTE_START,PARTIAL_BYTE_END-PARTIAL_BYTE_START);$this->gjzj27($nkai36,$whtv35);}/**
     * @group Core
     * @group TestToExec
     */ public function qzrje(){$this->jstp1d();$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->ggmx14());curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_setopt($arjv25,CURLOPT_ENCODING,base64_decode('ZGVmbGF0ZQ=='));$whtv35=curl_exec($arjv25);curl_getinfo($arjv25);curl_close($arjv25);clearstatcache();$this->bdxd31($this->dmba1c().base64_decode('Lg==').PARTIAL_BYTE_START.base64_decode('Lg==').PARTIAL_BYTE_END.base64_decode('LmRlZmxhdGU='));$this->wlxd37($this->dmba1c().base64_decode('Lmd6'));$nkai36=substr(file_get_contents(TEST_FILE_LOCATION),PARTIAL_BYTE_START,PARTIAL_BYTE_END-PARTIAL_BYTE_START);$this->gjzj27($nkai36,$whtv35);$this->jstp1d();}/**
     * @group Core
     */ public function vmjuf(){$this->jstp1d();$arjv25=curl_init();curl_setopt($arjv25,CURLOPT_URL,$this->qqer15());curl_setopt($arjv25,CURLOPT_RETURNTRANSFER,true);curl_setopt($arjv25,CURLOPT_ENCODING,base64_decode('ZGVmbGF0ZQ=='));$mszj2a=curl_exec($arjv25);curl_getinfo($arjv25);curl_close($arjv25);clearstatcache();$this->bdxd31($this->dmba1c().base64_decode('LmRlZmxhdGU='));$this->wlxd37($this->dmba1c().base64_decode('Lmd6'));$this->gjzj27(file_get_contents(TEST_FILE_LOCATION),$mszj2a);$this->jstp1d();}/**
     * Helper methods
     */ private function wvbs10(){$edjv29=Fixture::wxwc38();$edjv29.=base64_decode('L3Rlc3RzL3Jlc291cmNlcy8=');return $edjv29.base64_decode('c3RhdGljRmlsZVNlcnZlci5waHA/').FILE_MODE_REQUEST_VAR.base64_decode('PQ==').STATIC_SERVER_MODE.base64_decode('Jg==').SRV_MODE_REQUEST_VAR.base64_decode('PQ==');}private function rtph11(){return $this->wvbs10().NULL_FILE_SRV_MODE;}private function eowt12(){return $this->wvbs10().GHOST_FILE_SRV_MODE;}private function wjtr13(){return $this->wvbs10().TEST_FILE_SRV_MODE;}private function ggmx14(){return $this->wvbs10().PARTIAL_TEST_FILE_SRV_MODE;}private function qqer15(){return $this->wvbs10().WHOLE_TEST_FILE_WITH_RANGE_SRV_MODE;}private function bwtu16($edjv29){return $edjv29.base64_decode('Jg==').ZLIB_OUTPUT_REQUEST_VAR.base64_decode('PTE=');}private function duam17($mszj2a){preg_match_all(base64_decode('L0NvbnRlbnQtRW5jb2Rpbmc6W1xzKl0oW1s6cHJpbnQ6XV0qKS8='),$mszj2a,$nykd39);if(isset($nykd39[1][0])){return $nykd39[1][0];}return null;}private function kpae18($mszj2a){preg_match_all(base64_decode('L0NhY2hlLUNvbnRyb2w6W1xzKl0oW1s6cHJpbnQ6XV0qKS8='),$mszj2a,$nykd39);if(isset($nykd39[1][0])){return $nykd39[1][0];}return null;}private function bchc19($mszj2a){preg_match_all(base64_decode('LyhQcmFnbWE6W1s6cHJpbnQ6XV0qKS8='),$mszj2a,$nykd39);if(isset($nykd39[1][0])){return trim($nykd39[1][0]);}return null;}private function dcpf1a($mszj2a){preg_match_all(base64_decode('L0V4cGlyZXM6IChbWzpwcmludDpdXSopLw=='),$mszj2a,$nykd39);if(isset($nykd39[1][0])){return trim($nykd39[1][0]);}return null;}private function plil1b($mszj2a){preg_match_all(base64_decode('L0xhc3QtTW9kaWZpZWQ6W1xzKl0oW1s6cHJpbnQ6XV0qKS8='),$mszj2a,$nykd39);if(isset($nykd39[1][0])){return $nykd39[1][0];}return null;}private function dmba1c(){return \Piwik\AssetManager::uswt3a()->laet3b().base64_decode('Lw==').basename(TEST_FILE_LOCATION);}private function jstp1d(){@unlink($this->dmba1c().base64_decode('LmRlZmxhdGU='));@unlink($this->dmba1c().base64_decode('Lmd6'));}}?>

Function Calls

None

Variables

None

Stats

MD5 71c802a9c7af57bf1dc31a9bc12df802
Eval Count 0
Decode Time 102 ms