Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0.5: database sync from windows to linux does not work due to directory separator issue #252

Open
fritzmg opened this issue Dec 21, 2015 · 2 comments

Comments

@fritzmg
Copy link

fritzmg commented Dec 21, 2015

When doing a sync from a windows server to a linux client, the function SyncCtoDatabase::runRestore on the client recives a path like this for example:

/var/www/vhosts/foo/httpdocs/system\tmp\sql\2015-12-21_1159_DB-Backup.zip

Subsequently, syncCto will run

$objZipRead = new ZipReader($strRestoreFile);

and in the constructor of Contao\ZipReader there will be a file_exists check:

// Check if file exists
if (!file_exists(TL_ROOT . '/' . $strFile))
{
    throw new \Exception("Could not find file $strFile");
}

This check fails:

RPC Exception: Could not find file system\tmp\sql\2015-12-21_1145_DB-Backup.zip | #0 /var/www/vhosts/foo/httpdocs/composer/vendor/menatwork/synccto/system/modules/syncCto/SyncCtoDatabase.php(1013): Contao\ZipReader->__construct('system\\tmp\\sql\\...')

Normalizing the path in the beginning of the method like this

$strRestoreFile = str_replace(DIRECTORY_SEPARATOR == '/' ? '\\': '/', DIRECTORY_SEPARATOR, $strRestoreFile);

solves the problem.

@stefanheimes
Copy link
Member

Try the 3.1.0-beta1. If possible.

@m-vo
Copy link

m-vo commented Feb 3, 2016

Unfortunately not working for me (windows server / xampp-> linux client):

The overview shows e.g.: E:\path\to\project\files/subfolder/somefile.css (though it's the same file on the client) resulting in the error when finally trying to sync:

Die Datei E:\path\to\project\files\subfolder\somefile.css konnte nicht gefunden werden

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants