Initial commit

Functional, without SSO
This commit is contained in:
Jimmy Monin
2016-09-18 11:03:26 +02:00
commit 57708e3169
253 changed files with 30787 additions and 0 deletions

View File

@ -0,0 +1,24 @@
<?php
namespace AdService;
class ParserFactory
{
/**
* @param string $url
* @return \AdService\Parser\AbstractParser
*/
public static function factory($url)
{
if (false !== strpos($url, "leboncoin.fr")) {
return new Parser\Lbc();
}
if (false !== strpos($url, "olx.ua")) {
return new Parser\Olx();
}
if (false !== strpos($url, "seloger.com")) {
return new Parser\Seloger();
}
throw new Exception("No parser found");
}
}