Horde_Vcs_Directory_Base::applySort PHP Метод

applySort() публичный Метод

Sorts the the directory contents.
public applySort ( integer $how = Horde_Vcs::SORT_NONE, integer $dir = Horde_Vcs::SORT_ASCENDING )
$how integer A Horde_Vcs::SORT_* constant where * can be: NONE, NAME, AGE, REV for sorting by name, age or revision.
$dir integer A Horde_Vcs::SORT_* constant where * can be: ASCENDING, DESCENDING for the order of the sort.
    public function applySort($how = Horde_Vcs::SORT_NONE, $dir = Horde_Vcs::SORT_ASCENDING)
    {
        // Always sort directories by name.
        natcasesort($this->_dirs);
        $this->_doFileSort($this->_files, $how);
        if ($dir == Horde_Vcs::SORT_DESCENDING) {
            $this->_dirs = array_reverse($this->_dirs);
            $this->_files = array_reverse($this->_files);
        }
    }