Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
003a686c
Commit
003a686c
authored
Feb 29, 2016
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
ignore encryption keys for propagation
parent
52d217d7
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/private/files/cache/homepropagator.php
+50
-0
50 additions, 0 deletions
lib/private/files/cache/homepropagator.php
lib/private/files/storage/home.php
+18
-0
18 additions, 0 deletions
lib/private/files/storage/home.php
with
68 additions
and
0 deletions
lib/private/files/cache/homepropagator.php
0 → 100644
+
50
−
0
View file @
003a686c
<?php
/**
* @author Robin Appelman <icewind@owncloud.com>
*
* @copyright Copyright (c) 2016, ownCloud, Inc.
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace
OC\Files\Cache
;
class
HomePropagator
extends
Propagator
{
private
$ignoredBaseFolders
;
/**
* @param \OC\Files\Storage\Storage $storage
*/
public
function
__construct
(
\OC\Files\Storage\Storage
$storage
)
{
parent
::
__construct
(
$storage
);
$this
->
ignoredBaseFolders
=
[
'files_encryption'
];
}
/**
* @param string $internalPath
* @param int $time
* @param int $sizeDifference number of bytes the file has grown
* @return array[] all propagated entries
*/
public
function
propagateChange
(
$internalPath
,
$time
,
$sizeDifference
=
0
)
{
list
(
$baseFolder
)
=
explode
(
'/'
,
$internalPath
,
2
);
if
(
in_array
(
$baseFolder
,
$this
->
ignoredBaseFolders
))
{
return
[];
}
else
{
return
parent
::
propagateChange
(
$internalPath
,
$time
,
$sizeDifference
);
}
}
}
This diff is collapsed.
Click to expand it.
lib/private/files/storage/home.php
+
18
−
0
View file @
003a686c
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
*/
*/
namespace
OC\Files\Storage
;
namespace
OC\Files\Storage
;
use
OC\Files\Cache\HomePropagator
;
/**
/**
* Specialized version of Local storage for home directory usage
* Specialized version of Local storage for home directory usage
...
@@ -76,6 +77,23 @@ class Home extends Local implements \OCP\Files\IHomeStorage {
...
@@ -76,6 +77,23 @@ class Home extends Local implements \OCP\Files\IHomeStorage {
return
$this
->
cache
;
return
$this
->
cache
;
}
}
/**
* get a propagator instance for the cache
*
* @param \OC\Files\Storage\Storage (optional) the storage to pass to the watcher
* @return \OC\Files\Cache\Propagator
*/
public
function
getPropagator
(
$storage
=
null
)
{
if
(
!
$storage
)
{
$storage
=
$this
;
}
if
(
!
isset
(
$this
->
propagator
))
{
$this
->
propagator
=
new
HomePropagator
(
$storage
);
}
return
$this
->
propagator
;
}
/**
/**
* Returns the owner of this home storage
* Returns the owner of this home storage
* @return \OC\User\User owner of this home storage
* @return \OC\User\User owner of this home storage
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment