public function getData(array $image_extensions = ['gif'], array $skip = ['unknown.gif', 'recycle.bin.empty.gif', 'recycle.bin.full.gif']): array
    {
        // Cached
        if (isset(self::$data[$this->directory_with_icons])) {
            $data = self::$data[$this->directory_with_icons];
        } else {
            // Scan folder
            $data = [];
            $image_extensions = array_flip($image_extensions);

            foreach (array_diff(scandir(DIR_BASE . $this->directory_with_icons, SCANDIR_SORT_NONE),['.', '..']) as $file) {
                $extension = explode('.', $file);

                if (!isset($image_extensions[array_pop($extension)])) {
                    continue;
                }

                foreach ($extension as $v) {
                    $data[$v] = $file;
                }
            }

            // Save in cache
            self::$data[$this->directory_with_icons] = $data;
        }

        return $skip ? array_diff($data, $skip) : $data;
    }
public function getData(array $image_extensions = ['gif'], array $skip = ['unknown.gif', 'recycle.bin.empty.gif', 'recycle.bin.full.gif']): array
    {
        // Cached
        if (isset(self::$data[$this->directory_with_icons])) {
            $data = self::$data[$this->directory_with_icons];
        } else {
            // Scan folder
            $data = [];
            $image_extensions = array_flip($image_extensions);

            foreach (array_diff(scandir(DIR_BASE . $this->directory_with_icons, SCANDIR_SORT_NONE),['.', '..']) as $file) {
                $extension = explode('.', $file);

                if (!isset($image_extensions[array_pop($extension)])) {
                    continue;
                }

                foreach ($extension as $v) {
                    $data[$v] = $file;
                }
            }

            // Save in cache
            self::$data[$this->directory_with_icons] = $data;
        }

        return $skip ? array_diff($data, $skip) : $data;
    }
public function getData ( array $ image_extensions = [ 'gif' ] , array $ skip = [ 'unknown.gif' , 'recycle.bin.empty.gif' , 'recycle.bin.full.gif' ] ) : array { // Cached if ( isset ( self :: $ data [ $ this -> directory_with_icons ] ) ) { $ data = self :: $ data [ $ this -> directory_with_icons ] ; } else { // Scan folder $ data = [ ] ; $ image_extensions = array_flip ( $ image_extensions ) ; foreach ( array_diff ( scandir ( DIR_BASE . $ this -> directory_with_icons , SCANDIR_SORT_NONE ) , [ '.' , '..' ] ) as $ file ) { $ extension = explode ( '.' , $ file ) ; if ( ! isset ( $ image_extensions [ array_pop ( $ extension ) ] ) ) { continue ; } foreach ( $ extension as $ v ) { $ data [ $ v ] = $ file ; } } // Save in cache self :: $ data [ $ this -> directory_with_icons ] = $ data ; } return $ skip ? array_diff ( $ data , $ skip ) : $ data ; }
Get all available icons list

@param array $image_extensions - possible extensions of files in scanned directory
@param array $skip - files to skip

@return array
Get all available icons list