mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
adding sort param to Folder::find() and findRecursive(), closes #1385
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5823 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
cfc6a21316
commit
7a1ec65ee7
1 changed files with 6 additions and 6 deletions
|
@ -182,8 +182,8 @@ class Folder extends Object{
|
|||
* @return array Files that match given pattern
|
||||
* @access public
|
||||
*/
|
||||
function find($regexp_pattern = '.*') {
|
||||
$data = $this->ls();
|
||||
function find($regexp_pattern = '.*', $sort = false) {
|
||||
$data = $this->read($sort, $exceptions);
|
||||
|
||||
if (!is_array($data)) {
|
||||
return array();
|
||||
|
@ -206,9 +206,9 @@ class Folder extends Object{
|
|||
* @return array Files matching $pattern
|
||||
* @access public
|
||||
*/
|
||||
function findRecursive($pattern = '.*') {
|
||||
function findRecursive($pattern = '.*', $sort = false) {
|
||||
$startsOn = $this->path;
|
||||
$out = $this->_findRecursive($pattern);
|
||||
$out = $this->_findRecursive($pattern, $sort);
|
||||
$this->cd($startsOn);
|
||||
return $out;
|
||||
}
|
||||
|
@ -219,8 +219,8 @@ class Folder extends Object{
|
|||
* @return array Files matching pattern
|
||||
* @access private
|
||||
*/
|
||||
function _findRecursive($pattern) {
|
||||
list($dirs, $files) = $this->ls();
|
||||
function _findRecursive($pattern, $sort = false) {
|
||||
list($dirs, $files) = $this->read($sort, $exceptions);
|
||||
|
||||
$found = array();
|
||||
foreach ($files as $file) {
|
||||
|
|
Loading…
Reference in a new issue