Merge pull request #191 from xini/patch-1

add dmsassets folder to file system sync exclusion, fixes #190
This commit is contained in:
Robbie Averill 2017-07-31 22:02:23 +12:00 committed by GitHub
commit 6c5e70dc33
2 changed files with 20 additions and 0 deletions

View File

@ -19,3 +19,9 @@ if ($config->get('DMSDocument_versions', 'enable_versions')) {
//using the same db relations for the versioned documents, as for the actual documents //using the same db relations for the versioned documents, as for the actual documents
$config->update('DMSDocument_versions', 'db', $config->get('DMSDocument', 'db')); $config->update('DMSDocument_versions', 'db', $config->get('DMSDocument', 'db'));
} }
// add dmsassets folder to file system sync exclusion
if (strpos($config->get('DMS', 'folder_name'), 'assets/') === 0) {
$folderName = substr($config->get('DMS', 'folder_name'), 7);
$config->update('Filesystem', 'sync_blacklisted_patterns', array("/^" . $folderName . "$/i",));
}

View File

@ -166,4 +166,18 @@ class DMSTest extends FunctionalTest
$this->assertCount(2, $sets); $this->assertCount(2, $sets);
$this->assertContainsOnlyInstancesOf('DMSDocumentSet', $sets); $this->assertContainsOnlyInstancesOf('DMSDocumentSet', $sets);
} }
/**
* Ensure that assets/* folders are not included in filesystem sync operations
*/
public function testFolderExcludedFromFilesystemSync()
{
// Undo setup config changes
Config::unnest();
Config::nest();
$result = Filesystem::config()->get('sync_blacklisted_patterns');
$folderName = substr(DMS::config()->get('folder_name'), 7);
$this->assertContains('/^' . $folderName . '$/i', $result);
}
} }