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

getWrapperMetaData() for UserFile returns StreamWrapper object. #4149

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hphp/runtime/base/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class File : public SweepableResourceData {
virtual bool stat(struct stat *sb);

virtual Array getMetaData();
virtual Array getWrapperMetaData() { return Array(); }
virtual Variant getWrapperMetaData() { return Variant(); }
String getWrapperType() const;
String getStreamType() const { return m_streamType; }
Resource &getStreamContext() { return m_streamContext; }
Expand Down
2 changes: 1 addition & 1 deletion hphp/runtime/base/url-file.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class UrlFile : public MemFile {
virtual int64_t writeImpl(const char *buffer, int64_t length);
virtual bool seekable() { return false; }
virtual bool flush();
virtual Array getWrapperMetaData() { return m_responseHeaders; }
virtual Variant getWrapperMetaData() { return Variant(m_responseHeaders); }
String getLastError();

private:
Expand Down
2 changes: 2 additions & 0 deletions hphp/runtime/base/user-file.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class UserFile : public File, public UserFSNode {
virtual bool lock(int operation, bool &wouldBlock);
virtual bool stat(struct stat* buf);

virtual Variant getWrapperMetaData() { return Variant(m_obj); }

int access(const String& path, int mode);
int lstat(const String& path, struct stat* buf);
int stat(const String& path, struct stat* buf);
Expand Down
2 changes: 0 additions & 2 deletions hphp/runtime/base/user-fs-node.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ class UserFSNode {
protected:
const Func* m_Call;
LowClassPtr m_cls;

private:
Object m_obj;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, const char *mode, int
MAKE_STD_ZVAL(stream->wrapperdata);
Z_TYPE_P(stream->wrapperdata) = IS_ARRAY;
Z_ARRVAL_P(stream->wrapperdata) = HPHP::ProxyArray::Make(
urlFile->getWrapperMetaData().detach()
urlFile->getWrapperMetaData().getArrayData()
);
} else {
stream->wrapperdata = nullptr;
Expand Down
18 changes: 9 additions & 9 deletions hphp/test/frameworks/results/vfsstream.expect
Original file line number Diff line number Diff line change
Expand Up @@ -475,21 +475,21 @@ org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canAquireEclusiveLock
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canAquireEclusiveLockWithNonBlockingFlockCall
.
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canAquireExclusiveLockIfAlreadySelfExclusivelyLocked
F
.
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canAquireExclusiveLockIfAlreadySelfSharedLocked
F
.
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canAquireSharedLock
.
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canAquireSharedLockIfAlreadySelfExclusivelyLocked
F
.
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canAquireSharedLockIfAlreadySelfSharedLocked
.
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canAquireSharedLockIfAlreadySharedLockedOnOtherFileHandler
.
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canAquireSharedLockWithNonBlockingFlockCall
.
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canNotAquireExclusiveLockIfAlreadyExclusivelyLockedOnOtherFileHandler
F
.
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canNotAquireExclusiveLockIfAlreadySharedLockedOnOtherFileHandler
.
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canNotAquireSharedLockIfAlreadyExclusivelyLockedOnOtherFileHandler
Expand All @@ -499,23 +499,23 @@ org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canNotRemoveExlusiveLockAcquiredOn
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canNotRemoveSharedLockAcquiredOnOtherFileHandler
.
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canRemoveLock
F
.
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canRemoveLockWhenNotLocked
.
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canRemoveLockWithNonBlockingFlockCall
F
.
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canRemoveSharedLockWithoutRemovingSharedLockOnOtherFileHandler
F
.
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::fileIsNotLockedByDefault
.
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::notRemovesExclusiveLockOnStreamCloseIfExclusiveLockAcquiredOnOtherFileHandler
.
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::notRemovesSharedLockOnStreamCloseIfSharedLockAcquiredOnOtherFileHandler
.
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::removesExclusiveLockOnStreamClose
F
.
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::removesSharedLockOnStreamClose
F
.
org\bovigo\vfs\vfsStreamWrapperFlockTestCase::streamIsNotLockedByDefault
.
org\bovigo\vfs\vfsStreamWrapperLargeFileTestCase::canReadFromLargeFile
Expand Down