Skip to content

Conversation

@Zxurian
Copy link
Contributor

@Zxurian Zxurian commented Oct 21, 2014

cli mode could be run from anywhere, so had to update the engine file to make sure it works with relative paths in the magmi config.

@dweeves
Copy link
Owner

dweeves commented Oct 21, 2014

you solution won't work if basedir is not relative to current magmi dir.
I'd rather ask you to use realpath($basedir).'/path/to/xml' , which would work in any situation i guess.

@Zxurian
Copy link
Contributor Author

Zxurian commented Oct 22, 2014

hm.. realpath($baseDir) wouldn't work either since relative paths would be based on where your running the cli script from.
The "Filesystem Path to magento directory" entry. If it's relative, what should it be relative to? the base magmi directory, or (as what seems to be the case now) the magmi/web directory?

@Zxurian
Copy link
Contributor Author

Zxurian commented Oct 22, 2014

A fix to allow for both relative & absolute paths could be something like this

if (substr($baseDir, 0, 1) == '/') {
    $xml = new SimpleXMLElement(file_get_contents($baseDir.'app/etc/local.xml', FILE_USE_INCLUDE_PATH));
} else {
    $xml = new SimpleXMLElement(file_get_contents(__DIR__.'/'.$baseDir.'app/etc/local.xml', FILE_USE_INCLUDE_PATH));
}

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants