Skip to content

Commit

Permalink
Exclude the vendor folder in migration
Browse files Browse the repository at this point in the history
  • Loading branch information
blunket authored and Frederic Delaunay committed Oct 29, 2018
1 parent 459f8b4 commit 8bc4af6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- Xlsx reader crashed when reading a file with workbook protection - [#553](https://github.com/PHPOffice/PhpSpreadsheet/pull/553)
- Cell formats with escaped spaces were causing incorrect date formatting - [#557](https://github.com/PHPOffice/PhpSpreadsheet/issues/557)
- Could not open CSV file containing HTML fragment - [##564](https://github.com/PHPOffice/PhpSpreadsheet/issues/564)
- Could not open CSV file containing HTML fragment - [#564](https://github.com/PHPOffice/PhpSpreadsheet/issues/564)
- Exclude the vendor folder in migration - [#481](https://github.com/PHPOffice/PhpSpreadsheet/issues/481)

## [1.3.1] - 2018-06-12

Expand Down
13 changes: 11 additions & 2 deletions src/PhpSpreadsheet/Helper/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,17 +249,26 @@ private function recursiveReplace($path)
{
$patterns = [
'/*.md',
'/*.php',
'/*.phtml',
'/*.txt',
'/*.TXT',
'/*.php',
'/*.phpt',
'/*.php3',
'/*.php4',
'/*.php5',
'/*.phtml',
];

$from = array_keys($this->getMapping());
$to = array_values($this->getMapping());

foreach ($patterns as $pattern) {
foreach (glob($path . $pattern) as $file) {
if (strpos($path, '/vendor/') !== false) {
echo $file . " skipped\n";

continue;
}
$original = file_get_contents($file);
$converted = str_replace($from, $to, $original);

Expand Down

0 comments on commit 8bc4af6

Please sign in to comment.