Bug 6193 - Follow up: use SetEnv and remove memcached from koha-conf.xml
[koha.git] / C4 / Context.pm
index 770973f..53246ec 100644 (file)
@@ -88,6 +88,7 @@ BEGIN {
                      servers => [ $servers ],
                      debug   => 0,
                      compress_threshold => 10_000,
+              expire_time => 600,
                      namespace => $ENV{'MEMCACHED_NAMESPACE'} || 'koha'
                  });
         # Verify memcached available (set a variable and test the output)
@@ -253,6 +254,31 @@ sub read_config_file {             # Pass argument naming config file to read
     return $koha;                      # Return value: ref-to-hash holding the configuration
 }
 
+=head2 ismemcached
+
+Returns the value of the $ismemcached variable (0/1)
+
+=cut
+
+sub ismemcached {
+    return $ismemcached;
+}
+
+=head2 memcached
+
+If $ismemcached is true, returns the $memcache variable.
+Returns undef otherwise
+
+=cut
+
+sub memcached {
+    if ($ismemcached) {
+      return $memcached;
+    } else {
+      return undef;
+    }
+}
+
 # db_scheme2dbi
 # Translates the full text name of a database into de appropiate dbi name
 #