Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seeders Windows directory separators #64

Closed
antonkomarev opened this issue Apr 2, 2017 · 0 comments
Closed

Seeders Windows directory separators #64

antonkomarev opened this issue Apr 2, 2017 · 0 comments

Comments

@antonkomarev
Copy link

antonkomarev commented Apr 2, 2017

Seeders wouldn't work on Unix based systems because of the directory separators.
private $rolesFilePath = 'database\seeds\Components\Role\roles.json';

Result:

[ErrorException]
file_get_contents(/home/opus/database\seeds\Components\Page\pages.json): failed to open stream: No such file or directory

There are 3 ways to solve this:

  1. Use DIRECTORY_SEPARATOR instead of \
  2. Use just / (because as far as I know Windows accept both of the slashes as directory separator and Unix based systems are not).
  3. Have a method which will replace your separators with system ones.

As for me - the best option is 2nd one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants