4 * @author Niklas Laxström
8 namespace LocalisationUpdate;
11 * Constructs fetchers based on the repository urls.
13 class FetcherFactory {
14 public function getFetcher( $path ) {
15 if ( strpos( $path, 'https://raw.github.com/' ) === 0 ) {
16 return new GitHubFetcher();
17 } elseif ( strpos( $path, 'http://' ) === 0 ) {
18 return new HttpFetcher();
19 } elseif ( strpos( $path, 'https://' ) === 0 ) {
20 return new HttpFetcher();
22 return new FileSystemFetcher();