Location: PHPKode > projects > DIY Blog > diy-blog/classes/diy-blog/backend/view/files/FileReader.class.php
<?php

/**
 * A small utility class to read file list from a directory.
 * @package diy-blog.backend.view.files
 * @author	Martynas Jusevicius <hide@address.com>
 * @link	http://www.xml.lt
 */

class FileReader
{

	public static function read($dir)
	{
		if ($handle = opendir($dir))
		{
			$files = array();

			while (false !== ($fileName = readdir($handle)))
				if ($fileName != "." && $fileName != "..") $files[] = new File($fileName);
			return $files;

		}
		else throw new Exception("Directory cannot be openned");
	}

}

?>
Return current item: DIY Blog