From da6dfd8958733114a5a33fe793cf922615c93791 Mon Sep 17 00:00:00 2001
From: Chris Skene <chris@xtfer.com>
Date: Wed, 4 Jan 2012 14:08:58 +1100
Subject: [PATCH] Fix an issue where ARC2 may be loaded by another module.

---
 .../simplerdf_sparql/simplerdf_sparql.store.inc    |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/modules/simplerdf_sparql/simplerdf_sparql.store.inc b/modules/simplerdf_sparql/simplerdf_sparql.store.inc
index 0ea5c0c..0037f9a 100755
--- a/modules/simplerdf_sparql/simplerdf_sparql.store.inc
+++ b/modules/simplerdf_sparql/simplerdf_sparql.store.inc
@@ -96,12 +96,14 @@ function _simplerdf_sparql_store_get($type) {
 function _simplerdf_sparql_store_make($type) {
   static $init;
   if (!$init) {
-    // Initialize ARC2
-    $arc_path = function_exists('libraries_get_path') ? libraries_get_path('arc') : 'sites/all/libraries/arc';
-    if (file_exists($arc_file = $arc_path . '/ARC2.php')) {
-      require_once $arc_file;
-      $init = TRUE;
+    if (!class_exists('ARC2')) {
+      // Initialize ARC2
+      $arc_path = function_exists('libraries_get_path') ? libraries_get_path('arc') : 'sites/all/libraries/arc';
+      if (file_exists($arc_file = $arc_path . '/ARC2.php')) {
+        require_once $arc_file;
+      }
     }
+    $init = TRUE;
   }
   if (class_exists('ARC2') && $config = simplerdf_sparql_store_config()) {
     $method = $type == 'endpoint' ? 'getStoreEndpoint' : 'getStore';
-- 
1.7.5.4

