src/Archive/Tar.php
function _addString($p_filename, $p_string, $p_datetime = false)
    {
      if (!$this->_file) {
          $this->_error('Invalid file descriptor');
          return false;
      }

      if ($p_filename == '') {
          $this->_error('Invalid file name');
          return false;
      }

      // ----- Calculate the stored filename
      $p_filename = $this->_translateWinPath($p_filename, false);;
      
      // ----- If datetime is not specified, set current time
      if ($p_datetime === false) {
          $p_datetime = time();
      }

      if (!$this->_writeHeaderBlock($p_filename, strlen($p_string),
                                    $p_datetime, 384, "", 0, 0))
          return false;

      $i=0;
      while (($v_buffer = substr($p_string, (($i++)*512), 512)) != '') {
          $v_binary_data = pack("a512", $v_buffer);
          $this->_writeBlock($v_binary_data);
      }

      return true;
    }
function _addString($p_filename, $p_string, $p_datetime = false)
    {
      if (!$this->_file) {
          $this->_error('Invalid file descriptor');
          return false;
      }

      if ($p_filename == '') {
          $this->_error('Invalid file name');
          return false;
      }

      // ----- Calculate the stored filename
      $p_filename = $this->_translateWinPath($p_filename, false);;
      
      // ----- If datetime is not specified, set current time
      if ($p_datetime === false) {
          $p_datetime = time();
      }

      if (!$this->_writeHeaderBlock($p_filename, strlen($p_string),
                                    $p_datetime, 384, "", 0, 0))
          return false;

      $i=0;
      while (($v_buffer = substr($p_string, (($i++)*512), 512)) != '') {
          $v_binary_data = pack("a512", $v_buffer);
          $this->_writeBlock($v_binary_data);
      }

      return true;
    }
{{{ _addString()