function addString($p_filename, $p_string)
{
$v_result = true;
if (!$this->_isArchive()) {
if (!$this->_openWrite()) {
return false;
}
$this->_close();
}
if (!$this->_openAppend()) {
return false;
}
// Need to check the get back to the temporary file ? ....
$v_result = $this->_addString($p_filename, $p_string);
$this->_writeFooter();
$this->_close();
return $v_result;
}
public static function generateTarByPluginDir(array $info, $filename, $input, $output) { $timeLimit = ini_get('max_execution_time'); set_time_limit(0); require_once 'Archive/Tar.php'; $tar = new Archive_Tar($output . '/' . $filename, true); foreach ($info['filelist'] as $file => $data) { $tar->addString($info['name'] . '-' . $info['version'] . '/' . $file, file_get_contents($input . '/' . $file)); } $tar->addString('package.xml', file_get_contents($input . '/package.xml')); set_time_limit($timeLimit); }