Merge branch 'stable9' into local-invalid-9
This commit is contained in:
commit
fe753fe722
|
@ -274,6 +274,7 @@ OC.Upload = {
|
|||
if ( $('#file_upload_start').exists() ) {
|
||||
var file_upload_param = {
|
||||
dropZone: $('#content'), // restrict dropZone to content div
|
||||
pasteZone: null,
|
||||
autoUpload: false,
|
||||
sequentialUploads: true,
|
||||
//singleFileUploads is on by default, so the data.files array will always have length 1
|
||||
|
|
|
@ -29,6 +29,7 @@ use OC\Files\Filesystem;
|
|||
use OC\ForbiddenException;
|
||||
use OC\Hooks\PublicEmitter;
|
||||
use OC\Lock\DBLockingProvider;
|
||||
use OCP\Files\Storage\IStorage;
|
||||
use OCP\Files\StorageNotAvailableException;
|
||||
use OCP\ILogger;
|
||||
|
||||
|
@ -153,6 +154,17 @@ class Scanner extends PublicEmitter {
|
|||
$scanner->setUseTransactions(false);
|
||||
$this->attachListener($mount);
|
||||
$isDbLocking = \OC::$server->getLockingProvider() instanceof DBLockingProvider;
|
||||
|
||||
$scanner->listen('\OC\Files\Cache\Scanner', 'removeFromCache', function ($path) use ($storage) {
|
||||
$this->triggerPropagator($storage, $path);
|
||||
});
|
||||
$scanner->listen('\OC\Files\Cache\Scanner', 'updateCache', function ($path) use ($storage) {
|
||||
$this->triggerPropagator($storage, $path);
|
||||
});
|
||||
$scanner->listen('\OC\Files\Cache\Scanner', 'addToCache', function ($path) use ($storage) {
|
||||
$this->triggerPropagator($storage, $path);
|
||||
});
|
||||
|
||||
if (!$isDbLocking) {
|
||||
$this->db->beginTransaction();
|
||||
}
|
||||
|
@ -168,5 +180,9 @@ class Scanner extends PublicEmitter {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function triggerPropagator(IStorage $storage, $internalPath) {
|
||||
$storage->getPropagator()->propagateChange($internalPath, time());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -269,7 +269,8 @@ class OC_Installer{
|
|||
//download the file if necessary
|
||||
if($data['source']=='http') {
|
||||
$pathInfo = pathinfo($data['href']);
|
||||
$path = \OC::$server->getTempManager()->getTemporaryFile('.' . $pathInfo['extension']);
|
||||
$extension = isset($pathInfo['extension']) ? '.' . $pathInfo['extension'] : '';
|
||||
$path = \OC::$server->getTempManager()->getTemporaryFile($extension);
|
||||
if(!isset($data['href'])) {
|
||||
throw new \Exception($l->t("No href specified when installing app from http"));
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ class ExcludeFoldersByPathFilterIterator extends \RecursiveFilterIterator {
|
|||
// See https://github.com/owncloud/updater/issues/318#issuecomment-212497846
|
||||
rtrim($root . '/updater', '/'),
|
||||
rtrim($root . '/_oc_upgrade', '/'),
|
||||
rtrim($root . '/__apps', '/'),
|
||||
];
|
||||
$customDataDir = \OC::$server->getConfig()->getSystemValue('datadirectory', '');
|
||||
if($customDataDir !== '') {
|
||||
|
|
|
@ -16,6 +16,7 @@ $(document).ready(function () {
|
|||
$('#sslCertificate tr > td').tipsy({gravity: 'n', live: true});
|
||||
|
||||
$('#rootcert_import').fileupload({
|
||||
pasteZone: null,
|
||||
submit: function (e, data) {
|
||||
data.formData = _.extend(data.formData || {}, {
|
||||
requesttoken: OC.requestToken
|
||||
|
|
|
@ -244,6 +244,7 @@ $(document).ready(function () {
|
|||
});
|
||||
|
||||
var uploadparms = {
|
||||
pasteZone: null,
|
||||
done: function (e, data) {
|
||||
var response = data;
|
||||
if (typeof data.result === 'string') {
|
||||
|
|
|
@ -163,4 +163,28 @@ class Scanner extends \Test\TestCase {
|
|||
$scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), \OC::$server->getLogger());
|
||||
$scanner->scan($invalidPath);
|
||||
}
|
||||
|
||||
public function testPropagateEtag() {
|
||||
$storage = new Temporary(array());
|
||||
$mount = new MountPoint($storage, '');
|
||||
Filesystem::getMountManager()->addMount($mount);
|
||||
$cache = $storage->getCache();
|
||||
|
||||
$storage->mkdir('folder');
|
||||
$storage->file_put_contents('folder/bar.txt', 'qwerty');
|
||||
$storage->touch('folder/bar.txt', time() - 200);
|
||||
|
||||
$scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), \OC::$server->getLogger());
|
||||
$scanner->addMount($mount);
|
||||
|
||||
$scanner->scan('');
|
||||
$this->assertTrue($cache->inCache('folder/bar.txt'));
|
||||
$oldRoot = $cache->get('');
|
||||
|
||||
$storage->file_put_contents('folder/bar.txt', 'qwerty');
|
||||
$scanner->scan('');
|
||||
$newRoot = $cache->get('');
|
||||
|
||||
$this->assertNotEquals($oldRoot->getEtag(), $newRoot->getEtag());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue