Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Commit

Permalink
Ignore non php files in resources/lang folders, for example .gitignor…
Browse files Browse the repository at this point in the history
…e and vim swap files are causing errors on generate
  • Loading branch information
bayi committed Oct 31, 2016
1 parent c45bdee commit 92b6b6b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ private function allocateLocaleArray($path)
foreach ($dir as $fileinfo) {
if (!$fileinfo->isDot()) {
$noExt = $this->removeExtension($fileinfo->getFilename());
// Ignore non *.php files (ex.: .gitignore, vim swap files etc.)
if (pathinfo($fileinfo->getFileName())['extension'] !== 'php') {
continue;
}
$tmp = include($path . '/' . $fileinfo->getFilename());

$data[$noExt] = $this->adjustArray($tmp);
Expand Down

0 comments on commit 92b6b6b

Please sign in to comment.