Re: [garyhoffmann] Strict and Rename errors installing CMSB 2.17
I might have a resolution to it....
I changed the saveStruct routine to use rename_winsafe and then updated rename_winsafe to not die and to simply to the copy/unlink if the rename was unsuccessful and that got us past the problem. I don't know how many other places there will be a similar problem but wanted to pass on what I did and what I found.
I have 2.17 in a test area right now and plan to setup a test database with it as time permits, but I'm definitely behind schedule on a few projects, so don't know how much time I'll have to spend on it over the next several days.
However, I did get the chance to do a quick search of the rename function and there are not that many places within cmsAdmin that use the rename function:
C:\Downloads\CMS Builder\cmsBuilder217-windows\RootAddins\cmsAdmin>findstr /isc:"rename(" *.php
3rdParty\tiny_mce\plugins\spellchecker\classes\utils\Logger.php:
@rename($rfile, $nfile);
3rdParty\tiny_mce\plugins\spellchecker\classes\utils\Logger.php: @rename($log
File, $this->toOSPath($logFile . ".1"));
lib\common.php:// On windows PHP < 5.2.9 copy fails if the destination file exists so this function
tries a rename() then tries copy and unlink if rename fails
lib\common.php: // try rename() as-is first
lib\common.php: $r1 = @rename($oldfile,$newfile);
lib\common.php: if (!rename($tempFilepath, $filepath)) {
lib\common.php: @rename($defaultFile, $targetFile) || die("Error renaming '$defaultFile'!<br/
>Make sure this file and it's parent directory are writable!");
lib\menus\database\editTable_functions.php: rename($oldSchemaFilepath, $newSchemaFilepath) or die
("Error renaming schema file!");
lib\upload_functions.php: rename($uploadInfo['tmp_name'], $saveAsFilepath) || die("Error moving u
ploaded file! $php_errormsg");
C:\Downloads\CMS Builder\cmsBuilder217-windows\RootAddins\cmsAdmin>