List the directory at a given version

@param   string  $directory      The path ot the directory
@param   string  $ref            The version ref
@return  array
507333
public function listDirectory($directory = '.', $ref = 'HEAD')
    {
        $directory  = FileSystem::normalizeDirectorySeparator($directory);
        $directory  = $this->resolveLocalPath(rtrim($directory, '/') . '/');
        $path       = $this->getRepositoryPath();

        /** @var $result CallResult */
        $result = $this->getGit()->{'ls-tree'}($path, array(
            '--name-only',
            '--full-name',
            '-z',
            $ref,
            $this->translatePathspec($directory)
        ));
        $result->assertSuccess(sprintf('Cannot list directory "%s" at "%s" from "%s"',
            $directory, $ref, $this->getRepositoryPath()
        ));

        $output     = $result->getStdOut();
        $listing    = array_map(function($f) use ($directory) {
            return str_replace($directory, '', trim($f));
        }, explode("\x0", $output));
        return $listing;
    }
261874
public function readDirectory($directory, $showDetail = false)
    {
        $list = glob($this->getDefaultPath() . trim($directory, '\\/') . '/*');
        if ($showDetail) {
            foreach ($list as &$file) {
                $file = new FileInfo(
                    array(
                        'name' => basename($file),
                        'size' => filesize($file),
                        'mtime' => filemtime($file),
                        'type' => is_dir($file) ? 'directory' : 'file',
                    )
                );
            }

            return $list;
        } else {
            return $list;
        }
    }
489158
public function directories($directory, $pattern = '*')
    {
        $files = $this->formatDirsAndFiles($this->laravelFS->directories($directory));

        return $this->filterPaths($files, $pattern, []);
    }
621237
public function listDirectory($directory = '')
    {
        $this->ensureDirectoryExists($this->directory, $this->create);

        $directory = preg_replace('/^[\/]*([^\/].*)$/', '/$1', $directory);

        $items = $this->parseRawlist(
            ftp_rawlist($this->getConnection(), '-al '.$this->directory.$directory) ?: array()
        );

        $fileData = $dirs = array();
        foreach ($items as $itemData) {
            if ('..' === $itemData['name'] || '.' === $itemData['name']) {
                continue;
            }

            $item = array(
                'name' => $itemData['name'],
                'path' => trim(($directory ? $directory.'/' : '').$itemData['name'], '/'),
                'time' => $itemData['time'],
                'size' => $itemData['size'],
            );

            if ('-' === substr($itemData['perms'], 0, 1)) {
                $fileData[$item['path']] = $item;
            } elseif ('d' === substr($itemData['perms'], 0, 1)) {
                $dirs[] = $item['path'];
            }
        }

        $this->fileData = array_merge($fileData, $this->fileData);

        return array(
           'keys' => array_keys($fileData),
           'dirs' => $dirs,
        );
    }
520479
public function items($directory)
    {
        $items = array();

        $metadata = $this->dropbox->getMetadata($this->pathRoot.$directory);

        if (isset($metadata['contents']) && is_array($metadata['contents']))
        {
            foreach ($metadata['contents'] as $file)
            {
                if ($file['is_dir'] == false) {
                    $items[] = $file['path'];
                }
            }
        }

        return $items;
    }
420809
protected function listDirectoryContents($directory, $recursive = true)
    {
        $directory = str_replace('*', '\\*', $directory);

        if ($recursive && $this->recurseManually) {
            return $this->listDirectoryContentsRecursive($directory);
        }

        $options = $recursive ? '-alnR' : '-aln';
        $listing = $this->ftpRawlist($options, $directory);

        return $listing ? $this->normalizeListing($listing, $directory) : [];
    }
596912
public function items($directory)
    {
        $directory = ltrim($directory, "/");

        $iterator = new FilesystemIterator($this->pathRoot.$directory);

        $files = array();

        foreach ($iterator as $file) {
            $files[] = strval($file);
        }
        
        return $files;
    }
123228
public function listContents($directory)
    {
        $files = $this->modulable->getConnection()->listContents($directory);
        $files = array_pluck($files, 'path');
        $files = array_map('basename', $files);

        return $files;
    }
1300321
protected static function listAssets($directory) {

        if (false === is_dir($directory)) {
            throw new InvalidArgumentException(sprintf("\"%s\" is not a directory", $directory));
        }

        $assets = [];

        foreach (new DirectoryIterator(realpath($directory)) as $current) {

            // Check the filename and his extension.
            if (true === in_array($current->getFilename(), [".", ".."]) || 0 === preg_match("/\.zip$/", $current->getFilename())) {
                continue;
            }

            $assets[] = $current->getPathname();
        }

        sort($assets);

        return $assets;
    }
691664
private function recursiveSearch($directory)
    {
        
		if (is_dir($directory)) {
	    	// We get the list of files and directories.
	    	if (($files = scandir($directory)) !== false) {
	    		
	    		foreach($files as $fd) {
	
	   		 		if (!preg_match("/^\./", $fd) &&  $fd != "ext") {
	   		 			// If it is a directory ...
	   		 			if (is_dir($directory . $fd. "/")) {
	   		 				$this->recursiveSearch($directory . $fd . "/");
		    			// If it is a file ...
	    				} else {
	    					// Retrieve from the file ...
	    					$this->getTranslationsInFile($directory . $fd);
	    				}
	   		 		}
	    			
	    		}
	    	}   	
		}
		
        
    }
693036
public function listAll($ref = null)
    {
        if (is_null($ref)) {
            $ref = 'HEAD';
        }
        $this->clearAll();

        $this->addCommandName(self::LS_TREE_COMMAND);
        $this->addCommandSubject($ref);

        return $this->getCommand();
    }
45547
public function files($directory)
    {
        $directory = ltrim($directory, "/");
        $files = array();

        $dirIterator = new RecursiveDirectoryIterator($this->pathRoot.$directory);
        $iterator = new RecursiveIteratorIterator($dirIterator, RecursiveIteratorIterator::CHILD_FIRST);
        
        foreach ($iterator as $file) {
            if (filetype($file) == 'file') {
                $files[] = strval($file);
            }
        }
        
        return $files;
    }
843758
public function moveToDirectory($directory)
    {
        $targetPath = rtrim($directory, '/') . '/' . $this->getClientFilename();

        return $this->moveTo($targetPath);
    }
1354265
public function listContents($directory = '', $recursive = false)
    {
        $prefix = $this->applyPathPrefix(rtrim($directory, '/') . '/');
        $options = ['Bucket' => $this->bucket, 'Prefix' => ltrim($prefix, '/')];

        if ($recursive === false) {
            $options['Delimiter'] = '/';
        }

        $listing = $this->retrievePaginatedListing($options);
        $normalizer = [$this, 'normalizeResponse'];
        $normalized = array_map($normalizer, $listing);

        return Util::emulateDirectories($normalized);
    }
1133336
protected function findCommandsFiles($directory)
    {
        $glob = glob($directory.'/*');

        if ($glob === false) {
            return [];
        }

        // To get the appropriate files, we'll simply glob the directory and filter
        // out any "files" that are not truly files so we do not end up with any
        // directories in our list, but only true files within the directory.
        return array_filter($glob, function ($file) {
            return filetype($file) == 'file';
        });
    }
726678
public function getRef($reference)
    {
        $array = ! isset($reference['$ref']);
        $reference = $array ? $reference : [$reference];
        $database = $this->database;

        $result = array_map(
            function ($ref) use ($database) {
                return MongoDBRef::get($database, $ref);
            },
            $reference
        );

        return $array ? $result : reset($result);
    }
210917
private function list_directory( $dir ) {
		$dir_list = array();

		// Only add .mo/.po/.zip files
		foreach ( glob( $dir . '/*.{mo,po,zip}', GLOB_BRACE ) as $file ) {
			$dir_list[] = basename( $file );
		}

		return $dir_list;
	}