mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-07 02:11:26 +02:00
feature 3031: add $conf['sync_exclude_folders'] parameter
git-svn-id: http://piwigo.org/svn/trunk@26928 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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'] = '';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user