Archive_Tar::extractInString PHP Method

extractInString() public method

The return value is a string with the file content, or NULL on error.
public extractInString ( string $p_filename ) : a
$p_filename string The path of the file to extract in a string.
return a string with the file content or NULL.
    function extractInString($p_filename)
    {
        if ($this->_openRead()) {
            $v_result = $this->_extractInString($p_filename);
            $this->_close();
        } else {
            $v_result = NULL;
        }
        return $v_result;
    }

Usage Example

Ejemplo n.º 1
0
 function testBz2()
 {
     $oTar = new Archive_Tar($this->sFileBz2, 'bz2');
     $sExpected = $oTar->extractInString('Beautifier.php');
     unset($oTar);
     $sActual = file_get_contents('tarz://' . $this->sFileBz2 . "#Beautifier.php");
     $this->assertTrue($sExpected == $sActual, 'file_get_contents');
 }
All Usage Examples Of Archive_Tar::extractInString