return $newTempDir;
}
- /**
- * Calculate a cumulative digest based on a collection of files.
- *
- * @param array $files
- * List of file names (strings).
- * @param callable|string $digest a one-way hash function (string => string)
- *
- * @return string
- */
- public static function digestAll($files, $digest = 'md5') {
- $buffer = '';
- foreach ($files as $file) {
- $buffer .= $digest(file_get_contents($file));
- }
- return $digest($buffer);
- }
-
- /**
- * Find the path to the main Civi source tree.
- *
- * @return string
- * @throws RuntimeException
- */
- public static function findCoreSourceDir() {
- $path = str_replace(DIRECTORY_SEPARATOR, '/', __DIR__);
- if (!preg_match(':(.*)/CRM/Core/CodeGen/Util:', $path, $matches)) {
- throw new RuntimeException("Failed to determine path of code-gen");
- }
-
- return $matches[1];
- }
-
}