Skip to content

Commit

Permalink
Environment: use lcg_value instead of PID, cleanup TEMP folders
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Dec 13, 2016
1 parent a759edc commit a05addc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Environment.php
Expand Up @@ -82,14 +82,19 @@ public static function setupVariables($dir)

// Temp, cache directories
define('TMP_DIR', TESTER_DIR . '/tmp');
define('TEMP_DIR', TMP_DIR . '/tests/' . getmypid());
define('TEMP_DIR', TMP_DIR . '/tests/' . lcg_value());
define('CACHE_DIR', TMP_DIR . '/cache');
ini_set('session.save_path', TEMP_DIR);

// Create folders
self::mkdir(dirname(TEMP_DIR));
self::mkdir(TEMP_DIR);
self::mkdir(CACHE_DIR);
self::purge(TEMP_DIR);

register_shutdown_function(function () {
self::purge(TMP_DIR);
@rmdir(TMP_DIR);
});
}

/**
Expand Down

0 comments on commit a05addc

Please sign in to comment.