Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
55743218
Commit
55743218
authored
Oct 05, 2016
by
Vincent Petry
Committed by
GitHub
Oct 05, 2016
Browse files
Merge pull request #24948 from owncloud/fix-shared-storage-class
Move OC\Files\Storage\Shared to the right namespace
parents
e313417b
c0ffbddb
Changes
23
Hide whitespace changes
Inline
Side-by-side
apps/dav/lib/Connector/Sabre/Node.php
View file @
55743218
...
...
@@ -250,8 +250,8 @@ abstract class Node implements \Sabre\DAV\INode {
$path
=
$this
->
info
->
getInternalPath
();
if
(
$storage
->
instanceOfStorage
(
'\OC\Files
\Storage\Shared
'
))
{
/** @var \OC\Files
\Storage\Shared
$storage */
if
(
$storage
->
instanceOfStorage
(
'\OC
A
\Files
_Sharing\SharedStorage
'
))
{
/** @var \OC
A
\Files
_Sharing\SharedStorage
$storage */
$permissions
=
(
int
)
$storage
->
getShare
()
->
getPermissions
();
}
else
{
$permissions
=
$storage
->
getPermissions
(
$path
);
...
...
apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
View file @
55743218
...
...
@@ -210,7 +210,7 @@ class DirectoryTest extends \Test\TestCase {
$storage
->
expects
(
$this
->
any
())
->
method
(
'instanceOfStorage'
)
->
will
(
$this
->
returnValueMap
([
'\OC\Files
\Storage\Shared
'
=>
false
,
'\OC
A
\Files
_Sharing\SharedStorage
'
=>
false
,
'\OC\Files\Storage\Wrapper\Quota'
=>
false
,
]));
...
...
@@ -241,7 +241,7 @@ class DirectoryTest extends \Test\TestCase {
$storage
->
expects
(
$this
->
any
())
->
method
(
'instanceOfStorage'
)
->
will
(
$this
->
returnValueMap
([
[
'\OC\Files
\Storage\Shared
'
,
false
],
[
'\OC
A
\Files
_Sharing\SharedStorage
'
,
false
],
[
'\OC\Files\Storage\Wrapper\Quota'
,
true
],
]));
...
...
apps/federatedfilesharing/tests/TestCase.php
View file @
55743218
...
...
@@ -113,7 +113,7 @@ abstract class TestCase extends \Test\TestCase {
* reset init status for the share storage
*/
protected
static
function
resetStorage
()
{
$storage
=
new
\
ReflectionClass
(
'\OC\Files
\Storage\Shared
'
);
$storage
=
new
\
ReflectionClass
(
'\OC
A
\Files
_Sharing\SharedStorage
'
);
$isInitialized
=
$storage
->
getProperty
(
'initialized'
);
$isInitialized
->
setAccessible
(
true
);
$isInitialized
->
setValue
(
$storage
,
false
);
...
...
apps/files_sharing/appinfo/app.php
View file @
55743218
...
...
@@ -28,8 +28,6 @@
$l
=
\
OC
::
$server
->
getL10N
(
'files_sharing'
);
\
OC
::
$CLASSPATH
[
'OC\Files\Storage\Shared'
]
=
'files_sharing/lib/sharedstorage.php'
;
\
OCA\Files_Sharing\Helper
::
registerHooks
();
\
OCP\Share
::
registerBackend
(
'file'
,
'OCA\Files_Sharing\ShareBackend\File'
);
...
...
apps/files_sharing/lib/Cache.php
View file @
55743218
...
...
@@ -37,7 +37,7 @@ use OCP\Files\Storage\IStorage;
*/
class
Cache
extends
CacheJail
{
/**
* @var \OC\Files
\Storage\Shared
* @var \OC
A
\Files
_Sharing\SharedStorage
*/
private
$storage
;
...
...
@@ -57,7 +57,7 @@ class Cache extends CacheJail {
private
$sourceCache
;
/**
* @param \OC\Files
\Storage\Shared
$storage
* @param \OC
A
\Files
_Sharing\SharedStorage
$storage
* @param IStorage $sourceStorage
* @param ICacheEntry $sourceRootInfo
*/
...
...
apps/files_sharing/lib/MountProvider.php
View file @
55743218
...
...
@@ -80,7 +80,7 @@ class MountProvider implements IMountProvider {
foreach
(
$superShares
as
$share
)
{
try
{
$mounts
[]
=
new
SharedMount
(
'\OC\Files
\Storage\Shared
'
,
'\OC
A
\Files
_Sharing\SharedStorage
'
,
$mounts
,
[
'user'
=>
$user
->
getUID
(),
...
...
apps/files_sharing/lib/Scanner.php
View file @
55743218
...
...
@@ -54,7 +54,7 @@ class Scanner extends \OC\Files\Cache\Scanner {
if
(
$this
->
sourceScanner
)
{
return
$this
->
sourceScanner
;
}
if
(
$this
->
storage
->
instanceOfStorage
(
'\OC\Files
\Storage\Shared
'
))
{
if
(
$this
->
storage
->
instanceOfStorage
(
'\OC
A
\Files
_Sharing\SharedStorage
'
))
{
/** @var \OC\Files\Storage\Storage $storage */
list
(
$storage
)
=
$this
->
storage
->
resolvePath
(
''
);
$this
->
sourceScanner
=
$storage
->
getScanner
();
...
...
apps/files_sharing/lib/SharedMount.php
View file @
55743218
...
...
@@ -36,7 +36,7 @@ use OC\Files\View;
*/
class
SharedMount
extends
MountPoint
implements
MoveableMount
{
/**
* @var \OC\Files
\Storage\Shared
$storage
* @var \OC
A
\Files
_Sharing\SharedStorage
$storage
*/
protected
$storage
=
null
;
...
...
@@ -211,7 +211,7 @@ class SharedMount extends MountPoint implements MoveableMount {
*/
public
function
removeMount
()
{
$mountManager
=
\
OC\Files\Filesystem
::
getMountManager
();
/** @var $storage \OC\Files
\Storage\Shared
*/
/** @var $storage \OC
A
\Files
_Sharing\SharedStorage
*/
$storage
=
$this
->
getStorage
();
$result
=
$storage
->
unshareStorage
();
$mountManager
->
removeMount
(
$this
->
mountPoint
);
...
...
apps/files_sharing/lib/SharedPropagator.php
View file @
55743218
...
...
@@ -26,7 +26,7 @@ use OC\Files\Cache\Propagator;
class
SharedPropagator
extends
Propagator
{
/**
* @var \OC\Files
\Storage\Shared
* @var \OC
A
\Files
_Sharing\SharedStorage
*/
protected
$storage
;
...
...
apps/files_sharing/lib/
s
hared
s
torage.php
→
apps/files_sharing/lib/
S
hared
S
torage.php
View file @
55743218
...
...
@@ -28,11 +28,10 @@
*
*/
namespace
OC\Files
\Storage
;
namespace
OC
A
\Files
_Sharing
;
use
OC\Files\Filesystem
;
use
OC\Files\Cache\FailedCache
;
use
OCA\Files_Sharing
\
ISharedStorage
;
use
OCP\Constants
;
use
OCP\Files\Cache\ICacheEntry
;
use
OCP\Files\Storage\IStorage
;
...
...
@@ -43,7 +42,8 @@ use OCP\Files\NotFoundException;
/**
* Convert target path to source path and pass the function call to the correct storage provider
*/
class
Shared
extends
\
OC\Files\Storage\Wrapper\Jail
implements
ISharedStorage
{
class
SharedStorage
extends
\
OC\Files\Storage\Wrapper\Jail
implements
ISharedStorage
{
/** @var \OCP\Share\IShare */
private
$superShare
;
...
...
apps/files_sharing/tests/CacheTest.php
View file @
55743218
...
...
@@ -487,7 +487,7 @@ class CacheTest extends TestCase {
$this
->
assertTrue
(
\
OC\Files\Filesystem
::
file_exists
(
'/test.txt'
));
list
(
$sharedStorage
)
=
\
OC\Files\Filesystem
::
resolvePath
(
'/'
.
self
::
TEST_FILES_SHARING_API_USER2
.
'/files/test.txt'
);
/**
* @var \OC\Files
\Storage\Shared
$sharedStorage
* @var \OC
A
\Files
_Sharing\SharedStorage
$sharedStorage
*/
$sharedCache
=
$sharedStorage
->
getCache
();
...
...
@@ -517,7 +517,7 @@ class CacheTest extends TestCase {
$this
->
assertTrue
(
\
OC\Files\Filesystem
::
file_exists
(
'/foo'
));
list
(
$sharedStorage
)
=
\
OC\Files\Filesystem
::
resolvePath
(
'/'
.
self
::
TEST_FILES_SHARING_API_USER2
.
'/files/foo'
);
/**
* @var \OC\Files
\Storage\Shared
$sharedStorage
* @var \OC
A
\Files
_Sharing\SharedStorage
$sharedStorage
*/
$sharedCache
=
$sharedStorage
->
getCache
();
...
...
apps/files_sharing/tests/SharedStorageTest.php
View file @
55743218
...
...
@@ -522,7 +522,7 @@ class SharedStorageTest extends TestCase {
$mount
=
$view2
->
getMount
(
'/foo'
);
$this
->
assertInstanceOf
(
'\OCA\Files_Sharing\SharedMount'
,
$mount
);
/** @var \OC\Files
\Storage\Shared
$storage */
/** @var \OC
A
\Files
_Sharing\SharedStorage
$storage */
$storage
=
$mount
->
getStorage
();
$this
->
assertEquals
(
self
::
TEST_FILES_SHARING_API_USER1
,
$storage
->
getOwner
(
''
));
...
...
apps/files_sharing/tests/TestCase.php
View file @
55743218
...
...
@@ -179,7 +179,7 @@ abstract class TestCase extends \Test\TestCase {
* reset init status for the share storage
*/
protected
static
function
resetStorage
()
{
$storage
=
new
\
ReflectionClass
(
'\OC\Files
\Storage\Shared
'
);
$storage
=
new
\
ReflectionClass
(
'\OC
A
\Files
_Sharing\SharedStorage
'
);
$isInitialized
=
$storage
->
getProperty
(
'initialized'
);
$isInitialized
->
setAccessible
(
true
);
$isInitialized
->
setValue
(
$storage
,
false
);
...
...
apps/files_versions/tests/VersioningTest.php
View file @
55743218
...
...
@@ -879,7 +879,7 @@ class VersioningTest extends \Test\TestCase {
\
OC
::
$server
->
getUserManager
()
->
registerBackend
(
$backend
);
}
$storage
=
new
\
ReflectionClass
(
'\OC\Files
\Storage\Shared
'
);
$storage
=
new
\
ReflectionClass
(
'\OC
A
\Files
_Sharing\SharedStorage
'
);
$isInitialized
=
$storage
->
getProperty
(
'initialized'
);
$isInitialized
->
setAccessible
(
true
);
$isInitialized
->
setValue
(
$storage
,
false
);
...
...
lib/private/Encryption/DecryptAll.php
View file @
55743218
...
...
@@ -210,7 +210,7 @@ class DecryptAll {
$content
=
$this
->
rootView
->
getDirectoryContent
(
$root
);
foreach
(
$content
as
$file
)
{
// only decrypt files owned by the user
if
(
$file
->
getStorage
()
->
instanceOfStorage
(
'OC\Files
\Storage\Shared
'
))
{
if
(
$file
->
getStorage
()
->
instanceOfStorage
(
'OC
A
\Files
_Sharing\SharedStorage
'
))
{
continue
;
}
$path
=
$root
.
'/'
.
$file
[
'name'
];
...
...
lib/private/Encryption/EncryptionWrapper.php
View file @
55743218
...
...
@@ -80,7 +80,7 @@ class EncryptionWrapper {
'mount'
=>
$mount
];
if
(
!
$storage
->
instanceOfStorage
(
'OC\Files
\Storage\Shared
'
)
if
(
!
$storage
->
instanceOfStorage
(
'OC
A
\Files
_Sharing\SharedStorage
'
)
&&
!
$storage
->
instanceOfStorage
(
'OCA\Files_Sharing\External\Storage'
)
&&
!
$storage
->
instanceOfStorage
(
'OC\Files\Storage\OwnCloud'
))
{
...
...
lib/private/Files/Storage/Common.php
View file @
55743218
...
...
@@ -465,6 +465,10 @@ abstract class Common implements Storage, ILockingStorage {
* @return bool
*/
public
function
instanceOfStorage
(
$class
)
{
if
(
ltrim
(
$class
,
'\\'
)
===
'OC\Files\Storage\Shared'
)
{
// FIXME Temporary fix to keep existing checks working
$class
=
'\OCA\Files_Sharing\SharedStorage'
;
}
return
is_a
(
$this
,
$class
);
}
...
...
lib/private/Files/Storage/Wrapper/Wrapper.php
View file @
55743218
...
...
@@ -482,6 +482,10 @@ class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage {
* @return bool
*/
public
function
instanceOfStorage
(
$class
)
{
if
(
ltrim
(
$class
,
'\\'
)
===
'OC\Files\Storage\Shared'
)
{
// FIXME Temporary fix to keep existing checks working
$class
=
'\OCA\Files_Sharing\SharedStorage'
;
}
return
is_a
(
$this
,
$class
)
or
$this
->
getWrapperStorage
()
->
instanceOfStorage
(
$class
);
}
...
...
lib/private/Files/View.php
View file @
55743218
...
...
@@ -1355,7 +1355,7 @@ class View {
$subStorage
=
$mount
->
getStorage
();
if
(
$subStorage
)
{
// exclude shared storage ?
if
(
$extOnly
&&
$subStorage
instanceof
\
OC\Files
\Storage\Shared
)
{
if
(
$extOnly
&&
$subStorage
instanceof
\
OC
A
\Files
_Sharing\SharedStorage
)
{
continue
;
}
$subCache
=
$subStorage
->
getCache
(
''
);
...
...
lib/private/legacy/helper.php
View file @
55743218
...
...
@@ -582,7 +582,7 @@ class OC_Helper {
$quota
=
\
OCP\Files\FileInfo
::
SPACE_UNLIMITED
;
$storage
=
$rootInfo
->
getStorage
();
$sourceStorage
=
$storage
;
if
(
$storage
->
instanceOfStorage
(
'\OC\Files
\Storage\Shared
'
))
{
if
(
$storage
->
instanceOfStorage
(
'\OC
A
\Files
_Sharing\SharedStorage
'
))
{
$includeExtStorage
=
false
;
$sourceStorage
=
$storage
->
getSourceStorage
();
}
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment