/** * Cli controller */ public function SearchCli() { global $argc; global $argv; $cli = new Cli($argc, $argv); $fileparser = new FileParser($cli->getFilename()); $fileparser->parse(); $database = Database::getInstance(); $vendors = $database->findPackages($cli->getLocation(), $cli->getDate(), $cli->getCovers()); $view = new Result(); $view->displaySearchResults($vendors); }
/** * @param $file */ public function __construct($file) { $this->database = Database::getInstance(); $this->fileContent = file_get_contents($file); $this->vendors = explode(self::VENDOR_SEPARATOR, $this->fileContent); }