Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
--TEST-- Bug #76584 (PharFileInfo::decompress not working) --EXTENSIONS-- phar zlib --INI-..
Decoded Output download
--TEST--
Bug #76584 (PharFileInfo::decompress not working)
--EXTENSIONS--
phar
zlib
--INI--
phar.readonly=0
--FILE--
<?php
$phar = new Phar(__DIR__ . '/76584.phar');
$phar->addFromString('76584.txt', 'This is a test file.');
$file = $phar['76584.txt'];
var_dump($file->compress(Phar::GZ));
var_dump($file->isCompressed());
var_dump($file->decompress());
var_dump($file->isCompressed());
mkdir(__DIR__ . '/76584');
var_dump($phar->extractTo(__DIR__ . '/76584'));
echo file_get_contents(__DIR__ . '/76584/76584.txt');
?>
--EXPECT--
bool(true)
bool(true)
bool(true)
bool(false)
bool(true)
This is a test file.
--CLEAN--
<?php
unlink(__DIR__ . '/76584/76584.txt');
rmdir(__DIR__ . '/76584');
unlink(__DIR__ . '/76584.phar');
?>
Did this file decode correctly?
Original Code
--TEST--
Bug #76584 (PharFileInfo::decompress not working)
--EXTENSIONS--
phar
zlib
--INI--
phar.readonly=0
--FILE--
<?php
$phar = new Phar(__DIR__ . '/76584.phar');
$phar->addFromString('76584.txt', 'This is a test file.');
$file = $phar['76584.txt'];
var_dump($file->compress(Phar::GZ));
var_dump($file->isCompressed());
var_dump($file->decompress());
var_dump($file->isCompressed());
mkdir(__DIR__ . '/76584');
var_dump($phar->extractTo(__DIR__ . '/76584'));
echo file_get_contents(__DIR__ . '/76584/76584.txt');
?>
--EXPECT--
bool(true)
bool(true)
bool(true)
bool(false)
bool(true)
This is a test file.
--CLEAN--
<?php
unlink(__DIR__ . '/76584/76584.txt');
rmdir(__DIR__ . '/76584');
unlink(__DIR__ . '/76584.phar');
?>
Function Calls
None |
Stats
MD5 | 751c6de3da85ce4db7430cac50cb9e9b |
Eval Count | 0 |
Decode Time | 114 ms |