Example #1
0
 /**
  * Initialize the driver.
  *
  * Validate configuration and perform all resource-intensive tasks needed to
  * make the driver active.
  *
  * @throws ILSException
  * @return void
  */
 public function init()
 {
     parent::init();
     $this->catalogHost = $this->config['Catalog']['Host'];
     $this->renewalsScript = $this->config['Catalog']['renewalsScript'];
     $this->dbsid = isset($this->config['Catalog']['DB']) ? $this->config['Catalog']['DB'] : 1;
 }
Example #2
0
 /**
  * Constructor
  *
  * @access public
  */
 public function init()
 {
     parent::init();
     if (!isset($this->config['Catalog']['URL'])) {
         throw new ILSException('Catalog/URL configuration needs to be set.');
     }
     if (!(isset($this->config['PAIA']['URL']) || isset($this->config['Catalog']['loanURL']))) {
         throw new ILSException('Catalog/loanURL or PAIA/URL configuration needs to be set.');
     }
     $this->catalogURL = $this->config['Catalog']['URL'];
     $this->loanURL = $this->config['Catalog']['loanURL'];
     $this->opacfno = $this->config['Catalog']['opacfno'];
     $this->paiaURL = $this->config['PAIA']['URL'];
 }
Example #3
0
 /**
  * Create connector with fixture file.
  *
  * @param string $fixture Fixture file
  *
  * @return Connector
  *
  * @throws InvalidArgumentException Fixture file does not exist
  */
 protected function createConnector($fixture = null)
 {
     $adapter = new TestAdapter();
     if ($fixture) {
         $file = realpath(__DIR__ . '/../../../../../../tests/fixtures/daia/response/' . $fixture);
         if (!is_string($file) || !file_exists($file) || !is_readable($file)) {
             throw new InvalidArgumentException(sprintf('Unable to load fixture file: %s ', $file));
         }
         $response = file_get_contents($file);
         $responseObj = HttpResponse::fromString($response);
         $adapter->setResponse($responseObj);
     }
     $service = new \VuFindHttp\HttpService();
     $service->setDefaultAdapter($adapter);
     $conn = new DAIA(new \VuFind\Date\Converter());
     $conn->setHttpService($service);
     return $conn;
 }
Example #4
0
 /**
  * Factory for DAIA driver.
  *
  * @param ServiceManager $sm Service manager.
  *
  * @return DAIA
  */
 public static function getDAIA(ServiceManager $sm)
 {
     $daia = new DAIA($sm->getServiceLocator()->get('VuFind\\DateConverter'));
     $daia->setCacheStorage($sm->getServiceLocator()->get('VuFind\\CacheManager')->getCache('object'));
     return $daia;
 }
Example #5
0
 /**
  * Initialize the driver.
  *
  * Validate configuration and perform all resource-intensive tasks needed to
  * make the driver active.
  *
  * @throws ILSException
  * @return void
  */
 public function init()
 {
     parent::init();
     // initialize DAIA parent
     if (isset($this->config['Catalog']['opaciln'])) {
         $this->opaciln = $this->config['Catalog']['opaciln'];
     }
     if (isset($this->config['Catalog']['opacfno'])) {
         $this->opacfno = $this->config['Catalog']['opacfno'];
     }
     if (isset($this->config['Catalog']['opcloan'])) {
         $this->opcloan = $this->config['Catalog']['opcloan'];
     }
     if (isset($this->config['Catalog']['database'])) {
         putenv("SYBASE=" . $this->config['Catalog']['sybpath']);
         $this->db = sybase_connect($this->config['Catalog']['sybase'], $this->config['Catalog']['username'], $this->config['Catalog']['password']);
         sybase_select_db($this->config['Catalog']['database']);
     } else {
         throw new ILSException('No Database.');
     }
 }
Example #6
0
 /**
  * Initialize the driver.
  *
  * Validate configuration and perform all resource-intensive tasks needed to
  * make the driver active.
  *
  * @throws ILSException
  * @return void
  */
 public function init()
 {
     parent::init();
     if (!isset($this->config['PAIA']['baseUrl'])) {
         throw new ILSException('PAIA/baseUrl configuration needs to be set.');
     }
     $this->paiaURL = $this->config['PAIA']['baseUrl'];
     // use PAIA specific timeout setting for http requests if configured
     if (isset($this->config['PAIA']['timeout'])) {
         $this->paiaTimeout = $this->config['PAIA']['timeout'];
     }
     // do we have caching enabled for PAIA
     if (isset($this->config['PAIA']['paiaCache'])) {
         $this->paiaCacheEnabled = $this->config['PAIA']['paiaCache'];
     } else {
         $this->debug('Caching not enabled, disabling it by default.');
     }
 }