original_string: protected function _createTar($skipRoot = false, $finalize = false)
      {
          if (!$skipRoot) {
              $this->_packAndWriteCurrentFile();
          }
  
          $file = $this->_getCurrentFile();
  
          if (is_dir($file)) {
              $dirFiles = scandir($file);
  
              if (false === $dirFiles) {
                  throw new Mage_Exception('Can\'t scan dir: ' . $file);
              }
  
              array_shift($dirFiles); /* remove  './'*/
              array_shift($dirFiles); /* remove  '../'*/
  
              foreach ($dirFiles as $item) {
                  $this->_setCurrentFile($file . $item)->_createTar();
              }
          }
  
          if ($finalize) {
              $this->_getWriter()->write(str_repeat("\0", self::TAR_BLOCK_SIZE * 12));
          }
      }
code: protected function _createTar($skipRoot = false, $finalize = false)
      {
          if (!$skipRoot) {
              $this->_packAndWriteCurrentFile();
          }
  
          $file = $this->_getCurrentFile();
  
          if (is_dir($file)) {
              $dirFiles = scandir($file);
  
              if (false === $dirFiles) {
                  throw new Mage_Exception('Can\'t scan dir: ' . $file);
              }
  
              array_shift($dirFiles); /* remove  './'*/
              array_shift($dirFiles); /* remove  '../'*/
  
              foreach ($dirFiles as $item) {
                  $this->_setCurrentFile($file . $item)->_createTar();
              }
          }
  
          if ($finalize) {
              $this->_getWriter()->write(str_repeat("\0", self::TAR_BLOCK_SIZE * 12));
          }
      }
code_tokens: protected function _createTar ( $ skipRoot = false , $ finalize = false ) { if ( ! $ skipRoot ) { $ this -> _packAndWriteCurrentFile ( ) ; } $ file = $ this -> _getCurrentFile ( ) ; if ( is_dir ( $ file ) ) { $ dirFiles = scandir ( $ file ) ; if ( false === $ dirFiles ) { throw new Mage_Exception ( 'Can\'t scan dir: ' . $ file ) ; } array_shift ( $ dirFiles ) ; /* remove  './'*/ array_shift ( $ dirFiles ) ; /* remove  '../'*/ foreach ( $ dirFiles as $ item ) { $ this -> _setCurrentFile ( $ file . $ item ) -> _createTar ( ) ; } } if ( $ finalize ) { $ this -> _getWriter ( ) -> write ( str_repeat ( "\0" , self :: TAR_BLOCK_SIZE * 12 ) ) ; } }
docstring: Recursively walk through file tree and create tarball
  
  @param boolean $skipRoot
  @param boolean $finalize
  @throws Mage_Exception
docstring_tokens: Recursively walk through file tree and create tarball