aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--admin/include/functions.php20
-rw-r--r--include/config_default.inc.php3
2 files changed, 16 insertions, 7 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 1df6e4f45..2060e03b4 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -534,22 +534,28 @@ DELETE
*/
function get_fs_directories($path, $recursive = true)
{
+ global $conf;
+
$dirs = array();
$path = rtrim($path, '/');
+ $exclude_folders = array_merge(
+ $conf['sync_exclude_folders'],
+ array(
+ '.', '..', '.svn',
+ 'thumbnail', 'pwg_high',
+ 'pwg_representative',
+ )
+ );
+ $exclude_folders = array_flip($exclude_folders);
+
if (is_dir($path))
{
if ($contents = opendir($path))
{
while (($node = readdir($contents)) !== false)
{
- if ($node != '.'
- and $node != '..'
- and $node != '.svn'
- and $node != 'thumbnail'
- and $node != 'pwg_high'
- and $node != 'pwg_representative'
- and is_dir($path.'/'.$node))
+ if (is_dir($path.'/'.$node) and !isset($exclude_folders[$node]))
{
$dirs[] = $path.'/'.$node;
if ($recursive)
diff --git a/include/config_default.inc.php b/include/config_default.inc.php
index e96f6331d..cd7c0156a 100644
--- a/include/config_default.inc.php
+++ b/include/config_default.inc.php
@@ -759,6 +759,9 @@ $conf['enable_synchronization'] = true;
// permitted characters for files/directoris during synchronization
$conf['sync_chars_regex'] = '/^[a-zA-Z0-9-_.]+$/';
+// folders name exluded during synchronization
+$conf['sync_exclude_folders'] = array();
+
// PEM url (default is http://piwigo.org/ext)
$conf['alternative_pem_url'] = '';