mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Adding fix from davidpersson: sort not working for subdirectories in Folder::findRecursive
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8102 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
e89bc0be10
commit
3748987599
1 changed files with 3 additions and 2 deletions
|
@ -212,17 +212,18 @@ class Folder extends Object {
|
|||
*/
|
||||
function _findRecursive($pattern, $sort = false) {
|
||||
list($dirs, $files) = $this->read($sort);
|
||||
|
||||
$found = array();
|
||||
|
||||
foreach ($files as $file) {
|
||||
if (preg_match('/^' . $pattern . '$/i', $file)) {
|
||||
$found[] = Folder::addPathElement($this->path, $file);
|
||||
}
|
||||
}
|
||||
$start = $this->path;
|
||||
|
||||
foreach ($dirs as $dir) {
|
||||
$this->cd(Folder::addPathElement($start, $dir));
|
||||
$found = array_merge($found, $this->findRecursive($pattern));
|
||||
$found = array_merge($found, $this->findRecursive($pattern, $sort));
|
||||
}
|
||||
return $found;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue