Changeset 26928


Ignore:
Timestamp:
01/23/14 20:29:42 (5 years ago)
Author:
mistic100
Message:

feature 3031: add $confsync_exclude_folders parameter

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions.php

    r26922 r26928  
    535535function get_fs_directories($path, $recursive = true) 
    536536{ 
     537  global $conf; 
     538 
    537539  $dirs = array(); 
    538540  $path = rtrim($path, '/'); 
    539541 
     542  $exclude_folders = array_merge( 
     543    $conf['sync_exclude_folders'], 
     544    array( 
     545      '.', '..', '.svn', 
     546      'thumbnail', 'pwg_high', 
     547      'pwg_representative', 
     548      ) 
     549    ); 
     550  $exclude_folders = array_flip($exclude_folders); 
     551 
    540552  if (is_dir($path)) 
    541553  { 
     
    544556      while (($node = readdir($contents)) !== false) 
    545557      { 
    546         if ($node != '.' 
    547             and $node != '..' 
    548             and $node != '.svn' 
    549             and $node != 'thumbnail' 
    550             and $node != 'pwg_high' 
    551             and $node != 'pwg_representative' 
    552             and is_dir($path.'/'.$node)) 
     558        if (is_dir($path.'/'.$node) and !isset($exclude_folders[$node])) 
    553559        { 
    554560          $dirs[] = $path.'/'.$node; 
  • trunk/include/config_default.inc.php

    r26461 r26928  
    760760$conf['sync_chars_regex'] = '/^[a-zA-Z0-9-_.]+$/'; 
    761761 
     762// folders name exluded during synchronization 
     763$conf['sync_exclude_folders'] = array(); 
     764 
    762765// PEM url (default is http://piwigo.org/ext) 
    763766$conf['alternative_pem_url'] = ''; 
Note: See TracChangeset for help on using the changeset viewer.