mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Fix CI
This commit is contained in:
@@ -2772,7 +2772,7 @@ HTML;
|
||||
if (!utils::IsDevelopmentEnvironment()) {
|
||||
// Save to cache
|
||||
$sCacheContent = "<?php\n\nreturn ".var_export($aMatchingClasses, true).";";
|
||||
SetupUtils::builddir(dirname($sCacheFileName));
|
||||
self::builddir(dirname($sCacheFileName));
|
||||
file_put_contents($sCacheFileName, $sCacheContent);
|
||||
}
|
||||
}
|
||||
@@ -3194,4 +3194,25 @@ HTML;
|
||||
{
|
||||
return hash('sha256', uniqid(sprintf('%x', rand()), true).sprintf('%x', rand()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to build the full path of a new directory
|
||||
* @param $dir
|
||||
*/
|
||||
public static function builddir($dir)
|
||||
{
|
||||
if (empty($dir))
|
||||
{
|
||||
// avoid infinite loops :/
|
||||
return;
|
||||
}
|
||||
if (!is_dir($dir))
|
||||
{
|
||||
$parent = dirname($dir);
|
||||
self::builddir($parent);
|
||||
if (!mkdir($dir) && !is_dir($dir)) {
|
||||
throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user