public function listAllCrops($filter = null) {
        return $this->justPaths(array_filter($this->getCropsDisk()->listContents(null, true),
            function($file) use ($filter) {

            // If there was a filter, force it to match
            if ($filter && !preg_match("#$filter#i", $file['path'])) return;

            // Check that the file matches the pattern and get at the parts to make to
            // make the path to the src
            if (!preg_match('#'.URL::PATTERN.'#', $file['path'], $matches)) return false;
            $src = $matches[1].'.'.$matches[5];

            // Test that the src file exists
            return $this->getSrcDisk()->has($src);
        }));
    }
public function listAllCrops($filter = null) {
        return $this->justPaths(array_filter($this->getCropsDisk()->listContents(null, true),
            function($file) use ($filter) {

            // If there was a filter, force it to match
            if ($filter && !preg_match("#$filter#i", $file['path'])) return;

            // Check that the file matches the pattern and get at the parts to make to
            // make the path to the src
            if (!preg_match('#'.URL::PATTERN.'#', $file['path'], $matches)) return false;
            $src = $matches[1].'.'.$matches[5];

            // Test that the src file exists
            return $this->getSrcDisk()->has($src);
        }));
    }
public function listAllCrops ( $ filter = null ) { return $ this -> justPaths ( array_filter ( $ this -> getCropsDisk ( ) -> listContents ( null , true ) , function ( $ file ) use ( $ filter ) { // If there was a filter, force it to match if ( $ filter && ! preg_match ( "#$filter#i" , $ file [ 'path' ] ) ) return ; // Check that the file matches the pattern and get at the parts to make to // make the path to the src if ( ! preg_match ( '#' . URL :: PATTERN . '#' , $ file [ 'path' ] , $ matches ) ) return false ; $ src = $ matches [ 1 ] . '.' . $ matches [ 5 ] ; // Test that the src file exists return $ this -> getSrcDisk ( ) -> has ( $ src ) ; } ) ) ; }
Find all the crops witin the crops dir, optionally applying a filtering
regex to them

@param  string $filter A regex pattern
@return array
Find all the crops witin the crops dir optionally applying a filtering regex to them