mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
Merge pull request #191 from xini/patch-1
add dmsassets folder to file system sync exclusion, fixes #190
This commit is contained in:
commit
6c5e70dc33
@ -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",));
|
||||||
|
}
|
||||||
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user