public function createSortorderFromFileList()
    {
        if(file_exists($this->path))
        {
            //SCANDIR_SORT_ASCENDING works for PHP 5.4 and above.
            //Instead of using constant there is 0 for the time being.
            $files = scandir($this->path, 0);

            if(false !== $files)
            {
                $sortorder = array();

                foreach($files as $file)
                {
                    if(!is_dir($this->path . DIRECTORY_SEPARATOR . $file))
                    {
                        $prefix = substr($file, 0, 1);
                        if($prefix != '.' && $prefix != '_')
                        {
                            $sortorder[] = $file;
                        }
                    }
                }

                return $sortorder;
            }
            // @codeCoverageIgnoreStart
            throw new \RuntimeException("Unable to access directory: " . $this->path);
            // @codeCoverageIgnoreEnd
        }
        throw new \InvalidArgumentException("Unable to read sortorder");
    }
public function createSortorderFromFileList()
    {
        if(file_exists($this->path))
        {
            //SCANDIR_SORT_ASCENDING works for PHP 5.4 and above.
            //Instead of using constant there is 0 for the time being.
            $files = scandir($this->path, 0);

            if(false !== $files)
            {
                $sortorder = array();

                foreach($files as $file)
                {
                    if(!is_dir($this->path . DIRECTORY_SEPARATOR . $file))
                    {
                        $prefix = substr($file, 0, 1);
                        if($prefix != '.' && $prefix != '_')
                        {
                            $sortorder[] = $file;
                        }
                    }
                }

                return $sortorder;
            }
            // @codeCoverageIgnoreStart
            throw new \RuntimeException("Unable to access directory: " . $this->path);
            // @codeCoverageIgnoreEnd
        }
        throw new \InvalidArgumentException("Unable to read sortorder");
    }
public function createSortorderFromFileList ( ) { if ( file_exists ( $ this -> path ) ) { //SCANDIR_SORT_ASCENDING works for PHP 5.4 and above. //Instead of using constant there is 0 for the time being. $ files = scandir ( $ this -> path , 0 ) ; if ( false !== $ files ) { $ sortorder = array ( ) ; foreach ( $ files as $ file ) { if ( ! is_dir ( $ this -> path . DIRECTORY_SEPARATOR . $ file ) ) { $ prefix = substr ( $ file , 0 , 1 ) ; if ( $ prefix != '.' && $ prefix != '_' ) { $ sortorder [ ] = $ file ; } } } return $ sortorder ; } // @codeCoverageIgnoreStart throw new \ RuntimeException ( "Unable to access directory: " . $ this -> path ) ; // @codeCoverageIgnoreEnd } throw new \ InvalidArgumentException ( "Unable to read sortorder" ) ; }
Create a sortorder file content from file list within path

@return array File list (excluding _ prefixed file)
@throws \InvalidArgumentException in case the folder is empty
Create a sortorder file content from file list within path