/**
  * Quick parse modules feed.
  *
  * @param	string	$url		XML feed URL
  * @param	string	$cache_dir	Cache directoy or null for no cache
  * @param	boolean	$force		Force query repository
  * @return	object	Self instance
  */
 public static function quickParse($url, $cache_dir = null, $force = false)
 {
     $parser = new self();
     if ($cache_dir) {
         $parser->setCacheDir($cache_dir);
     }
     if ($force) {
         $parser->setForce($force);
     }
     return $parser->parse($url);
 }
Example #2
0
 /**
  * Creates a pre-configured instance of Wise.
  *
  * @param array|string $paths The configuration directory path(s).
  * @param string       $cache The cache directory path.
  * @param boolean      $debug Enable debugging?
  *
  * @return Wise The instance.
  */
 public static function create($paths, $cache = null, $debug = false)
 {
     $wise = new self($debug);
     if ($cache) {
         $wise->setCacheDir($cache);
     }
     $locator = new FileLocator($paths);
     $resolver = new LoaderResolver(array(new Loader\IniFileLoader($locator), new Loader\JsonFileLoader($locator), new Loader\PhpFileLoader($locator), new Loader\XmlFileLoader($locator), new Loader\YamlFileLoader($locator)));
     $wise->setCollector(new Resource\ResourceCollector());
     $wise->setLoader(new DelegatingLoader($resolver));
     $resolver->setResourceCollector($wise->getCollector());
     $resolver->setWise($wise);
     return $wise;
 }
Example #3
0
 /**
  * Quick Parse
  *
  * This static method returns a new {@link feedParser} instance for given URL. If a
  * <var>$cache_dir</var> is specified, cache will be activated.
  *
  * @param string	$url			Feed URL
  * @param string	$cache_dir	Cache directory
  * @return feedParser|false
  */
 public static function quickParse($url, $cache_dir = null)
 {
     $parser = new self();
     if ($cache_dir) {
         $parser->setCacheDir($cache_dir);
     }
     return $parser->parse($url);
 }