4 * @author Niklas Laxström
8 namespace LocalisationUpdate;
11 * Accesses file system directly.
13 class FileSystemFetcher implements Fetcher {
14 public function fetchFile( $url ) {
15 // Remove the protocol prefix
16 $url = preg_replace( '~^file://~', '', $url );
18 if ( !is_readable( $url ) ) {
22 return file_get_contents( $url );
25 public function fetchDirectory( $pattern ) {
26 // Remove the protocol prefix
27 $pattern = preg_replace( '~^file://~', '', $pattern );
30 foreach ( glob( $pattern ) as $file ) {
31 if ( is_readable( $file ) ) {
32 $data["file://$file"] = file_get_contents( $file );