Skip to content

Commit

Permalink
Revert "Corrected uploaded file path overwriting file path"
Browse files Browse the repository at this point in the history
This reverts commit 45f9104.
  • Loading branch information
Antoine Guigan committed Sep 11, 2014
1 parent 68fa53d commit c78d559
Showing 1 changed file with 2 additions and 29 deletions.
31 changes: 2 additions & 29 deletions Reader/FileIteratorReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ class FileIteratorReader extends AbstractIteratorReader implements UploadedFileA
*/
protected $filePath;

/**
* @var string
*/
protected $uploadedFilePath;

/**
* @var boolean
*
Expand Down Expand Up @@ -115,7 +110,7 @@ public function getUploadedFileConstraints()
*/
public function setUploadedFile(File $uploadedFile)
{
$this->uploadedFilePath = $uploadedFile->getRealPath();
$this->filePath = $uploadedFile->getRealPath();
$this->reset();

return $this;
Expand Down Expand Up @@ -175,21 +170,7 @@ public function getFilePath()
*/
protected function createIterator()
{
return $this->iteratorFactory->create(
$this->iteratorClass,
$this->getImportedFilePath(),
$this->getIteratorOptions()
);
}

/**
* Returns the path of the uploaded file
*
* @return string
*/
protected function getImportedFilePath()
{
return $this->uploadedFilePath ?: $this->filePath;
return $this->iteratorFactory->create($this->iteratorClass, $this->filePath, $this->getIteratorOptions());
}

/**
Expand All @@ -201,12 +182,4 @@ protected function getIteratorOptions()
{
return $this->iteratorOptions;
}

/**
* {@inheritdoc}
*/
public function initialize()
{
parent::initialize();
}
}

0 comments on commit c78d559

Please sign in to comment.