Skip to content

Commit

Permalink
Merge pull request EC-CUBE#2557 from okazy/fix_locale_in_install_on_w…
Browse files Browse the repository at this point in the history
…indows

日本語windowsの場合はインストール時にエラーとなるので英語のロケールをセット
  • Loading branch information
kiy0taka authored Oct 12, 2017
2 parents ce6e44b + 9fd658f commit 837bcf7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Eccube/Doctrine/Common/CsvDataFixtures/CsvFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ public function __construct(\SplFileObject $file)
*/
public function load(ObjectManager $manager)
{
// 日本語windowsの場合はインストール時にエラーとなるので英語のロケールをセット
// ロケールがミスマッチしてSplFileObject::READ_CSVができないのを回避
if ('\\' === DIRECTORY_SEPARATOR) {
setLocale(LC_ALL, 'English_United States.1252');
}

// CSV Reader に設定
$this->file->setFlags(\SplFileObject::READ_CSV | \SplFileObject::READ_AHEAD | \SplFileObject::SKIP_EMPTY |\SplFileObject::DROP_NEW_LINE);

Expand Down

0 comments on commit 837bcf7

Please sign in to comment.