migrations::files PHP Method

files() public method

public files ( $reverse = false )
    public function files($reverse = false)
    {
        $iterator = new FilesystemIterator(APP . 'migrations', FilesystemIterator::SKIP_DOTS);
        $files = array();
        foreach ($iterator as $file) {
            $parts = explode('_', $file->getBasename(EXT));
            $num = array_shift($parts);
            $files[$num] = array('path' => $file->getPathname(), 'class' => 'Migration_' . implode('_', $parts));
        }
        if ($reverse) {
            krsort($files, SORT_NUMERIC);
        } else {
            ksort($files, SORT_NUMERIC);
        }
        return $files;
    }