Comments (6)
Hm... I'm wondering why /tests/tmp
has both ..
and .
while the other directories have ..
only? Seems not very consistent to me. Wondering what the result would be on a Windows system.
from vfsstream.
Just tested on Windows. There, both ..
and .
are not listed. So the behaviour of vfsStream is the same as on a Windows system.
from vfsstream.
Same result on Mac OS, both ..
and .
are not listed.
from vfsstream.
Result on a VM running Ubuntu 12.04 64bit, PHP 5.4.6-2~precise+1:
/vagrant/mikey/vfsStream/tmp/.
/vagrant/mikey/vfsStream/tmp/..
/vagrant/mikey/vfsStream/tmp/Core/.
/vagrant/mikey/vfsStream/tmp/Core/..
/vagrant/mikey/vfsStream/tmp/Core/AbstractFactory/.
/vagrant/mikey/vfsStream/tmp/Core/AbstractFactory/..
/vagrant/mikey/vfsStream/tmp/Core/AbstractFactory/Invalid.csv
/vagrant/mikey/vfsStream/tmp/Core/AbstractFactory/other.php
/vagrant/mikey/vfsStream/tmp/Core/AbstractFactory/test.php
/vagrant/mikey/vfsStream/tmp/Core/AbstractFactory
/vagrant/mikey/vfsStream/tmp/Core/AnEmptyFolder/.
/vagrant/mikey/vfsStream/tmp/Core/AnEmptyFolder/..
/vagrant/mikey/vfsStream/tmp/Core/AnEmptyFolder
/vagrant/mikey/vfsStream7tmp/Core/badlocation.php
/vagrant/mikey/vfsStream/tmp/Core
vfs://root/Core/AbstractFactory/test.php
vfs://root/Core/AbstractFactory/other.php
vfs://root/Core/AbstractFactory/Invalid.csv
vfs://root/Core/AbstractFactory
vfs://root/Core/AnEmptyFolder
vfs://root/Core/badlocation.php
vfs://root/Core
So it seems Linux based systems behave definitely different compared to Win and Mac OS. I'm not sure what the consequences for vfsStream should be.
from vfsstream.
In case anyone has an opinion on how vfsStream should behave please share a comment here.
from vfsstream.
Just an idea, but maybe vfsStream should mimic the behavior appropriate to the operating system that is being currently in use.
Linux: Yes..
Mac: No..
Windows: No..
The above was based on an incorrect assumption. For example, scandir() returns the dot paths on all OSes.
Developers should have the option to mimic another OS if they want to override the default behavior.
The default should be to use dot paths, but allow developers to disable them.
vfsStream::useDotFiles(true); // force on, default
vfsStream::useDotFiles(false); // force off
The exact way of handling override could probably be done better.
I see this approach as being intuitive, and will not require that developers test against the behavior of vfsStream itself, just of the target OS.
from vfsstream.
Related Issues (20)
- `vfsStreamDirectory::getChild()` has absurd complexity HOT 2
- php 8.1: vfsStreamDirectory::getIterator() incompatible with IteratorAggreate
- php 8.1: vfsStreamContainerIterator incompatible with Iterator
- PHP 8.1 Support HOT 4
- Add a setCurrentUser()
- sebastian/resource-operations is abandoned
- Create CSV file in the custom path using VFS HOT 3
- ../ is not correctly recognized in VfsStream HOT 2
- PHP 8.2 Support - track issues here HOT 7
- Allow for custom directory separators HOT 2
- vfsStream::newDirectory() does not return result when called recursively [not a bug, closed] HOT 1
- touch() ignores permissions of existing objects HOT 1
- Best practices: using vfsStream methods vs native filesystem methods HOT 2
- mkdir(recursive: true) behaves wrong for existing directories
- General notes on usage
- Blocker: broken package in github HOT 1
- "vfsStream team" link in Wiki is broken
- file_put_contents fails when vfsStream::setup() was invoked twice. HOT 2
- PHP 8.4 Support HOT 1
- PHP 8.1 and ZipArchive::addFile() method does not support vfsStream ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vfsstream.