Skip to content

Commit b1372bd

Browse files
committed
Systemwide temporary cache, fixes #4
1 parent fe329da commit b1372bd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bashquote

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ abstract class Quotes {
2525
* Opens the quote cache.
2626
*/
2727
function __construct() {
28-
$this->quotefile = getenv('HOME')."/.bashqdb";
28+
if (file_exists(getenv('HOME')."/.bashqdb")) // Clean up old style cache
29+
unlink(getenv('HOME')."/.bashqdb");
30+
31+
$this->quotefile = sys_get_temp_dir() . PATH_SEPARATOR . "bashquote_cache";
2932
$this->quotefp = fopen($this->quotefile,"c+");
3033
// Only one instance accessing the cache at a time
3134
if (!flock($this->quotefp, LOCK_EX))

0 commit comments

Comments
 (0)