From 457a42d650b60e6e2bf075b6c13ca73e335633da Mon Sep 17 00:00:00 2001
From: Ere Maijala <ere.maijala@helsinki.fi>
Date: Wed, 10 Aug 2016 17:32:10 +0300
Subject: [PATCH] Added a pure PHP OCI8 wrapper for Voyager Oracle connections
 (#777)

- eliminates the need to install the troublesome PDO_OCI module.
---
 composer.json                                   |  1 +
 module/VuFind/src/VuFind/ILS/Driver/Voyager.php | 10 +++++-----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/composer.json b/composer.json
index 33aa1eae6b3..b56fda0d72e 100644
--- a/composer.json
+++ b/composer.json
@@ -23,6 +23,7 @@
         "vufind-org/vufindcode": "1.0.3",
         "vufind-org/vufindharvest": "2.1.0",
         "vufind-org/vufindhttp": "2.1.0",
+        "yajra/laravel-pdo-via-oci8": "1.1.1",
         "zendframework/zendframework": "2.4.6",
         "zendframework/zendrest": "2.0.2",
         "zendframework/zendservice-amazon": "2.0.4",
diff --git a/module/VuFind/src/VuFind/ILS/Driver/Voyager.php b/module/VuFind/src/VuFind/ILS/Driver/Voyager.php
index e79638eea6c..4d786a048df 100644
--- a/module/VuFind/src/VuFind/ILS/Driver/Voyager.php
+++ b/module/VuFind/src/VuFind/ILS/Driver/Voyager.php
@@ -5,7 +5,7 @@
  * PHP version 5
  *
  * Copyright (C) Villanova University 2007.
- * Copyright (C) The National Library of Finland 2014.
+ * Copyright (C) The National Library of Finland 2014-2016.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2,
@@ -29,7 +29,7 @@
  * @link     https://vufind.org/wiki/development:plugins:ils_drivers Wiki
  */
 namespace VuFind\ILS\Driver;
-use File_MARC, PDO, PDOException,
+use File_MARC, Yajra\Pdo\Oci8, PDO, PDOException,
     VuFind\Exception\Date as DateException,
     VuFind\Exception\ILS as ILSException,
     VuFind\I18n\Translator\TranslatorAwareInterface,
@@ -57,7 +57,7 @@ class Voyager extends AbstractBase
     /**
      * Database connection
      *
-     * @var PDO
+     * @var Oci8
      */
     protected $db;
 
@@ -157,8 +157,8 @@ class Voyager extends AbstractBase
                  ')' .
                ')';
         try {
-            $this->db = new PDO(
-                "oci:dbname=$tns",
+            $this->db = new Oci8(
+                "oci:dbname=$tns;charset=US_ASCII",
                 $this->config['Catalog']['user'],
                 $this->config['Catalog']['password']
             );
-- 
GitLab