We were trying to solve an issue where when we pushed from a windows development environment to a linux horizontally scaled production environment some of the VMs would not create all of the necessary files for our reports to run (table.css,koolreports.js, etc.). We tried to get around this by modifying the hashing function to no longer rely on the assets local path and manually push the created folders to our production environment.
So we went from this:
$objectHashFolderName = crc32(
"koolreport"
.$fullLocalPath
.@filemtime($fullLocalPath)
.$this->report->version().$version
);
to this:
$objectHashFolderName = crc32(
"koolreport"
.$this->report->version().$version
);
After making that modification, some of the files stopped being created even in our testing environment. In order to solve this we had to add a recurseCopy line to the following section of code in order to generate all of the files correctly. We then have to remove that line so the files do not get created over and over again.
if (!is_dir($objectTargetPath)) {
Utility::recurseCopy($fullLocalPath, $objectTargetPath);
} else {
Utility::recurseCopy($fullLocalPath, $objectTargetPath);
//Do the check if file in widgetSourceAssetPath is changed,
//If there is then copy again.
//Currently do nothing for now
}
I believe that means there is a bug somewhere on the file creation side if modifying something as small as the hashing function breaks the it.