Skip to content

Commit

Permalink
Add config option to ignore specified files or folders when importing…
Browse files Browse the repository at this point in the history
… paths
  • Loading branch information
magnusvikstrom committed Oct 16, 2015
1 parent 5716919 commit 9cefd88
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/config/core.php
Expand Up @@ -247,6 +247,11 @@
*/
//date_default_timezone_set('UTC');

/**
* Add files or folders that should be ignored by CakePHP when scanning application folder.
*/
//Configure::write('ignorePaths', array('.svn', '.git', 'CVS', 'tests', 'templates', 'node_modules'));

/**
*
* Cache Engine Configuration
Expand Down
6 changes: 5 additions & 1 deletion cake/libs/configure.php
Expand Up @@ -1035,7 +1035,11 @@ function __find($file, $recursive = true) {
require LIBS . 'folder.php';
}
$Folder =& new Folder();
$directories = $Folder->tree($path, array('.svn', '.git', 'CVS', 'tests', 'templates'), 'dir');
$ignorePaths = Configure::read('ignorePaths');
if(empty($ignorePaths)) {
$ignorePaths = array('.svn', '.git', 'CVS', 'tests', 'templates');
}
$directories = $Folder->tree($path, $ignorePaths, 'dir');
sort($directories);
$this->__paths[$path] = $directories;
}
Expand Down

0 comments on commit 9cefd88

Please sign in to comment.