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

Windows support #15

Closed
wants to merge 7 commits into from
Closed

Windows support #15

wants to merge 7 commits into from

Conversation

michael-donat
Copy link
Owner

Not sure how possible this is, but mocking on Windows immediately fails since functions like posix_getuid and posix_getgid do not exist. Any plans on supporting Windows? I switch between OSs, so this would be nice.

@michael-donat
Copy link
Owner

I have no idea how the windows permission system is working - it makes it difficult to recreate :)

PHP wise it's definitely possible - just not sure when I will be able to commit some time.

Please raise an issue on GH so it won't go missing.

Thanks

Sent from my phone.

On 24 Apr 2014, at 03:51, Miles Johnson notifications@github.com wrote:

Not sure how possible this is, but mocking on Windows immediately fails since functions like posix_getuid and posix_getgid do not exist. Any plans on supporting Windows? I switch between OSs, so this would be nice.


Reply to this email directly or view it on GitHub.

@milesj
Copy link
Contributor Author

milesj commented Apr 24, 2014

Yeah I figured as much. I'll try to get a vagrant instance running so I can run these tests. Thanks.

@michael-donat
Copy link
Owner

Actually, since this is a FS (even if virtual) there is no need for it to mimic Windows FS behaviour.

I should be able to fix the compatibility issues by bypassing the calls. That will give you the ability to run tests on Windows.

On 24 Apr 2014, at 08:00, Miles Johnson notifications@github.com wrote:

Yeah I figured as much. I'll try to get a vagrant instance running so I can run these tests. Thanks.


Reply to this email directly or view it on GitHub.

@milesj
Copy link
Contributor Author

milesj commented Apr 25, 2014

You're totally right, no idea why that didn't cross my mind either. If you need any help testing Windows, I can mess around and figure out parts that throw errors.

@michael-donat
Copy link
Owner

That would be a great help if you could point out places where it fails.

Cheers,
Mike

Sent from my phone.

On 25 Apr 2014, at 07:29, Miles Johnson notifications@github.com wrote:

You're totally right, no idea why that didn't cross my mind either. If you need any help testing Windows, I can mess around and figure out parts that throw errors.


Reply to this email directly or view it on GitHub.

@milesj
Copy link
Contributor Author

milesj commented Apr 26, 2014

What I found so far.

The following functions are not supported:

  • posix_getuid()
  • posix_getgid()

Since dirname() returns \ instead of /, I had to replace them in VirtualFileSystem\Container::fileAt().

$pathParts = array_filter(explode('/', str_replace('\\', '/', $path)), 'strlen');

Seems to be working now. If I run into anything else, will let you know.

@milesj
Copy link
Contributor Author

milesj commented Apr 26, 2014

On a side note, it would be nice to have a method like createStructure() that can easily create nested files and folders.

$vfs->createStructure([
    'folder1' => [
        'file1.txt' => 'contents',
        'file2.php' => '<?php',
        'folder2' => []
    ]
]);

@michael-donat
Copy link
Owner

Makes sense, can you GH-issue both and I will look at it this week?

Sent from my phone.

On 26 Apr 2014, at 20:49, Miles Johnson notifications@github.com wrote:

On a side not, it would be nice to have a method like createStructure() that can easily create nested files and folders.

$vfs->createStructure([
'folder1' => [
'file1.txt' => 'contents',
'file2.php' => '<?php',
'folder2' => []
]
]);

Reply to this email directly or view it on GitHub.

@michael-donat
Copy link
Owner

Created PR #16 to fix

@michael-donat
Copy link
Owner

@milesj can you let me know if that fixes everything?

@michael-donat michael-donat mentioned this pull request Apr 27, 2014
@michael-donat
Copy link
Owner

see #17

@milesj
Copy link
Contributor Author

milesj commented Apr 28, 2014

Awesome, thanks for all this. Tested with the branch and everything seems to be running smoothly so far.

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

Successfully merging this pull request may close these issues.

None yet

2 participants